diff --git a/packages/http-client-java/Setup.ps1 b/packages/http-client-java/Setup.ps1 index a3931d0261..fe128f20cb 100644 --- a/packages/http-client-java/Setup.ps1 +++ b/packages/http-client-java/Setup.ps1 @@ -1,15 +1,4 @@ -param ( - [switch] $RebuildJar = $false -) - -if ($RebuildJar) { - mvn clean install -f generator/pom.xml -DskipTests - if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE - } -} - # re-build http-client-java npm install npm run clean && npm run build - +npm pack diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index 2bc8a2f9d0..042e0ec1e4 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -2163,6 +2163,15 @@ export class CodeModelBuilder { // TODO: handle MultipartOptions.isMulti if (prop.multipartOptions.isFilePart) { schema = this.processMultipartFormDataFilePropertySchemaFromSdkType(prop); + } else if ( + prop.type.kind === "model" && + prop.type.properties.some((it) => it.kind === "body") + ) { + // TODO: this is HttpPart of non-File. TCGC should help handle this. + schema = this.processSchemaFromSdkType( + prop.type.properties.find((it) => it.kind === "body")!.type, + "" + ); } else { schema = this.processSchemaFromSdkType(nonNullType, ""); } diff --git a/packages/http-client-java/generator/http-client-generator-test/Generate.ps1 b/packages/http-client-java/generator/http-client-generator-test/Generate.ps1 index 7a8835f8be..bb0a06c220 100644 --- a/packages/http-client-java/generator/http-client-generator-test/Generate.ps1 +++ b/packages/http-client-java/generator/http-client-generator-test/Generate.ps1 @@ -123,16 +123,16 @@ Set-Location ./generator/http-client-generator-test if (Test-Path node_modules) { - Remove-Item node_modules -Recurse -Force + Remove-Item node_modules -Recurse -Force } if (Test-Path package-lock.json) { - Remove-Item package-lock.json + Remove-Item package-lock.json } # delete output if (Test-Path tsp-output) { - Remove-Item tsp-output -Recurse -Force + Remove-Item tsp-output -Recurse -Force } npm install diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json index db97006fa5..0fe46ae64c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-test/package.json @@ -11,7 +11,7 @@ "testserver-stop": "npx cadl-ranch server stop" }, "dependencies": { - "@azure-tools/cadl-ranch-specs": "0.36.1", + "@azure-tools/cadl-ranch-specs": "0.37.1", "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.0.tgz", "@typespec/http-client-java-tests": "file:" }, diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java similarity index 95% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java index e03c74f53f..96ba2652e1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyAsyncClient.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty; +package com._specs_.azure.clientgenerator.core.flattenproperty; -import com.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; -import com.azure.clientgenerator.core.flattenproperty.models.FlattenModel; -import com.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.FlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java similarity index 95% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java index bd6f734b4d..71d8953c35 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClient.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty; +package com._specs_.azure.clientgenerator.core.flattenproperty; -import com.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; -import com.azure.clientgenerator.core.flattenproperty.models.FlattenModel; -import com.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.FlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java similarity index 97% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java index 08b80bc950..05c15b2be7 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java @@ -2,9 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty; +package com._specs_.azure.clientgenerator.core.flattenproperty; -import com.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; +import com._specs_.azure.clientgenerator.core.flattenproperty.implementation.FlattenPropertyClientImpl; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; @@ -51,7 +51,7 @@ public final class FlattenPropertyClientBuilder implements HttpTrait PROPERTIES - = CoreUtils.getProperties("azure-clientgenerator-core-flattenproperty.properties"); + = CoreUtils.getProperties("_specs_-azure-clientgenerator-core-flattenproperty.properties"); @Generated private final List pipelinePolicies; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java similarity index 99% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java index 7444598c17..bd210bccec 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.implementation; +package com._specs_.azure.clientgenerator.core.flattenproperty.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/package-info.java similarity index 80% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/package-info.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/package-info.java index 3f9a12a00d..f0e05d26fd 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/implementation/package-info.java @@ -8,4 +8,4 @@ * Illustrates the model flatten cases. * */ -package com.azure.clientgenerator.core.flattenproperty.implementation; +package com._specs_.azure.clientgenerator.core.flattenproperty.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java similarity index 97% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java index 6d78ba0870..331638ceb4 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildFlattenModel.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.models; +package com._specs_.azure.clientgenerator.core.flattenproperty.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildModel.java similarity index 97% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildModel.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildModel.java index cb60a71d9b..8701199e73 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/ChildModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/ChildModel.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.models; +package com._specs_.azure.clientgenerator.core.flattenproperty.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java similarity index 97% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java index 43c764d4fb..81b7ec403c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/FlattenModel.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.models; +package com._specs_.azure.clientgenerator.core.flattenproperty.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java similarity index 97% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java index e0c9cfead4..f66a1ecb99 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/NestedFlattenModel.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.models; +package com._specs_.azure.clientgenerator.core.flattenproperty.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/package-info.java similarity index 82% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/package-info.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/package-info.java index 88a810bdf1..dd61fa628d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/models/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/models/package-info.java @@ -8,4 +8,4 @@ * Illustrates the model flatten cases. * */ -package com.azure.clientgenerator.core.flattenproperty.models; +package com._specs_.azure.clientgenerator.core.flattenproperty.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/package-info.java similarity index 83% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/package-info.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/package-info.java index c4e89c5cd7..25a2de0166 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/clientgenerator/core/flattenproperty/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/clientgenerator/core/flattenproperty/package-info.java @@ -8,4 +8,4 @@ * Illustrates the model flatten cases. * */ -package com.azure.clientgenerator.core.flattenproperty; +package com._specs_.azure.clientgenerator.core.flattenproperty; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java index fb9519930c..979695fcef 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java @@ -7,6 +7,7 @@ import com._specs_.azure.core.basic.implementation.BasicClientImpl; import com._specs_.azure.core.basic.implementation.JsonMergePatchHelper; import com._specs_.azure.core.basic.models.User; +import com._specs_.azure.core.basic.models.UserList; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -295,6 +296,45 @@ public Mono> exportWithResponse(int id, String format, Requ return this.serviceClient.exportWithResponseAsync(id, format, requestOptions); } + /** + * Exports all users. + * + * Exports all users. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     users (Required): [
+     *          (Required){
+     *             id: int (Required)
+     *             name: String (Optional, Required on create)
+     *             orders (Optional): [
+     *                  (Optional){
+     *                     id: int (Required)
+     *                     userId: int (Optional, Required on create)
+     *                     detail: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *             etag: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format The format of the data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> exportAllUsersWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.exportAllUsersWithResponseAsync(format, requestOptions); + } + /** * Adds a user or updates a user's fields. * @@ -521,4 +561,27 @@ public Mono export(int id, String format) { return exportWithResponse(id, format, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(User.class)); } + + /** + * Exports all users. + * + * Exports all users. + * + * @param format The format of the data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportAllUsers(String format) { + // Generated convenience method for exportAllUsersWithResponse + RequestOptions requestOptions = new RequestOptions(); + return exportAllUsersWithResponse(format, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserList.class)); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicClient.java index 5dec8c6178..b84adfec4e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/BasicClient.java @@ -7,6 +7,7 @@ import com._specs_.azure.core.basic.implementation.BasicClientImpl; import com._specs_.azure.core.basic.implementation.JsonMergePatchHelper; import com._specs_.azure.core.basic.models.User; +import com._specs_.azure.core.basic.models.UserList; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -288,6 +289,45 @@ public Response exportWithResponse(int id, String format, RequestOpt return this.serviceClient.exportWithResponse(id, format, requestOptions); } + /** + * Exports all users. + * + * Exports all users. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     users (Required): [
+     *          (Required){
+     *             id: int (Required)
+     *             name: String (Optional, Required on create)
+     *             orders (Optional): [
+     *                  (Optional){
+     *                     id: int (Required)
+     *                     userId: int (Optional, Required on create)
+     *                     detail: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *             etag: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format The format of the data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportAllUsersWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.exportAllUsersWithResponse(format, requestOptions); + } + /** * Adds a user or updates a user's fields. * @@ -485,4 +525,26 @@ public User export(int id, String format) { RequestOptions requestOptions = new RequestOptions(); return exportWithResponse(id, format, requestOptions).getValue().toObject(User.class); } + + /** + * Exports all users. + * + * Exports all users. + * + * @param format The format of the data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserList exportAllUsers(String format) { + // Generated convenience method for exportAllUsersWithResponse + RequestOptions requestOptions = new RequestOptions(); + return exportAllUsersWithResponse(format, requestOptions).getValue().toObject(UserList.class); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 20ae11448b..32e1118343 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -283,6 +283,26 @@ Response exportSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Post("/azure/core/basic/users:exportallusers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> exportAllUsers(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("format") String format, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/azure/core/basic/users:exportallusers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response exportAllUsersSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("format") String format, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -970,6 +990,86 @@ public Response exportWithResponse(int id, String format, RequestOpt requestOptions, Context.NONE); } + /** + * Exports all users. + * + * Exports all users. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     users (Required): [
+     *          (Required){
+     *             id: int (Required)
+     *             name: String (Optional, Required on create)
+     *             orders (Optional): [
+     *                  (Optional){
+     *                     id: int (Required)
+     *                     userId: int (Optional, Required on create)
+     *                     detail: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *             etag: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format The format of the data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> exportAllUsersWithResponseAsync(String format, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.exportAllUsers(this.getEndpoint(), + this.getServiceVersion().getVersion(), format, accept, requestOptions, context)); + } + + /** + * Exports all users. + * + * Exports all users. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     users (Required): [
+     *          (Required){
+     *             id: int (Required)
+     *             name: String (Optional, Required on create)
+     *             orders (Optional): [
+     *                  (Optional){
+     *                     id: int (Required)
+     *                     userId: int (Optional, Required on create)
+     *                     detail: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *             etag: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format The format of the data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportAllUsersWithResponse(String format, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.exportAllUsersSync(this.getEndpoint(), this.getServiceVersion().getVersion(), format, accept, + requestOptions, Context.NONE); + } + /** * Lists all users. * diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/models/UserList.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/models/UserList.java new file mode 100644 index 0000000000..99af143b3d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/_specs_/azure/core/basic/models/UserList.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.basic.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The UserList model. + */ +@Immutable +public final class UserList implements JsonSerializable { + /* + * The users property. + */ + @Generated + private final List users; + + /** + * Creates an instance of UserList class. + * + * @param users the users value to set. + */ + @Generated + private UserList(List users) { + this.users = users; + } + + /** + * Get the users property: The users property. + * + * @return the users value. + */ + @Generated + public List getUsers() { + return this.users; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("users", this.users, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserList. + */ + @Generated + public static UserList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List users = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("users".equals(fieldName)) { + users = reader.readArray(reader1 -> User.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new UserList(users); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java index 8b3adc0289..96265edfcb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java @@ -26,8 +26,10 @@ import com.azure.resourcemanager.models.resources.fluent.ResourcesClient; import com.azure.resourcemanager.models.resources.implementation.NestedProxyResourcesImpl; import com.azure.resourcemanager.models.resources.implementation.ResourcesClientBuilder; +import com.azure.resourcemanager.models.resources.implementation.SingletonTrackedResourcesImpl; import com.azure.resourcemanager.models.resources.implementation.TopLevelTrackedResourcesImpl; import com.azure.resourcemanager.models.resources.models.NestedProxyResources; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResources; import com.azure.resourcemanager.models.resources.models.TopLevelTrackedResources; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -45,6 +47,8 @@ public final class ResourcesManager { private NestedProxyResources nestedProxyResources; + private SingletonTrackedResources singletonTrackedResources; + private final ResourcesClient clientObject; private ResourcesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -280,6 +284,19 @@ public NestedProxyResources nestedProxyResources() { return nestedProxyResources; } + /** + * Gets the resource collection API of SingletonTrackedResources. + * + * @return Resource collection API of SingletonTrackedResources. + */ + public SingletonTrackedResources singletonTrackedResources() { + if (this.singletonTrackedResources == null) { + this.singletonTrackedResources + = new SingletonTrackedResourcesImpl(clientObject.getSingletonTrackedResources(), this); + } + return singletonTrackedResources; + } + /** * Gets wrapped service client ResourcesClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java index eef0d18124..9f2ed05458 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java @@ -59,4 +59,11 @@ public interface ResourcesClient { * @return the NestedProxyResourcesClient object. */ NestedProxyResourcesClient getNestedProxyResources(); + + /** + * Gets the SingletonTrackedResourcesClient object to access its operations. + * + * @return the SingletonTrackedResourcesClient object. + */ + SingletonTrackedResourcesClient getSingletonTrackedResources(); } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/SingletonTrackedResourcesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/SingletonTrackedResourcesClient.java new file mode 100644 index 0000000000..0c95e1f8da --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/SingletonTrackedResourcesClient.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; + +/** + * An instance of this class provides access to all the operations defined in SingletonTrackedResourcesClient. + */ +public interface SingletonTrackedResourcesClient { + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SingletonTrackedResourceInner getByResourceGroup(String resourceGroupName); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SingletonTrackedResourceInner> + beginCreateOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SingletonTrackedResourceInner> + beginCreateOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource, Context context); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SingletonTrackedResourceInner createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SingletonTrackedResourceInner createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource, + Context context); + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, + SingletonTrackedResourceInner properties, Context context); + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SingletonTrackedResourceInner update(String resourceGroupName, SingletonTrackedResourceInner properties); + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java new file mode 100644 index 0000000000..f5b4a628df --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class SingletonTrackedResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SingletonTrackedResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SingletonTrackedResourceInner class. + */ + public SingletonTrackedResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SingletonTrackedResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SingletonTrackedResourceInner object itself. + */ + public SingletonTrackedResourceInner withProperties(SingletonTrackedResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SingletonTrackedResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SingletonTrackedResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (location() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model SingletonTrackedResourceInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SingletonTrackedResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingletonTrackedResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingletonTrackedResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SingletonTrackedResourceInner. + */ + public static SingletonTrackedResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingletonTrackedResourceInner deserializedSingletonTrackedResourceInner + = new SingletonTrackedResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSingletonTrackedResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.properties + = SingletonTrackedResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSingletonTrackedResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSingletonTrackedResourceInner; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java index 9589bb096d..8d0b42c73e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.models.resources.fluent.NestedProxyResourcesClient; import com.azure.resourcemanager.models.resources.fluent.ResourcesClient; +import com.azure.resourcemanager.models.resources.fluent.SingletonTrackedResourcesClient; import com.azure.resourcemanager.models.resources.fluent.TopLevelTrackedResourcesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -152,6 +153,20 @@ public NestedProxyResourcesClient getNestedProxyResources() { return this.nestedProxyResources; } + /** + * The SingletonTrackedResourcesClient object to access its operations. + */ + private final SingletonTrackedResourcesClient singletonTrackedResources; + + /** + * Gets the SingletonTrackedResourcesClient object to access its operations. + * + * @return the SingletonTrackedResourcesClient object. + */ + public SingletonTrackedResourcesClient getSingletonTrackedResources() { + return this.singletonTrackedResources; + } + /** * Initializes an instance of ResourcesClient client. * @@ -172,6 +187,7 @@ public NestedProxyResourcesClient getNestedProxyResources() { this.apiVersion = "2023-12-01-preview"; this.topLevelTrackedResources = new TopLevelTrackedResourcesClientImpl(this); this.nestedProxyResources = new NestedProxyResourcesClientImpl(this); + this.singletonTrackedResources = new SingletonTrackedResourcesClientImpl(this); } /** diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourceImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourceImpl.java new file mode 100644 index 0000000000..b83d8f1489 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResource; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties; +import java.util.Collections; +import java.util.Map; + +public final class SingletonTrackedResourceImpl implements SingletonTrackedResource { + private SingletonTrackedResourceInner innerObject; + + private final com.azure.resourcemanager.models.resources.ResourcesManager serviceManager; + + SingletonTrackedResourceImpl(SingletonTrackedResourceInner innerObject, + com.azure.resourcemanager.models.resources.ResourcesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SingletonTrackedResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SingletonTrackedResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.models.resources.ResourcesManager manager() { + return this.serviceManager; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesClientImpl.java new file mode 100644 index 0000000000..5bb1785271 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesClientImpl.java @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.models.resources.fluent.SingletonTrackedResourcesClient; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; +import com.azure.resourcemanager.models.resources.implementation.models.SingletonTrackedResourceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SingletonTrackedResourcesClient. + */ +public final class SingletonTrackedResourcesClientImpl implements SingletonTrackedResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SingletonTrackedResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ResourcesClientImpl client; + + /** + * Initializes an instance of SingletonTrackedResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SingletonTrackedResourcesClientImpl(ResourcesClientImpl client) { + this.service = RestProxy.create(SingletonTrackedResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourcesClientSingletonTrackedResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ResourcesClientSingl") + public interface SingletonTrackedResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SingletonTrackedResourceInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SingletonTrackedResourceInner properties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context); + } + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SingletonTrackedResourceInner getByResourceGroup(String resourceGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + SingletonTrackedResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + SingletonTrackedResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, resource, context); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SingletonTrackedResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, SingletonTrackedResourceInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SingletonTrackedResourceInner.class, SingletonTrackedResourceInner.class, + this.client.getContext()); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SingletonTrackedResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, SingletonTrackedResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SingletonTrackedResourceInner.class, SingletonTrackedResourceInner.class, + context); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SingletonTrackedResourceInner> + beginCreateOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, resource).getSyncPoller(); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SingletonTrackedResourceInner> + beginCreateOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, resource, context).getSyncPoller(); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + SingletonTrackedResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + SingletonTrackedResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SingletonTrackedResourceInner createOrUpdate(String resourceGroupName, + SingletonTrackedResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, resource).block(); + } + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SingletonTrackedResourceInner createOrUpdate(String resourceGroupName, + SingletonTrackedResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, resource, context).block(); + } + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + SingletonTrackedResourceInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + SingletonTrackedResourceInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, contentType, accept, properties, context); + } + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + SingletonTrackedResourceInner properties) { + return updateWithResponseAsync(resourceGroupName, properties).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, + SingletonTrackedResourceInner properties, Context context) { + return updateWithResponseAsync(resourceGroupName, properties, context).block(); + } + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SingletonTrackedResourceInner update(String resourceGroupName, SingletonTrackedResourceInner properties) { + return updateWithResponse(resourceGroupName, properties, Context.NONE).getValue(); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List SingletonTrackedResource resources by resource group + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SingletonTrackedResource resources by resource group + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesImpl.java new file mode 100644 index 0000000000..8e6424cb30 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/SingletonTrackedResourcesImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.models.resources.fluent.SingletonTrackedResourcesClient; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResource; +import com.azure.resourcemanager.models.resources.models.SingletonTrackedResources; + +public final class SingletonTrackedResourcesImpl implements SingletonTrackedResources { + private static final ClientLogger LOGGER = new ClientLogger(SingletonTrackedResourcesImpl.class); + + private final SingletonTrackedResourcesClient innerClient; + + private final com.azure.resourcemanager.models.resources.ResourcesManager serviceManager; + + public SingletonTrackedResourcesImpl(SingletonTrackedResourcesClient innerClient, + com.azure.resourcemanager.models.resources.ResourcesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SingletonTrackedResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SingletonTrackedResource getByResourceGroup(String resourceGroupName) { + SingletonTrackedResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName); + if (inner != null) { + return new SingletonTrackedResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public SingletonTrackedResource createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource) { + SingletonTrackedResourceInner inner = this.serviceClient().createOrUpdate(resourceGroupName, resource); + if (inner != null) { + return new SingletonTrackedResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public SingletonTrackedResource createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource, + Context context) { + SingletonTrackedResourceInner inner = this.serviceClient().createOrUpdate(resourceGroupName, resource, context); + if (inner != null) { + return new SingletonTrackedResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, + SingletonTrackedResourceInner properties, Context context) { + Response inner + = this.serviceClient().updateWithResponse(resourceGroupName, properties, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SingletonTrackedResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SingletonTrackedResource update(String resourceGroupName, SingletonTrackedResourceInner properties) { + SingletonTrackedResourceInner inner = this.serviceClient().update(resourceGroupName, properties); + if (inner != null) { + return new SingletonTrackedResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SingletonTrackedResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SingletonTrackedResourceImpl(inner1, this.manager())); + } + + private SingletonTrackedResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.models.resources.ResourcesManager manager() { + return this.serviceManager; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/models/SingletonTrackedResourceListResult.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/models/SingletonTrackedResourceListResult.java new file mode 100644 index 0000000000..b813e26993 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/implementation/models/SingletonTrackedResourceListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SingletonTrackedResource list operation. + */ +@Immutable +public final class SingletonTrackedResourceListResult implements JsonSerializable { + /* + * The SingletonTrackedResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SingletonTrackedResourceListResult class. + */ + private SingletonTrackedResourceListResult() { + } + + /** + * Get the value property: The SingletonTrackedResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SingletonTrackedResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SingletonTrackedResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingletonTrackedResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingletonTrackedResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SingletonTrackedResourceListResult. + */ + public static SingletonTrackedResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingletonTrackedResourceListResult deserializedSingletonTrackedResourceListResult + = new SingletonTrackedResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SingletonTrackedResourceInner.fromJson(reader1)); + deserializedSingletonTrackedResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSingletonTrackedResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSingletonTrackedResourceListResult; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResource.java new file mode 100644 index 0000000000..07a7d955cb --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of SingletonTrackedResource. + */ +public interface SingletonTrackedResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SingletonTrackedResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner object. + * + * @return the inner object. + */ + SingletonTrackedResourceInner innerModel(); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResourceProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResourceProperties.java new file mode 100644 index 0000000000..ab743822d5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResourceProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Singleton Arm Resource Properties. + */ +@Fluent +public final class SingletonTrackedResourceProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * The description of the resource. + */ + private String description; + + /** + * Creates an instance of SingletonTrackedResourceProperties class. + */ + public SingletonTrackedResourceProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the SingletonTrackedResourceProperties object itself. + */ + public SingletonTrackedResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingletonTrackedResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingletonTrackedResourceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SingletonTrackedResourceProperties. + */ + public static SingletonTrackedResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingletonTrackedResourceProperties deserializedSingletonTrackedResourceProperties + = new SingletonTrackedResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSingletonTrackedResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSingletonTrackedResourceProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSingletonTrackedResourceProperties; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResources.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResources.java new file mode 100644 index 0000000000..ba3c61592e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/azure/resourcemanager/models/resources/models/SingletonTrackedResources.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.models.resources.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.models.resources.fluent.models.SingletonTrackedResourceInner; + +/** + * Resource collection API of SingletonTrackedResources. + */ +public interface SingletonTrackedResources { + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Get a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SingletonTrackedResource. + */ + SingletonTrackedResource getByResourceGroup(String resourceGroupName); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + SingletonTrackedResource createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource); + + /** + * Create a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + SingletonTrackedResource createOrUpdate(String resourceGroupName, SingletonTrackedResourceInner resource, + Context context); + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, + SingletonTrackedResourceInner properties, Context context); + + /** + * Update a SingletonTrackedResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + SingletonTrackedResource update(String resourceGroupName, SingletonTrackedResourceInner properties); + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SingletonTrackedResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SingletonTrackedResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericAsyncClient.java index 042e6e6b9e..3ae0ecfa30 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericAsyncClient.java @@ -19,6 +19,7 @@ import com.encode.numeric.implementation.PropertiesImpl; import com.encode.numeric.models.SafeintAsStringProperty; import com.encode.numeric.models.Uint32AsStringProperty; +import com.encode.numeric.models.Uint8AsStringProperty; import reactor.core.publisher.Mono; /** @@ -57,7 +58,7 @@ public final class NumericAsyncClient { * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -67,8 +68,8 @@ public final class NumericAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> safeintAsStringWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.safeintAsStringWithResponseAsync(body, requestOptions); + public Mono> safeintAsStringWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.safeintAsStringWithResponseAsync(value, requestOptions); } /** @@ -89,7 +90,7 @@ public Mono> safeintAsStringWithResponse(BinaryData body, R * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -99,15 +100,47 @@ public Mono> safeintAsStringWithResponse(BinaryData body, R */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uint32AsStringOptionalWithResponse(BinaryData body, + public Mono> uint32AsStringOptionalWithResponse(BinaryData value, RequestOptions requestOptions) { - return this.serviceClient.uint32AsStringOptionalWithResponseAsync(body, requestOptions); + return this.serviceClient.uint32AsStringOptionalWithResponseAsync(value, requestOptions); + } + + /** + * The uint8AsString operation. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + * @param value The value parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uint8AsStringWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.uint8AsStringWithResponseAsync(value, requestOptions); } /** * The safeintAsString operation. * - * @param body The body parameter. + * @param value The value parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -118,17 +151,17 @@ public Mono> uint32AsStringOptionalWithResponse(BinaryData */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono safeintAsString(SafeintAsStringProperty body) { + public Mono safeintAsString(SafeintAsStringProperty value) { // Generated convenience method for safeintAsStringWithResponse RequestOptions requestOptions = new RequestOptions(); - return safeintAsStringWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + return safeintAsStringWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(SafeintAsStringProperty.class)); } /** * The uint32AsStringOptional operation. * - * @param body The body parameter. + * @param value The value parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -139,10 +172,32 @@ public Mono safeintAsString(SafeintAsStringProperty bod */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uint32AsStringOptional(Uint32AsStringProperty body) { + public Mono uint32AsStringOptional(Uint32AsStringProperty value) { // Generated convenience method for uint32AsStringOptionalWithResponse RequestOptions requestOptions = new RequestOptions(); - return uint32AsStringOptionalWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + return uint32AsStringOptionalWithResponse(BinaryData.fromObject(value), requestOptions) + .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Uint32AsStringProperty.class)); } + + /** + * The uint8AsString operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono uint8AsString(Uint8AsStringProperty value) { + // Generated convenience method for uint8AsStringWithResponse + RequestOptions requestOptions = new RequestOptions(); + return uint8AsStringWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Uint8AsStringProperty.class)); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericClient.java index 1c49f851d2..e0e8334a50 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/NumericClient.java @@ -18,6 +18,7 @@ import com.encode.numeric.implementation.PropertiesImpl; import com.encode.numeric.models.SafeintAsStringProperty; import com.encode.numeric.models.Uint32AsStringProperty; +import com.encode.numeric.models.Uint8AsStringProperty; /** * Initializes a new instance of the synchronous NumericClient type. @@ -55,7 +56,7 @@ public final class NumericClient { * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -65,8 +66,8 @@ public final class NumericClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response safeintAsStringWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.safeintAsStringWithResponse(body, requestOptions); + public Response safeintAsStringWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.safeintAsStringWithResponse(value, requestOptions); } /** @@ -87,7 +88,7 @@ public Response safeintAsStringWithResponse(BinaryData body, Request * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -97,14 +98,46 @@ public Response safeintAsStringWithResponse(BinaryData body, Request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response uint32AsStringOptionalWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.uint32AsStringOptionalWithResponse(body, requestOptions); + public Response uint32AsStringOptionalWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.uint32AsStringOptionalWithResponse(value, requestOptions); + } + + /** + * The uint8AsString operation. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + * @param value The value parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uint8AsStringWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.uint8AsStringWithResponse(value, requestOptions); } /** * The safeintAsString operation. * - * @param body The body parameter. + * @param value The value parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -115,17 +148,17 @@ public Response uint32AsStringOptionalWithResponse(BinaryData body, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SafeintAsStringProperty safeintAsString(SafeintAsStringProperty body) { + public SafeintAsStringProperty safeintAsString(SafeintAsStringProperty value) { // Generated convenience method for safeintAsStringWithResponse RequestOptions requestOptions = new RequestOptions(); - return safeintAsStringWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + return safeintAsStringWithResponse(BinaryData.fromObject(value), requestOptions).getValue() .toObject(SafeintAsStringProperty.class); } /** * The uint32AsStringOptional operation. * - * @param body The body parameter. + * @param value The value parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -136,10 +169,31 @@ public SafeintAsStringProperty safeintAsString(SafeintAsStringProperty body) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Uint32AsStringProperty uint32AsStringOptional(Uint32AsStringProperty body) { + public Uint32AsStringProperty uint32AsStringOptional(Uint32AsStringProperty value) { // Generated convenience method for uint32AsStringOptionalWithResponse RequestOptions requestOptions = new RequestOptions(); - return uint32AsStringOptionalWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + return uint32AsStringOptionalWithResponse(BinaryData.fromObject(value), requestOptions).getValue() .toObject(Uint32AsStringProperty.class); } + + /** + * The uint8AsString operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Uint8AsStringProperty uint8AsString(Uint8AsStringProperty value) { + // Generated convenience method for uint8AsStringWithResponse + RequestOptions requestOptions = new RequestOptions(); + return uint8AsStringWithResponse(BinaryData.fromObject(value), requestOptions).getValue() + .toObject(Uint8AsStringProperty.class); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java index 072d8ed024..00c4b294c4 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java @@ -66,7 +66,7 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> safeintAsString(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/safeint") @ExpectedResponses({ 200 }) @@ -76,7 +76,7 @@ Mono> safeintAsString(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response safeintAsStringSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/uint32") @ExpectedResponses({ 200 }) @@ -86,7 +86,7 @@ Response safeintAsStringSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uint32AsStringOptional(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/uint32") @ExpectedResponses({ 200 }) @@ -96,7 +96,27 @@ Mono> uint32AsStringOptional(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response uint32AsStringOptionalSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/numeric/property/uint8") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uint8AsString(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/numeric/property/uint8") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uint8AsStringSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); } /** @@ -117,7 +137,7 @@ Response uint32AsStringOptionalSync(@HostParam("endpoint") String en * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -126,11 +146,12 @@ Response uint32AsStringOptionalSync(@HostParam("endpoint") String en * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> safeintAsStringWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + public Mono> safeintAsStringWithResponseAsync(BinaryData value, + RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.safeintAsString(this.client.getEndpoint(), contentType, accept, - body, requestOptions, context)); + value, requestOptions, context)); } /** @@ -151,7 +172,7 @@ public Mono> safeintAsStringWithResponseAsync(BinaryData bo * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -160,10 +181,10 @@ public Mono> safeintAsStringWithResponseAsync(BinaryData bo * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response safeintAsStringWithResponse(BinaryData body, RequestOptions requestOptions) { + public Response safeintAsStringWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.safeintAsStringSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + return service.safeintAsStringSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, Context.NONE); } @@ -185,7 +206,7 @@ public Response safeintAsStringWithResponse(BinaryData body, Request * } * } * - * @param body The body parameter. + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -194,12 +215,12 @@ public Response safeintAsStringWithResponse(BinaryData body, Request * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uint32AsStringOptionalWithResponseAsync(BinaryData body, + public Mono> uint32AsStringOptionalWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.uint32AsStringOptional(this.client.getEndpoint(), contentType, - accept, body, requestOptions, context)); + accept, value, requestOptions, context)); } /** @@ -220,7 +241,75 @@ public Mono> uint32AsStringOptionalWithResponseAsync(Binary * } * } * - * @param body The body parameter. + * @param value The value parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uint32AsStringOptionalWithResponse(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.uint32AsStringOptionalSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, + Context.NONE); + } + + /** + * The uint8AsString operation. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + * @param value The value parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uint8AsStringWithResponseAsync(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.uint8AsString(this.client.getEndpoint(), contentType, accept, + value, requestOptions, context)); + } + + /** + * The uint8AsString operation. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     value: int (Required)
+     * }
+     * }
+ * + * @param value The value parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -229,10 +318,10 @@ public Mono> uint32AsStringOptionalWithResponseAsync(Binary * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uint32AsStringOptionalWithResponse(BinaryData body, RequestOptions requestOptions) { + public Response uint8AsStringWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.uint32AsStringOptionalSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + return service.uint8AsStringSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, Context.NONE); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/models/Uint8AsStringProperty.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/models/Uint8AsStringProperty.java new file mode 100644 index 0000000000..dec3d77edf --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/encode/numeric/models/Uint8AsStringProperty.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.encode.numeric.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; + +/** + * The Uint8AsStringProperty model. + */ +@Immutable +public final class Uint8AsStringProperty implements JsonSerializable { + /* + * The value property. + */ + @Generated + private final int value; + + /** + * Creates an instance of Uint8AsStringProperty class. + * + * @param value the value value to set. + */ + @Generated + public Uint8AsStringProperty(int value) { + this.value = value; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public int getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", Objects.toString(this.value, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Uint8AsStringProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Uint8AsStringProperty if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Uint8AsStringProperty. + */ + @Generated + public static Uint8AsStringProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int value = Integer.parseInt("0"); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.getNullable(nonNullReader -> Integer.parseInt(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return new Uint8AsStringProperty(value); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataAsyncClient.java similarity index 62% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartAsyncClient.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataAsyncClient.java index 9f2b381464..6667c9a41b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataAsyncClient.java @@ -20,12 +20,7 @@ import com.payload.multipart.implementation.MultipartFormDataHelper; import com.payload.multipart.implementation.models.AnonymousModelRequest; import com.payload.multipart.models.BinaryArrayPartsRequest; -import com.payload.multipart.models.ComplexHttpPartsModelRequest; import com.payload.multipart.models.ComplexPartsRequest; -import com.payload.multipart.models.FileRequiredMetaData; -import com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest; -import com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest; -import com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest; import com.payload.multipart.models.JsonPartRequest; import com.payload.multipart.models.MultiBinaryPartsRequest; import com.payload.multipart.models.MultiPartRequest; @@ -38,17 +33,17 @@ * Initializes a new instance of the asynchronous MultiPartClient type. */ @ServiceClient(builder = MultiPartClientBuilder.class, isAsync = true) -public final class MultiPartAsyncClient { +public final class FormDataAsyncClient { @Generated private final FormDatasImpl serviceClient; /** - * Initializes an instance of MultiPartAsyncClient class. + * Initializes an instance of FormDataAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - MultiPartAsyncClient(FormDatasImpl serviceClient) { + FormDataAsyncClient(FormDatasImpl serviceClient) { this.serviceClient = serviceClient; } @@ -84,10 +79,10 @@ Mono> basicWithResponse(BinaryData body, RequestOptions requestOp */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> complexWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation 'complex' is - // 'multipart/form-data' - return this.serviceClient.complexWithResponseAsync(body, requestOptions); + Mono> fileArrayAndBasicWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'fileArrayAndBasic' is 'multipart/form-data' + return this.serviceClient.fileArrayAndBasicWithResponseAsync(body, requestOptions); } /** @@ -185,85 +180,6 @@ Mono> anonymousModelWithResponse(BinaryData anonymousModelRequest return this.serviceClient.anonymousModelWithResponseAsync(anonymousModelRequest, requestOptions); } - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> fileWithHttpPartSpecificContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartSpecificContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartSpecificContentTypeWithResponseAsync(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> fileWithHttpPartRequiredContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartRequiredContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartRequiredContentTypeWithResponseAsync(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> fileWithHttpPartOptionalContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartOptionalContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartOptionalContentTypeWithResponseAsync(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> complexWithHttpPartWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'complexWithHttpPart' is 'multipart/form-data' - return this.serviceClient.complexWithHttpPartWithResponseAsync(body, requestOptions); - } - /** * Test content-type: multipart/form-data. * @@ -302,19 +218,21 @@ public Mono basic(MultiPartRequest body) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono complex(ComplexPartsRequest body) { - // Generated convenience method for complexWithResponse + public Mono fileArrayAndBasic(ComplexPartsRequest body) { + // Generated convenience method for fileArrayAndBasicWithResponse RequestOptions requestOptions = new RequestOptions(); - return complexWithResponse(new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) - .serializeJsonField("address", body.getAddress()) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .serializeFileFields("pictures", - body.getPictures().stream().map(PicturesFileDetails::getContent).collect(Collectors.toList()), - body.getPictures().stream().map(PicturesFileDetails::getContentType).collect(Collectors.toList()), - body.getPictures().stream().map(PicturesFileDetails::getFilename).collect(Collectors.toList())) - .end() - .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); + return fileArrayAndBasicWithResponse( + new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) + .serializeJsonField("address", body.getAddress()) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .serializeFileFields("pictures", + body.getPictures().stream().map(PicturesFileDetails::getContent).collect(Collectors.toList()), + body.getPictures().stream().map(PicturesFileDetails::getContentType).collect(Collectors.toList()), + body.getPictures().stream().map(PicturesFileDetails::getFilename).collect(Collectors.toList())) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono); } /** @@ -451,108 +369,4 @@ public Mono anonymousModel(ProfileImageFileDetails profileImage) { .getRequestBody(); return anonymousModelWithResponse(anonymousModelRequest, requestOptions).flatMap(FluxUtil::toMono); } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono fileWithHttpPartSpecificContentType(FileWithHttpPartSpecificContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartSpecificContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return fileWithHttpPartSpecificContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono fileWithHttpPartRequiredContentType(FileWithHttpPartRequiredContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartRequiredContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return fileWithHttpPartRequiredContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono fileWithHttpPartOptionalContentType(FileWithHttpPartOptionalContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartOptionalContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return fileWithHttpPartOptionalContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono complexWithHttpPart(ComplexHttpPartsModelRequest body) { - // Generated convenience method for complexWithHttpPartWithResponse - RequestOptions requestOptions = new RequestOptions(); - return complexWithHttpPartWithResponse( - new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) - .serializeJsonField("address", body.getAddress()) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .serializeJsonField("previousAddresses", body.getPreviousAddresses()) - .serializeFileFields("pictures", - body.getPictures().stream().map(FileRequiredMetaData::getContent).collect(Collectors.toList()), - body.getPictures().stream().map(FileRequiredMetaData::getContentType).collect(Collectors.toList()), - body.getPictures().stream().map(FileRequiredMetaData::getFilename).collect(Collectors.toList())) - .end() - .getRequestBody(), - requestOptions).flatMap(FluxUtil::toMono); - } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataClient.java similarity index 62% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClient.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataClient.java index f1b3947e83..b29a458929 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataClient.java @@ -19,12 +19,7 @@ import com.payload.multipart.implementation.MultipartFormDataHelper; import com.payload.multipart.implementation.models.AnonymousModelRequest; import com.payload.multipart.models.BinaryArrayPartsRequest; -import com.payload.multipart.models.ComplexHttpPartsModelRequest; import com.payload.multipart.models.ComplexPartsRequest; -import com.payload.multipart.models.FileRequiredMetaData; -import com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest; -import com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest; -import com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest; import com.payload.multipart.models.JsonPartRequest; import com.payload.multipart.models.MultiBinaryPartsRequest; import com.payload.multipart.models.MultiPartRequest; @@ -36,17 +31,17 @@ * Initializes a new instance of the synchronous MultiPartClient type. */ @ServiceClient(builder = MultiPartClientBuilder.class) -public final class MultiPartClient { +public final class FormDataClient { @Generated private final FormDatasImpl serviceClient; /** - * Initializes an instance of MultiPartClient class. + * Initializes an instance of FormDataClient class. * * @param serviceClient the service client implementation. */ @Generated - MultiPartClient(FormDatasImpl serviceClient) { + FormDataClient(FormDatasImpl serviceClient) { this.serviceClient = serviceClient; } @@ -82,10 +77,10 @@ Response basicWithResponse(BinaryData body, RequestOptions requestOptions) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation 'complex' is - // 'multipart/form-data' - return this.serviceClient.complexWithResponse(body, requestOptions); + Response fileArrayAndBasicWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'fileArrayAndBasic' is 'multipart/form-data' + return this.serviceClient.fileArrayAndBasicWithResponse(body, requestOptions); } /** @@ -183,82 +178,6 @@ Response anonymousModelWithResponse(BinaryData anonymousModelRequest, Requ return this.serviceClient.anonymousModelWithResponse(anonymousModelRequest, requestOptions); } - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response fileWithHttpPartSpecificContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartSpecificContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartSpecificContentTypeWithResponse(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response fileWithHttpPartRequiredContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartRequiredContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartRequiredContentTypeWithResponse(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response fileWithHttpPartOptionalContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'fileWithHttpPartOptionalContentType' is 'multipart/form-data' - return this.serviceClient.fileWithHttpPartOptionalContentTypeWithResponse(body, requestOptions); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response complexWithHttpPartWithResponse(BinaryData body, RequestOptions requestOptions) { - // Protocol API requires serialization of parts with content-disposition and data, as operation - // 'complexWithHttpPart' is 'multipart/form-data' - return this.serviceClient.complexWithHttpPartWithResponse(body, requestOptions); - } - /** * Test content-type: multipart/form-data. * @@ -295,10 +214,10 @@ public void basic(MultiPartRequest body) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void complex(ComplexPartsRequest body) { - // Generated convenience method for complexWithResponse + public void fileArrayAndBasic(ComplexPartsRequest body) { + // Generated convenience method for fileArrayAndBasicWithResponse RequestOptions requestOptions = new RequestOptions(); - complexWithResponse(new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) + fileArrayAndBasicWithResponse(new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) .serializeJsonField("address", body.getAddress()) .serializeFileField("profileImage", body.getProfileImage().getContent(), body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) @@ -437,104 +356,4 @@ public void anonymousModel(ProfileImageFileDetails profileImage) { .getRequestBody(); anonymousModelWithResponse(anonymousModelRequest, requestOptions).getValue(); } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void fileWithHttpPartSpecificContentType(FileWithHttpPartSpecificContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartSpecificContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - fileWithHttpPartSpecificContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).getValue(); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void fileWithHttpPartRequiredContentType(FileWithHttpPartRequiredContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartRequiredContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - fileWithHttpPartRequiredContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).getValue(); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void fileWithHttpPartOptionalContentType(FileWithHttpPartOptionalContentTypeRequest body) { - // Generated convenience method for fileWithHttpPartOptionalContentTypeWithResponse - RequestOptions requestOptions = new RequestOptions(); - fileWithHttpPartOptionalContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .end() - .getRequestBody(), requestOptions).getValue(); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void complexWithHttpPart(ComplexHttpPartsModelRequest body) { - // Generated convenience method for complexWithHttpPartWithResponse - RequestOptions requestOptions = new RequestOptions(); - complexWithHttpPartWithResponse( - new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) - .serializeJsonField("address", body.getAddress()) - .serializeFileField("profileImage", body.getProfileImage().getContent(), - body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) - .serializeJsonField("previousAddresses", body.getPreviousAddresses()) - .serializeFileFields("pictures", - body.getPictures().stream().map(FileRequiredMetaData::getContent).collect(Collectors.toList()), - body.getPictures().stream().map(FileRequiredMetaData::getContentType).collect(Collectors.toList()), - body.getPictures().stream().map(FileRequiredMetaData::getFilename).collect(Collectors.toList())) - .end() - .getRequestBody(), - requestOptions).getValue(); - } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsAsyncClient.java new file mode 100644 index 0000000000..42946ba8f3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsAsyncClient.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.payload.multipart.implementation.FormDataHttpPartsImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.ComplexHttpPartsModelRequest; +import com.payload.multipart.models.FileRequiredMetaData; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class, isAsync = true) +public final class FormDataHttpPartsAsyncClient { + @Generated + private final FormDataHttpPartsImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsAsyncClient(FormDataHttpPartsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> jsonArrayAndFileArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'jsonArrayAndFileArray' is 'multipart/form-data' + return this.serviceClient.jsonArrayAndFileArrayWithResponseAsync(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono jsonArrayAndFileArray(ComplexHttpPartsModelRequest body) { + // Generated convenience method for jsonArrayAndFileArrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return jsonArrayAndFileArrayWithResponse( + new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) + .serializeJsonField("address", body.getAddress()) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .serializeJsonField("previousAddresses", body.getPreviousAddresses()) + .serializeFileFields("pictures", + body.getPictures().stream().map(FileRequiredMetaData::getContent).collect(Collectors.toList()), + body.getPictures().stream().map(FileRequiredMetaData::getContentType).collect(Collectors.toList()), + body.getPictures().stream().map(FileRequiredMetaData::getFilename).collect(Collectors.toList())) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsClient.java new file mode 100644 index 0000000000..93f15af917 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsClient.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.payload.multipart.implementation.FormDataHttpPartsImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.ComplexHttpPartsModelRequest; +import com.payload.multipart.models.FileRequiredMetaData; +import java.util.stream.Collectors; + +/** + * Initializes a new instance of the synchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class) +public final class FormDataHttpPartsClient { + @Generated + private final FormDataHttpPartsImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsClient(FormDataHttpPartsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response jsonArrayAndFileArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'jsonArrayAndFileArray' is 'multipart/form-data' + return this.serviceClient.jsonArrayAndFileArrayWithResponse(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void jsonArrayAndFileArray(ComplexHttpPartsModelRequest body) { + // Generated convenience method for jsonArrayAndFileArrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + jsonArrayAndFileArrayWithResponse( + new MultipartFormDataHelper(requestOptions).serializeTextField("id", body.getId()) + .serializeJsonField("address", body.getAddress()) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .serializeJsonField("previousAddresses", body.getPreviousAddresses()) + .serializeFileFields("pictures", + body.getPictures().stream().map(FileRequiredMetaData::getContent).collect(Collectors.toList()), + body.getPictures().stream().map(FileRequiredMetaData::getContentType).collect(Collectors.toList()), + body.getPictures().stream().map(FileRequiredMetaData::getFilename).collect(Collectors.toList())) + .end() + .getRequestBody(), + requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeAsyncClient.java new file mode 100644 index 0000000000..ba862a4b85 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeAsyncClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.payload.multipart.implementation.FormDataHttpPartsContentTypesImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest; +import com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest; +import com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class, isAsync = true) +public final class FormDataHttpPartsContentTypeAsyncClient { + @Generated + private final FormDataHttpPartsContentTypesImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsContentTypeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsContentTypeAsyncClient(FormDataHttpPartsContentTypesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> imageJpegContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'imageJpegContentType' is 'multipart/form-data' + return this.serviceClient.imageJpegContentTypeWithResponseAsync(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> requiredContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'requiredContentType' is 'multipart/form-data' + return this.serviceClient.requiredContentTypeWithResponseAsync(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> optionalContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'optionalContentType' is 'multipart/form-data' + return this.serviceClient.optionalContentTypeWithResponseAsync(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono imageJpegContentType(FileWithHttpPartSpecificContentTypeRequest body) { + // Generated convenience method for imageJpegContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return imageJpegContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono requiredContentType(FileWithHttpPartRequiredContentTypeRequest body) { + // Generated convenience method for requiredContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return requiredContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono optionalContentType(FileWithHttpPartOptionalContentTypeRequest body) { + // Generated convenience method for optionalContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return optionalContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeClient.java new file mode 100644 index 0000000000..6a80d823fe --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsContentTypeClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.payload.multipart.implementation.FormDataHttpPartsContentTypesImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest; +import com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest; +import com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest; + +/** + * Initializes a new instance of the synchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class) +public final class FormDataHttpPartsContentTypeClient { + @Generated + private final FormDataHttpPartsContentTypesImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsContentTypeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsContentTypeClient(FormDataHttpPartsContentTypesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response imageJpegContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'imageJpegContentType' is 'multipart/form-data' + return this.serviceClient.imageJpegContentTypeWithResponse(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response requiredContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'requiredContentType' is 'multipart/form-data' + return this.serviceClient.requiredContentTypeWithResponse(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response optionalContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation + // 'optionalContentType' is 'multipart/form-data' + return this.serviceClient.optionalContentTypeWithResponse(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void imageJpegContentType(FileWithHttpPartSpecificContentTypeRequest body) { + // Generated convenience method for imageJpegContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + imageJpegContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).getValue(); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void requiredContentType(FileWithHttpPartRequiredContentTypeRequest body) { + // Generated convenience method for requiredContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + requiredContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).getValue(); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void optionalContentType(FileWithHttpPartOptionalContentTypeRequest body) { + // Generated convenience method for optionalContentTypeWithResponse + RequestOptions requestOptions = new RequestOptions(); + optionalContentTypeWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", body.getProfileImage().getContent(), + body.getProfileImage().getContentType(), body.getProfileImage().getFilename()) + .end() + .getRequestBody(), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringAsyncClient.java new file mode 100644 index 0000000000..6eae2ca7f6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringAsyncClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.payload.multipart.implementation.FormDataHttpPartsNonStringsImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.FloatRequest; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class, isAsync = true) +public final class FormDataHttpPartsNonStringAsyncClient { + @Generated + private final FormDataHttpPartsNonStringsImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsNonStringAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsNonStringAsyncClient(FormDataHttpPartsNonStringsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> floatMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation 'float' is + // 'multipart/form-data' + return this.serviceClient.floatMethodWithResponseAsync(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono floatMethod(FloatRequest body) { + // Generated convenience method for floatMethodWithResponse + RequestOptions requestOptions = new RequestOptions(); + return floatMethodWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeTextField("temperature", String.valueOf(body.getTemperature())) + .end() + .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringClient.java new file mode 100644 index 0000000000..e1f0fba886 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/FormDataHttpPartsNonStringClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.payload.multipart.implementation.FormDataHttpPartsNonStringsImpl; +import com.payload.multipart.implementation.MultipartFormDataHelper; +import com.payload.multipart.models.FloatRequest; + +/** + * Initializes a new instance of the synchronous MultiPartClient type. + */ +@ServiceClient(builder = MultiPartClientBuilder.class) +public final class FormDataHttpPartsNonStringClient { + @Generated + private final FormDataHttpPartsNonStringsImpl serviceClient; + + /** + * Initializes an instance of FormDataHttpPartsNonStringClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FormDataHttpPartsNonStringClient(FormDataHttpPartsNonStringsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response floatMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation 'float' is + // 'multipart/form-data' + return this.serviceClient.floatMethodWithResponse(body, requestOptions); + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void floatMethod(FloatRequest body) { + // Generated convenience method for floatMethodWithResponse + RequestOptions requestOptions = new RequestOptions(); + floatMethodWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeTextField("temperature", String.valueOf(body.getTemperature())) + .end() + .getRequestBody(), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClientBuilder.java index b1734e648f..cac14e25a9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/MultiPartClientBuilder.java @@ -40,7 +40,16 @@ /** * A builder for creating a new instance of the MultiPartClient type. */ -@ServiceClientBuilder(serviceClients = { MultiPartClient.class, MultiPartAsyncClient.class }) +@ServiceClientBuilder( + serviceClients = { + FormDataClient.class, + FormDataHttpPartsClient.class, + FormDataHttpPartsContentTypeClient.class, + FormDataHttpPartsNonStringClient.class, + FormDataAsyncClient.class, + FormDataHttpPartsAsyncClient.class, + FormDataHttpPartsContentTypeAsyncClient.class, + FormDataHttpPartsNonStringAsyncClient.class }) public final class MultiPartClientBuilder implements HttpTrait, ConfigurationTrait, EndpointTrait { @Generated @@ -264,23 +273,83 @@ private HttpPipeline createHttpPipeline() { } /** - * Builds an instance of MultiPartAsyncClient class. + * Builds an instance of FormDataAsyncClient class. * - * @return an instance of MultiPartAsyncClient. + * @return an instance of FormDataAsyncClient. */ @Generated - public MultiPartAsyncClient buildAsyncClient() { - return new MultiPartAsyncClient(buildInnerClient().getFormDatas()); + public FormDataAsyncClient buildFormDataAsyncClient() { + return new FormDataAsyncClient(buildInnerClient().getFormDatas()); } /** - * Builds an instance of MultiPartClient class. + * Builds an instance of FormDataHttpPartsAsyncClient class. * - * @return an instance of MultiPartClient. + * @return an instance of FormDataHttpPartsAsyncClient. */ @Generated - public MultiPartClient buildClient() { - return new MultiPartClient(buildInnerClient().getFormDatas()); + public FormDataHttpPartsAsyncClient buildFormDataHttpPartsAsyncClient() { + return new FormDataHttpPartsAsyncClient(buildInnerClient().getFormDataHttpParts()); + } + + /** + * Builds an instance of FormDataHttpPartsContentTypeAsyncClient class. + * + * @return an instance of FormDataHttpPartsContentTypeAsyncClient. + */ + @Generated + public FormDataHttpPartsContentTypeAsyncClient buildFormDataHttpPartsContentTypeAsyncClient() { + return new FormDataHttpPartsContentTypeAsyncClient(buildInnerClient().getFormDataHttpPartsContentTypes()); + } + + /** + * Builds an instance of FormDataHttpPartsNonStringAsyncClient class. + * + * @return an instance of FormDataHttpPartsNonStringAsyncClient. + */ + @Generated + public FormDataHttpPartsNonStringAsyncClient buildFormDataHttpPartsNonStringAsyncClient() { + return new FormDataHttpPartsNonStringAsyncClient(buildInnerClient().getFormDataHttpPartsNonStrings()); + } + + /** + * Builds an instance of FormDataClient class. + * + * @return an instance of FormDataClient. + */ + @Generated + public FormDataClient buildFormDataClient() { + return new FormDataClient(buildInnerClient().getFormDatas()); + } + + /** + * Builds an instance of FormDataHttpPartsClient class. + * + * @return an instance of FormDataHttpPartsClient. + */ + @Generated + public FormDataHttpPartsClient buildFormDataHttpPartsClient() { + return new FormDataHttpPartsClient(buildInnerClient().getFormDataHttpParts()); + } + + /** + * Builds an instance of FormDataHttpPartsContentTypeClient class. + * + * @return an instance of FormDataHttpPartsContentTypeClient. + */ + @Generated + public FormDataHttpPartsContentTypeClient buildFormDataHttpPartsContentTypeClient() { + return new FormDataHttpPartsContentTypeClient(buildInnerClient().getFormDataHttpPartsContentTypes()); + } + + /** + * Builds an instance of FormDataHttpPartsNonStringClient class. + * + * @return an instance of FormDataHttpPartsNonStringClient. + */ + @Generated + public FormDataHttpPartsNonStringClient buildFormDataHttpPartsNonStringClient() { + return new FormDataHttpPartsNonStringClient(buildInnerClient().getFormDataHttpPartsNonStrings()); } private static final ClientLogger LOGGER = new ClientLogger(MultiPartClientBuilder.class); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsContentTypesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsContentTypesImpl.java new file mode 100644 index 0000000000..824315fd4a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsContentTypesImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FormDataHttpPartsContentTypes. + */ +public final class FormDataHttpPartsContentTypesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FormDataHttpPartsContentTypesService service; + + /** + * The service client containing this operation class. + */ + private final MultiPartClientImpl client; + + /** + * Initializes an instance of FormDataHttpPartsContentTypesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FormDataHttpPartsContentTypesImpl(MultiPartClientImpl client) { + this.service = RestProxy.create(FormDataHttpPartsContentTypesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MultiPartClientFormDataHttpPartsContentTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MultiPartClientFormD") + public interface FormDataHttpPartsContentTypesService { + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/check-filename-and-specific-content-type-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> imageJpegContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/check-filename-and-specific-content-type-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response imageJpegContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/check-filename-and-required-content-type-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> requiredContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/check-filename-and-required-content-type-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response requiredContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/file-with-http-part-optional-content-type") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> optionalContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/file-with-http-part-optional-content-type") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response optionalContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> imageJpegContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return FluxUtil.withContext(context -> service.imageJpegContentType(this.client.getEndpoint(), contentType, + body, requestOptions, context)); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response imageJpegContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return service.imageJpegContentTypeSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> requiredContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return FluxUtil.withContext(context -> service.requiredContentType(this.client.getEndpoint(), contentType, body, + requestOptions, context)); + } + + /** + * Test content-type: multipart/form-data. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response requiredContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return service.requiredContentTypeSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> optionalContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return FluxUtil.withContext(context -> service.optionalContentType(this.client.getEndpoint(), contentType, body, + requestOptions, context)); + } + + /** + * Test content-type: multipart/form-data for optional content type. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response optionalContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return service.optionalContentTypeSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsImpl.java new file mode 100644 index 0000000000..58f0b5753a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FormDataHttpParts. + */ +public final class FormDataHttpPartsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FormDataHttpPartsService service; + + /** + * The service client containing this operation class. + */ + private final MultiPartClientImpl client; + + /** + * Initializes an instance of FormDataHttpPartsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FormDataHttpPartsImpl(MultiPartClientImpl client) { + this.service + = RestProxy.create(FormDataHttpPartsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MultiPartClientFormDataHttpParts to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MultiPartClientFormD") + public interface FormDataHttpPartsService { + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/complex-parts-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> jsonArrayAndFileArray(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/complex-parts-with-httppart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response jsonArrayAndFileArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> jsonArrayAndFileArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return FluxUtil.withContext(context -> service.jsonArrayAndFileArray(this.client.getEndpoint(), contentType, + body, requestOptions, context)); + } + + /** + * Test content-type: multipart/form-data for mixed scenarios. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response jsonArrayAndFileArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return service.jsonArrayAndFileArraySync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsNonStringsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsNonStringsImpl.java new file mode 100644 index 0000000000..6b44463862 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDataHttpPartsNonStringsImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FormDataHttpPartsNonStrings. + */ +public final class FormDataHttpPartsNonStringsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FormDataHttpPartsNonStringsService service; + + /** + * The service client containing this operation class. + */ + private final MultiPartClientImpl client; + + /** + * Initializes an instance of FormDataHttpPartsNonStringsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FormDataHttpPartsNonStringsImpl(MultiPartClientImpl client) { + this.service = RestProxy.create(FormDataHttpPartsNonStringsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MultiPartClientFormDataHttpPartsNonStrings to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MultiPartClientFormD") + public interface FormDataHttpPartsNonStringsService { + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/non-string-float") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> floatMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/multipart/form-data/non-string-float") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response floatMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> floatMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return FluxUtil.withContext( + context -> service.floatMethod(this.client.getEndpoint(), contentType, body, requestOptions, context)); + } + + /** + * Test content-type: multipart/form-data for non string. + * + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response floatMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + return service.floatMethodSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java index 9136290d42..9811664b1b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java @@ -87,7 +87,7 @@ Response basicSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complex(@HostParam("endpoint") String endpoint, + Mono> fileArrayAndBasic(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); @@ -98,7 +98,7 @@ Mono> complex(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexSync(@HostParam("endpoint") String endpoint, + Response fileArrayAndBasicSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); @@ -213,94 +213,6 @@ Response anonymousModelSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/check-filename-and-specific-content-type-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartSpecificContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/check-filename-and-specific-content-type-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartSpecificContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/check-filename-and-required-content-type-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartRequiredContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/check-filename-and-required-content-type-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartRequiredContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/file-with-http-part-optional-content-type") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartOptionalContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/file-with-http-part-optional-content-type") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartOptionalContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/complex-parts-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complexWithHttpPart(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/multipart/form-data/complex-parts-with-httppart") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexWithHttpPartSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); } /** @@ -350,10 +262,10 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + public Mono> fileArrayAndBasicWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext( - context -> service.complex(this.client.getEndpoint(), contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.fileArrayAndBasic(this.client.getEndpoint(), contentType, body, + requestOptions, context)); } /** @@ -368,9 +280,10 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { + public Response fileArrayAndBasicWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.complexSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); + return service.fileArrayAndBasicSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } /** @@ -551,154 +464,4 @@ public Response anonymousModelWithResponse(BinaryData anonymousModelReques return service.anonymousModelSync(this.client.getEndpoint(), contentType, anonymousModelRequest, requestOptions, Context.NONE); } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fileWithHttpPartSpecificContentTypeWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.fileWithHttpPartSpecificContentType(this.client.getEndpoint(), - contentType, body, requestOptions, context)); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fileWithHttpPartSpecificContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return service.fileWithHttpPartSpecificContentTypeSync(this.client.getEndpoint(), contentType, body, - requestOptions, Context.NONE); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fileWithHttpPartRequiredContentTypeWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.fileWithHttpPartRequiredContentType(this.client.getEndpoint(), - contentType, body, requestOptions, context)); - } - - /** - * Test content-type: multipart/form-data. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fileWithHttpPartRequiredContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return service.fileWithHttpPartRequiredContentTypeSync(this.client.getEndpoint(), contentType, body, - requestOptions, Context.NONE); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fileWithHttpPartOptionalContentTypeWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.fileWithHttpPartOptionalContentType(this.client.getEndpoint(), - contentType, body, requestOptions, context)); - } - - /** - * Test content-type: multipart/form-data for optional content type. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fileWithHttpPartOptionalContentTypeWithResponse(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return service.fileWithHttpPartOptionalContentTypeSync(this.client.getEndpoint(), contentType, body, - requestOptions, Context.NONE); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> complexWithHttpPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.complexWithHttpPart(this.client.getEndpoint(), contentType, body, - requestOptions, context)); - } - - /** - * Test content-type: multipart/form-data for mixed scenarios. - * - * @param body The body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response complexWithHttpPartWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - return service.complexWithHttpPartSync(this.client.getEndpoint(), contentType, body, requestOptions, - Context.NONE); - } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java index b09a3bf8dc..cdea860089 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java @@ -71,6 +71,48 @@ public FormDatasImpl getFormDatas() { return this.formDatas; } + /** + * The FormDataHttpPartsImpl object to access its operations. + */ + private final FormDataHttpPartsImpl formDataHttpParts; + + /** + * Gets the FormDataHttpPartsImpl object to access its operations. + * + * @return the FormDataHttpPartsImpl object. + */ + public FormDataHttpPartsImpl getFormDataHttpParts() { + return this.formDataHttpParts; + } + + /** + * The FormDataHttpPartsContentTypesImpl object to access its operations. + */ + private final FormDataHttpPartsContentTypesImpl formDataHttpPartsContentTypes; + + /** + * Gets the FormDataHttpPartsContentTypesImpl object to access its operations. + * + * @return the FormDataHttpPartsContentTypesImpl object. + */ + public FormDataHttpPartsContentTypesImpl getFormDataHttpPartsContentTypes() { + return this.formDataHttpPartsContentTypes; + } + + /** + * The FormDataHttpPartsNonStringsImpl object to access its operations. + */ + private final FormDataHttpPartsNonStringsImpl formDataHttpPartsNonStrings; + + /** + * Gets the FormDataHttpPartsNonStringsImpl object to access its operations. + * + * @return the FormDataHttpPartsNonStringsImpl object. + */ + public FormDataHttpPartsNonStringsImpl getFormDataHttpPartsNonStrings() { + return this.formDataHttpPartsNonStrings; + } + /** * Initializes an instance of MultiPartClient client. * @@ -103,5 +145,8 @@ public MultiPartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializ this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.formDatas = new FormDatasImpl(this); + this.formDataHttpParts = new FormDataHttpPartsImpl(this); + this.formDataHttpPartsContentTypes = new FormDataHttpPartsContentTypesImpl(this); + this.formDataHttpPartsNonStrings = new FormDataHttpPartsNonStringsImpl(this); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/models/FloatRequest.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/models/FloatRequest.java new file mode 100644 index 0000000000..704bfb2ab2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/payload/multipart/models/FloatRequest.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.payload.multipart.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** + * The FloatRequest model. + */ +@Immutable +public final class FloatRequest { + /* + * The temperature property. + */ + @Generated + private final double temperature; + + /** + * Creates an instance of FloatRequest class. + * + * @param temperature the temperature value to set. + */ + @Generated + public FloatRequest(double temperature) { + this.temperature = temperature; + } + + /** + * Get the temperature property: The temperature property. + * + * @return the temperature value. + */ + @Generated + public double getTemperature() { + return this.temperature; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceAsyncClient.java new file mode 100644 index 0000000000..a0352af570 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceAsyncClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.InInterfacesImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class InInterfaceAsyncClient { + @Generated + private final InInterfacesImpl serviceClient; + + /** + * Initializes an instance of InInterfaceAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + InInterfaceAsyncClient(InInterfacesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fixedWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fixedWithResponseAsync(requestOptions); + } + + /** + * The fixed operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono fixed() { + // Generated convenience method for fixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + return fixedWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceClient.java new file mode 100644 index 0000000000..16dd187712 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/InInterfaceClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.InInterfacesImpl; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class InInterfaceClient { + @Generated + private final InInterfacesImpl serviceClient; + + /** + * Initializes an instance of InInterfaceClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + InInterfaceClient(InInterfacesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fixedWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fixedWithResponse(requestOptions); + } + + /** + * The fixed operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void fixed() { + // Generated convenience method for fixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + fixedWithResponse(requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersAsyncClient.java new file mode 100644 index 0000000000..5f50c51c29 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersAsyncClient.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersAsyncClient { + @Generated + private final PathParametersImpl serviceClient; + + /** + * Initializes an instance of PathParametersAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersAsyncClient(PathParametersImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateOnlyWithResponseAsync(param, requestOptions); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> explicitWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.explicitWithResponseAsync(param, requestOptions); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationOnlyWithResponseAsync(param, requestOptions); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono templateOnly(String param) { + // Generated convenience method for templateOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return templateOnlyWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono explicit(String param) { + // Generated convenience method for explicitWithResponse + RequestOptions requestOptions = new RequestOptions(); + return explicitWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono annotationOnly(String param) { + // Generated convenience method for annotationOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return annotationOnlyWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersClient.java new file mode 100644 index 0000000000..3607bda9d4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersImpl; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersClient { + @Generated + private final PathParametersImpl serviceClient; + + /** + * Initializes an instance of PathParametersClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersClient(PathParametersImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateOnlyWithResponse(param, requestOptions); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response explicitWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.explicitWithResponse(param, requestOptions); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationOnlyWithResponse(param, requestOptions); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void templateOnly(String param) { + // Generated convenience method for templateOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + templateOnlyWithResponse(param, requestOptions).getValue(); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void explicit(String param) { + // Generated convenience method for explicitWithResponse + RequestOptions requestOptions = new RequestOptions(); + explicitWithResponse(param, requestOptions).getValue(); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void annotationOnly(String param) { + // Generated convenience method for annotationOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + annotationOnlyWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeAsyncClient.java new file mode 100644 index 0000000000..f5df51720c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersLabelExpansionExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersLabelExpansionExplodeAsyncClient { + @Generated + private final PathParametersLabelExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersLabelExpansionExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersLabelExpansionExplodeAsyncClient(PathParametersLabelExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeClient.java new file mode 100644 index 0000000000..be84b180f9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersLabelExpansionExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersLabelExpansionExplodeClient { + @Generated + private final PathParametersLabelExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersLabelExpansionExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersLabelExpansionExplodeClient(PathParametersLabelExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardAsyncClient.java new file mode 100644 index 0000000000..a1ef7a6b25 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersLabelExpansionStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersLabelExpansionStandardAsyncClient { + @Generated + private final PathParametersLabelExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersLabelExpansionStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersLabelExpansionStandardAsyncClient(PathParametersLabelExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardClient.java new file mode 100644 index 0000000000..a48559aa26 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersLabelExpansionStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersLabelExpansionStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersLabelExpansionStandardClient { + @Generated + private final PathParametersLabelExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersLabelExpansionStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersLabelExpansionStandardClient(PathParametersLabelExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeAsyncClient.java new file mode 100644 index 0000000000..3a2e8e1db8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersMatrixExpansionExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersMatrixExpansionExplodeAsyncClient { + @Generated + private final PathParametersMatrixExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersMatrixExpansionExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersMatrixExpansionExplodeAsyncClient(PathParametersMatrixExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeClient.java new file mode 100644 index 0000000000..6368dd65ec --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersMatrixExpansionExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersMatrixExpansionExplodeClient { + @Generated + private final PathParametersMatrixExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersMatrixExpansionExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersMatrixExpansionExplodeClient(PathParametersMatrixExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardAsyncClient.java new file mode 100644 index 0000000000..fb1d12d264 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersMatrixExpansionStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersMatrixExpansionStandardAsyncClient { + @Generated + private final PathParametersMatrixExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersMatrixExpansionStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersMatrixExpansionStandardAsyncClient(PathParametersMatrixExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardClient.java new file mode 100644 index 0000000000..77ad1b4180 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersMatrixExpansionStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersMatrixExpansionStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersMatrixExpansionStandardClient { + @Generated + private final PathParametersMatrixExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersMatrixExpansionStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersMatrixExpansionStandardClient(PathParametersMatrixExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeAsyncClient.java new file mode 100644 index 0000000000..41f1725518 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersPathExpansionExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersPathExpansionExplodeAsyncClient { + @Generated + private final PathParametersPathExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersPathExpansionExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersPathExpansionExplodeAsyncClient(PathParametersPathExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeClient.java new file mode 100644 index 0000000000..0d8ac04135 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersPathExpansionExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersPathExpansionExplodeClient { + @Generated + private final PathParametersPathExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersPathExpansionExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersPathExpansionExplodeClient(PathParametersPathExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardAsyncClient.java new file mode 100644 index 0000000000..4f2117ea94 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersPathExpansionStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersPathExpansionStandardAsyncClient { + @Generated + private final PathParametersPathExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersPathExpansionStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersPathExpansionStandardAsyncClient(PathParametersPathExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardClient.java new file mode 100644 index 0000000000..a739360d0d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersPathExpansionStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersPathExpansionStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersPathExpansionStandardClient { + @Generated + private final PathParametersPathExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersPathExpansionStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersPathExpansionStandardClient(PathParametersPathExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionAsyncClient.java new file mode 100644 index 0000000000..a28155d674 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionAsyncClient.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersReservedExpansionsImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersReservedExpansionAsyncClient { + @Generated + private final PathParametersReservedExpansionsImpl serviceClient; + + /** + * Initializes an instance of PathParametersReservedExpansionAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersReservedExpansionAsyncClient(PathParametersReservedExpansionsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The template operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateWithResponseAsync(param, requestOptions); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationWithResponseAsync(param, requestOptions); + } + + /** + * The template operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono template(String param) { + // Generated convenience method for templateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return templateWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono annotation(String param) { + // Generated convenience method for annotationWithResponse + RequestOptions requestOptions = new RequestOptions(); + return annotationWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionClient.java new file mode 100644 index 0000000000..ff69f0d690 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersReservedExpansionClient.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersReservedExpansionsImpl; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersReservedExpansionClient { + @Generated + private final PathParametersReservedExpansionsImpl serviceClient; + + /** + * Initializes an instance of PathParametersReservedExpansionClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersReservedExpansionClient(PathParametersReservedExpansionsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The template operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateWithResponse(param, requestOptions); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationWithResponse(param, requestOptions); + } + + /** + * The template operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void template(String param) { + // Generated convenience method for templateWithResponse + RequestOptions requestOptions = new RequestOptions(); + templateWithResponse(param, requestOptions).getValue(); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void annotation(String param) { + // Generated convenience method for annotationWithResponse + RequestOptions requestOptions = new RequestOptions(); + annotationWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeAsyncClient.java new file mode 100644 index 0000000000..e7ea4158a9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersSimpleExpansionExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersSimpleExpansionExplodeAsyncClient { + @Generated + private final PathParametersSimpleExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersSimpleExpansionExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersSimpleExpansionExplodeAsyncClient(PathParametersSimpleExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeClient.java new file mode 100644 index 0000000000..50c8dcd7fd --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersSimpleExpansionExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersSimpleExpansionExplodeClient { + @Generated + private final PathParametersSimpleExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of PathParametersSimpleExpansionExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersSimpleExpansionExplodeClient(PathParametersSimpleExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardAsyncClient.java new file mode 100644 index 0000000000..ffc55b8c4b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.PathParametersSimpleExpansionStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class PathParametersSimpleExpansionStandardAsyncClient { + @Generated + private final PathParametersSimpleExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersSimpleExpansionStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersSimpleExpansionStandardAsyncClient(PathParametersSimpleExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardClient.java new file mode 100644 index 0000000000..da99a14895 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/PathParametersSimpleExpansionStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.PathParametersSimpleExpansionStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class PathParametersSimpleExpansionStandardClient { + @Generated + private final PathParametersSimpleExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of PathParametersSimpleExpansionStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PathParametersSimpleExpansionStandardClient(PathParametersSimpleExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersAsyncClient.java new file mode 100644 index 0000000000..9fc76cebb6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersAsyncClient.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.QueryParametersImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class QueryParametersAsyncClient { + @Generated + private final QueryParametersImpl serviceClient; + + /** + * Initializes an instance of QueryParametersAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersAsyncClient(QueryParametersImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateOnlyWithResponseAsync(param, requestOptions); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> explicitWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.explicitWithResponseAsync(param, requestOptions); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationOnlyWithResponseAsync(param, requestOptions); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono templateOnly(String param) { + // Generated convenience method for templateOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return templateOnlyWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono explicit(String param) { + // Generated convenience method for explicitWithResponse + RequestOptions requestOptions = new RequestOptions(); + return explicitWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono annotationOnly(String param) { + // Generated convenience method for annotationOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return annotationOnlyWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersClient.java new file mode 100644 index 0000000000..a837225add --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.QueryParametersImpl; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class QueryParametersClient { + @Generated + private final QueryParametersImpl serviceClient; + + /** + * Initializes an instance of QueryParametersClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersClient(QueryParametersImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.templateOnlyWithResponse(param, requestOptions); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response explicitWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.explicitWithResponse(param, requestOptions); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.annotationOnlyWithResponse(param, requestOptions); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void templateOnly(String param) { + // Generated convenience method for templateOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + templateOnlyWithResponse(param, requestOptions).getValue(); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void explicit(String param) { + // Generated convenience method for explicitWithResponse + RequestOptions requestOptions = new RequestOptions(); + explicitWithResponse(param, requestOptions).getValue(); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void annotationOnly(String param) { + // Generated convenience method for annotationOnlyWithResponse + RequestOptions requestOptions = new RequestOptions(); + annotationOnlyWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeAsyncClient.java new file mode 100644 index 0000000000..e067d059ba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.QueryParametersQueryContinuationExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class QueryParametersQueryContinuationExplodeAsyncClient { + @Generated + private final QueryParametersQueryContinuationExplodesImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryContinuationExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryContinuationExplodeAsyncClient(QueryParametersQueryContinuationExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeClient.java new file mode 100644 index 0000000000..5c50a6c055 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.QueryParametersQueryContinuationExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class QueryParametersQueryContinuationExplodeClient { + @Generated + private final QueryParametersQueryContinuationExplodesImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryContinuationExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryContinuationExplodeClient(QueryParametersQueryContinuationExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardAsyncClient.java new file mode 100644 index 0000000000..547551f40a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.QueryParametersQueryContinuationStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class QueryParametersQueryContinuationStandardAsyncClient { + @Generated + private final QueryParametersQueryContinuationStandardsImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryContinuationStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryContinuationStandardAsyncClient(QueryParametersQueryContinuationStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardClient.java new file mode 100644 index 0000000000..83551ff0a7 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryContinuationStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.QueryParametersQueryContinuationStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class QueryParametersQueryContinuationStandardClient { + @Generated + private final QueryParametersQueryContinuationStandardsImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryContinuationStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryContinuationStandardClient(QueryParametersQueryContinuationStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeAsyncClient.java new file mode 100644 index 0000000000..da3beea870 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.QueryParametersQueryExpansionExplodesImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class QueryParametersQueryExpansionExplodeAsyncClient { + @Generated + private final QueryParametersQueryExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryExpansionExplodeAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryExpansionExplodeAsyncClient(QueryParametersQueryExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeClient.java new file mode 100644 index 0000000000..4030b5aab3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionExplodeClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.QueryParametersQueryExpansionExplodesImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class QueryParametersQueryExpansionExplodeClient { + @Generated + private final QueryParametersQueryExpansionExplodesImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryExpansionExplodeClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryExpansionExplodeClient(QueryParametersQueryExpansionExplodesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardAsyncClient.java new file mode 100644 index 0000000000..3e5a89be45 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardAsyncClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.QueryParametersQueryExpansionStandardsImpl; +import java.util.List; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class QueryParametersQueryExpansionStandardAsyncClient { + @Generated + private final QueryParametersQueryExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryExpansionStandardAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryExpansionStandardAsyncClient(QueryParametersQueryExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponseAsync(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponseAsync(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponseAsync(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return primitiveWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + return arrayWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardClient.java new file mode 100644 index 0000000000..c438cead4e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/QueryParametersQueryExpansionStandardClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.QueryParametersQueryExpansionStandardsImpl; +import java.util.List; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class QueryParametersQueryExpansionStandardClient { + @Generated + private final QueryParametersQueryExpansionStandardsImpl serviceClient; + + /** + * Initializes an instance of QueryParametersQueryExpansionStandardClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryParametersQueryExpansionStandardClient(QueryParametersQueryExpansionStandardsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return this.serviceClient.primitiveWithResponse(param, requestOptions); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + return this.serviceClient.arrayWithResponse(param, requestOptions); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return this.serviceClient.recordWithResponse(param, requestOptions); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void primitive(String param) { + // Generated convenience method for primitiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + primitiveWithResponse(param, requestOptions).getValue(); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void array(List param) { + // Generated convenience method for arrayWithResponse + RequestOptions requestOptions = new RequestOptions(); + arrayWithResponse(param, requestOptions).getValue(); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void record(Map param) { + // Generated convenience method for recordWithResponse + RequestOptions requestOptions = new RequestOptions(); + recordWithResponse(param, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesAsyncClient.java new file mode 100644 index 0000000000..18dea9e3ca --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesAsyncClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.routes.implementation.RoutesClientImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class, isAsync = true) +public final class RoutesAsyncClient { + @Generated + private final RoutesClientImpl serviceClient; + + /** + * Initializes an instance of RoutesAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + RoutesAsyncClient(RoutesClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fixedWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fixedWithResponseAsync(requestOptions); + } + + /** + * The fixed operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono fixed() { + // Generated convenience method for fixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + return fixedWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClient.java new file mode 100644 index 0000000000..c851e080db --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.routes.implementation.RoutesClientImpl; + +/** + * Initializes a new instance of the synchronous RoutesClient type. + */ +@ServiceClient(builder = RoutesClientBuilder.class) +public final class RoutesClient { + @Generated + private final RoutesClientImpl serviceClient; + + /** + * Initializes an instance of RoutesClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + RoutesClient(RoutesClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fixedWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fixedWithResponse(requestOptions); + } + + /** + * The fixed operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void fixed() { + // Generated convenience method for fixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + fixedWithResponse(requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClientBuilder.java new file mode 100644 index 0000000000..154a5d9c87 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/RoutesClientBuilder.java @@ -0,0 +1,668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import com.routes.implementation.RoutesClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the RoutesClient type. + */ +@ServiceClientBuilder( + serviceClients = { + RoutesClient.class, + PathParametersClient.class, + PathParametersReservedExpansionClient.class, + PathParametersSimpleExpansionStandardClient.class, + PathParametersSimpleExpansionExplodeClient.class, + PathParametersPathExpansionStandardClient.class, + PathParametersPathExpansionExplodeClient.class, + PathParametersLabelExpansionStandardClient.class, + PathParametersLabelExpansionExplodeClient.class, + PathParametersMatrixExpansionStandardClient.class, + PathParametersMatrixExpansionExplodeClient.class, + QueryParametersClient.class, + QueryParametersQueryExpansionStandardClient.class, + QueryParametersQueryExpansionExplodeClient.class, + QueryParametersQueryContinuationStandardClient.class, + QueryParametersQueryContinuationExplodeClient.class, + InInterfaceClient.class, + RoutesAsyncClient.class, + PathParametersAsyncClient.class, + PathParametersReservedExpansionAsyncClient.class, + PathParametersSimpleExpansionStandardAsyncClient.class, + PathParametersSimpleExpansionExplodeAsyncClient.class, + PathParametersPathExpansionStandardAsyncClient.class, + PathParametersPathExpansionExplodeAsyncClient.class, + PathParametersLabelExpansionStandardAsyncClient.class, + PathParametersLabelExpansionExplodeAsyncClient.class, + PathParametersMatrixExpansionStandardAsyncClient.class, + PathParametersMatrixExpansionExplodeAsyncClient.class, + QueryParametersAsyncClient.class, + QueryParametersQueryExpansionStandardAsyncClient.class, + QueryParametersQueryExpansionExplodeAsyncClient.class, + QueryParametersQueryContinuationStandardAsyncClient.class, + QueryParametersQueryContinuationExplodeAsyncClient.class, + InInterfaceAsyncClient.class }) +public final class RoutesClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("routes.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the RoutesClientBuilder. + */ + @Generated + public RoutesClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RoutesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the RoutesClientBuilder. + */ + @Generated + public RoutesClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of RoutesClientImpl with the provided parameters. + * + * @return an instance of RoutesClientImpl. + */ + @Generated + private RoutesClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + RoutesClientImpl client + = new RoutesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of RoutesAsyncClient class. + * + * @return an instance of RoutesAsyncClient. + */ + @Generated + public RoutesAsyncClient buildAsyncClient() { + return new RoutesAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of PathParametersAsyncClient class. + * + * @return an instance of PathParametersAsyncClient. + */ + @Generated + public PathParametersAsyncClient buildPathParametersAsyncClient() { + return new PathParametersAsyncClient(buildInnerClient().getPathParameters()); + } + + /** + * Builds an instance of PathParametersReservedExpansionAsyncClient class. + * + * @return an instance of PathParametersReservedExpansionAsyncClient. + */ + @Generated + public PathParametersReservedExpansionAsyncClient buildPathParametersReservedExpansionAsyncClient() { + return new PathParametersReservedExpansionAsyncClient(buildInnerClient().getPathParametersReservedExpansions()); + } + + /** + * Builds an instance of PathParametersSimpleExpansionStandardAsyncClient class. + * + * @return an instance of PathParametersSimpleExpansionStandardAsyncClient. + */ + @Generated + public PathParametersSimpleExpansionStandardAsyncClient buildPathParametersSimpleExpansionStandardAsyncClient() { + return new PathParametersSimpleExpansionStandardAsyncClient( + buildInnerClient().getPathParametersSimpleExpansionStandards()); + } + + /** + * Builds an instance of PathParametersSimpleExpansionExplodeAsyncClient class. + * + * @return an instance of PathParametersSimpleExpansionExplodeAsyncClient. + */ + @Generated + public PathParametersSimpleExpansionExplodeAsyncClient buildPathParametersSimpleExpansionExplodeAsyncClient() { + return new PathParametersSimpleExpansionExplodeAsyncClient( + buildInnerClient().getPathParametersSimpleExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersPathExpansionStandardAsyncClient class. + * + * @return an instance of PathParametersPathExpansionStandardAsyncClient. + */ + @Generated + public PathParametersPathExpansionStandardAsyncClient buildPathParametersPathExpansionStandardAsyncClient() { + return new PathParametersPathExpansionStandardAsyncClient( + buildInnerClient().getPathParametersPathExpansionStandards()); + } + + /** + * Builds an instance of PathParametersPathExpansionExplodeAsyncClient class. + * + * @return an instance of PathParametersPathExpansionExplodeAsyncClient. + */ + @Generated + public PathParametersPathExpansionExplodeAsyncClient buildPathParametersPathExpansionExplodeAsyncClient() { + return new PathParametersPathExpansionExplodeAsyncClient( + buildInnerClient().getPathParametersPathExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersLabelExpansionStandardAsyncClient class. + * + * @return an instance of PathParametersLabelExpansionStandardAsyncClient. + */ + @Generated + public PathParametersLabelExpansionStandardAsyncClient buildPathParametersLabelExpansionStandardAsyncClient() { + return new PathParametersLabelExpansionStandardAsyncClient( + buildInnerClient().getPathParametersLabelExpansionStandards()); + } + + /** + * Builds an instance of PathParametersLabelExpansionExplodeAsyncClient class. + * + * @return an instance of PathParametersLabelExpansionExplodeAsyncClient. + */ + @Generated + public PathParametersLabelExpansionExplodeAsyncClient buildPathParametersLabelExpansionExplodeAsyncClient() { + return new PathParametersLabelExpansionExplodeAsyncClient( + buildInnerClient().getPathParametersLabelExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersMatrixExpansionStandardAsyncClient class. + * + * @return an instance of PathParametersMatrixExpansionStandardAsyncClient. + */ + @Generated + public PathParametersMatrixExpansionStandardAsyncClient buildPathParametersMatrixExpansionStandardAsyncClient() { + return new PathParametersMatrixExpansionStandardAsyncClient( + buildInnerClient().getPathParametersMatrixExpansionStandards()); + } + + /** + * Builds an instance of PathParametersMatrixExpansionExplodeAsyncClient class. + * + * @return an instance of PathParametersMatrixExpansionExplodeAsyncClient. + */ + @Generated + public PathParametersMatrixExpansionExplodeAsyncClient buildPathParametersMatrixExpansionExplodeAsyncClient() { + return new PathParametersMatrixExpansionExplodeAsyncClient( + buildInnerClient().getPathParametersMatrixExpansionExplodes()); + } + + /** + * Builds an instance of QueryParametersAsyncClient class. + * + * @return an instance of QueryParametersAsyncClient. + */ + @Generated + public QueryParametersAsyncClient buildQueryParametersAsyncClient() { + return new QueryParametersAsyncClient(buildInnerClient().getQueryParameters()); + } + + /** + * Builds an instance of QueryParametersQueryExpansionStandardAsyncClient class. + * + * @return an instance of QueryParametersQueryExpansionStandardAsyncClient. + */ + @Generated + public QueryParametersQueryExpansionStandardAsyncClient buildQueryParametersQueryExpansionStandardAsyncClient() { + return new QueryParametersQueryExpansionStandardAsyncClient( + buildInnerClient().getQueryParametersQueryExpansionStandards()); + } + + /** + * Builds an instance of QueryParametersQueryExpansionExplodeAsyncClient class. + * + * @return an instance of QueryParametersQueryExpansionExplodeAsyncClient. + */ + @Generated + public QueryParametersQueryExpansionExplodeAsyncClient buildQueryParametersQueryExpansionExplodeAsyncClient() { + return new QueryParametersQueryExpansionExplodeAsyncClient( + buildInnerClient().getQueryParametersQueryExpansionExplodes()); + } + + /** + * Builds an instance of QueryParametersQueryContinuationStandardAsyncClient class. + * + * @return an instance of QueryParametersQueryContinuationStandardAsyncClient. + */ + @Generated + public QueryParametersQueryContinuationStandardAsyncClient + buildQueryParametersQueryContinuationStandardAsyncClient() { + return new QueryParametersQueryContinuationStandardAsyncClient( + buildInnerClient().getQueryParametersQueryContinuationStandards()); + } + + /** + * Builds an instance of QueryParametersQueryContinuationExplodeAsyncClient class. + * + * @return an instance of QueryParametersQueryContinuationExplodeAsyncClient. + */ + @Generated + public QueryParametersQueryContinuationExplodeAsyncClient + buildQueryParametersQueryContinuationExplodeAsyncClient() { + return new QueryParametersQueryContinuationExplodeAsyncClient( + buildInnerClient().getQueryParametersQueryContinuationExplodes()); + } + + /** + * Builds an instance of InInterfaceAsyncClient class. + * + * @return an instance of InInterfaceAsyncClient. + */ + @Generated + public InInterfaceAsyncClient buildInInterfaceAsyncClient() { + return new InInterfaceAsyncClient(buildInnerClient().getInInterfaces()); + } + + /** + * Builds an instance of RoutesClient class. + * + * @return an instance of RoutesClient. + */ + @Generated + public RoutesClient buildClient() { + return new RoutesClient(buildInnerClient()); + } + + /** + * Builds an instance of PathParametersClient class. + * + * @return an instance of PathParametersClient. + */ + @Generated + public PathParametersClient buildPathParametersClient() { + return new PathParametersClient(buildInnerClient().getPathParameters()); + } + + /** + * Builds an instance of PathParametersReservedExpansionClient class. + * + * @return an instance of PathParametersReservedExpansionClient. + */ + @Generated + public PathParametersReservedExpansionClient buildPathParametersReservedExpansionClient() { + return new PathParametersReservedExpansionClient(buildInnerClient().getPathParametersReservedExpansions()); + } + + /** + * Builds an instance of PathParametersSimpleExpansionStandardClient class. + * + * @return an instance of PathParametersSimpleExpansionStandardClient. + */ + @Generated + public PathParametersSimpleExpansionStandardClient buildPathParametersSimpleExpansionStandardClient() { + return new PathParametersSimpleExpansionStandardClient( + buildInnerClient().getPathParametersSimpleExpansionStandards()); + } + + /** + * Builds an instance of PathParametersSimpleExpansionExplodeClient class. + * + * @return an instance of PathParametersSimpleExpansionExplodeClient. + */ + @Generated + public PathParametersSimpleExpansionExplodeClient buildPathParametersSimpleExpansionExplodeClient() { + return new PathParametersSimpleExpansionExplodeClient( + buildInnerClient().getPathParametersSimpleExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersPathExpansionStandardClient class. + * + * @return an instance of PathParametersPathExpansionStandardClient. + */ + @Generated + public PathParametersPathExpansionStandardClient buildPathParametersPathExpansionStandardClient() { + return new PathParametersPathExpansionStandardClient( + buildInnerClient().getPathParametersPathExpansionStandards()); + } + + /** + * Builds an instance of PathParametersPathExpansionExplodeClient class. + * + * @return an instance of PathParametersPathExpansionExplodeClient. + */ + @Generated + public PathParametersPathExpansionExplodeClient buildPathParametersPathExpansionExplodeClient() { + return new PathParametersPathExpansionExplodeClient( + buildInnerClient().getPathParametersPathExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersLabelExpansionStandardClient class. + * + * @return an instance of PathParametersLabelExpansionStandardClient. + */ + @Generated + public PathParametersLabelExpansionStandardClient buildPathParametersLabelExpansionStandardClient() { + return new PathParametersLabelExpansionStandardClient( + buildInnerClient().getPathParametersLabelExpansionStandards()); + } + + /** + * Builds an instance of PathParametersLabelExpansionExplodeClient class. + * + * @return an instance of PathParametersLabelExpansionExplodeClient. + */ + @Generated + public PathParametersLabelExpansionExplodeClient buildPathParametersLabelExpansionExplodeClient() { + return new PathParametersLabelExpansionExplodeClient( + buildInnerClient().getPathParametersLabelExpansionExplodes()); + } + + /** + * Builds an instance of PathParametersMatrixExpansionStandardClient class. + * + * @return an instance of PathParametersMatrixExpansionStandardClient. + */ + @Generated + public PathParametersMatrixExpansionStandardClient buildPathParametersMatrixExpansionStandardClient() { + return new PathParametersMatrixExpansionStandardClient( + buildInnerClient().getPathParametersMatrixExpansionStandards()); + } + + /** + * Builds an instance of PathParametersMatrixExpansionExplodeClient class. + * + * @return an instance of PathParametersMatrixExpansionExplodeClient. + */ + @Generated + public PathParametersMatrixExpansionExplodeClient buildPathParametersMatrixExpansionExplodeClient() { + return new PathParametersMatrixExpansionExplodeClient( + buildInnerClient().getPathParametersMatrixExpansionExplodes()); + } + + /** + * Builds an instance of QueryParametersClient class. + * + * @return an instance of QueryParametersClient. + */ + @Generated + public QueryParametersClient buildQueryParametersClient() { + return new QueryParametersClient(buildInnerClient().getQueryParameters()); + } + + /** + * Builds an instance of QueryParametersQueryExpansionStandardClient class. + * + * @return an instance of QueryParametersQueryExpansionStandardClient. + */ + @Generated + public QueryParametersQueryExpansionStandardClient buildQueryParametersQueryExpansionStandardClient() { + return new QueryParametersQueryExpansionStandardClient( + buildInnerClient().getQueryParametersQueryExpansionStandards()); + } + + /** + * Builds an instance of QueryParametersQueryExpansionExplodeClient class. + * + * @return an instance of QueryParametersQueryExpansionExplodeClient. + */ + @Generated + public QueryParametersQueryExpansionExplodeClient buildQueryParametersQueryExpansionExplodeClient() { + return new QueryParametersQueryExpansionExplodeClient( + buildInnerClient().getQueryParametersQueryExpansionExplodes()); + } + + /** + * Builds an instance of QueryParametersQueryContinuationStandardClient class. + * + * @return an instance of QueryParametersQueryContinuationStandardClient. + */ + @Generated + public QueryParametersQueryContinuationStandardClient buildQueryParametersQueryContinuationStandardClient() { + return new QueryParametersQueryContinuationStandardClient( + buildInnerClient().getQueryParametersQueryContinuationStandards()); + } + + /** + * Builds an instance of QueryParametersQueryContinuationExplodeClient class. + * + * @return an instance of QueryParametersQueryContinuationExplodeClient. + */ + @Generated + public QueryParametersQueryContinuationExplodeClient buildQueryParametersQueryContinuationExplodeClient() { + return new QueryParametersQueryContinuationExplodeClient( + buildInnerClient().getQueryParametersQueryContinuationExplodes()); + } + + /** + * Builds an instance of InInterfaceClient class. + * + * @return an instance of InInterfaceClient. + */ + @Generated + public InInterfaceClient buildInInterfaceClient() { + return new InInterfaceClient(buildInnerClient().getInInterfaces()); + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutesClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/InInterfacesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/InInterfacesImpl.java new file mode 100644 index 0000000000..2bd21958d5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/InInterfacesImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InInterfaces. + */ +public final class InInterfacesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final InInterfacesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of InInterfacesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InInterfacesImpl(RoutesClientImpl client) { + this.service + = RestProxy.create(InInterfacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientInInterfaces to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientInInterf") + public interface InInterfacesService { + @Get("/routes/in-interface/fixed") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> fixed(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + + @Get("/routes/in-interface/fixed") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response fixedSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fixedWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.fixed(this.client.getEndpoint(), requestOptions, context)); + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fixedWithResponse(RequestOptions requestOptions) { + return service.fixedSync(this.client.getEndpoint(), requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersImpl.java new file mode 100644 index 0000000000..0d2b250bcf --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParameters. + */ +public final class PathParametersImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersImpl(RoutesClientImpl client) { + this.service + = RestProxy.create(PathParametersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParameters to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersService { + @Get("/routes/path/template-only/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> templateOnly(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/template-only/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response templateOnlySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/explicit/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> explicit(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/explicit/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response explicitSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/annotation-only/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> annotationOnly(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/annotation-only/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response annotationOnlySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateOnlyWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.templateOnly(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return service.templateOnlySync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> explicitWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.explicit(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response explicitWithResponse(String param, RequestOptions requestOptions) { + return service.explicitSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationOnlyWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.annotationOnly(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return service.annotationOnlySync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionExplodesImpl.java new file mode 100644 index 0000000000..71c6325ea2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersLabelExpansionExplodes. + */ +public final class PathParametersLabelExpansionExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersLabelExpansionExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersLabelExpansionExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersLabelExpansionExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersLabelExpansionExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersLabelExpansionExplodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersLabelExpansionExplodesService { + @Get("/routes/path/label/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionStandardsImpl.java new file mode 100644 index 0000000000..9d83500c5b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersLabelExpansionStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersLabelExpansionStandards. + */ +public final class PathParametersLabelExpansionStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersLabelExpansionStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersLabelExpansionStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersLabelExpansionStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersLabelExpansionStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersLabelExpansionStandards to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersLabelExpansionStandardsService { + @Get("/routes/path/label/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/label/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java new file mode 100644 index 0000000000..eabb46138d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersMatrixExpansionExplodes. + */ +public final class PathParametersMatrixExpansionExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersMatrixExpansionExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersMatrixExpansionExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersMatrixExpansionExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersMatrixExpansionExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersMatrixExpansionExplodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersMatrixExpansionExplodesService { + @Get("/routes/path/matrix/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java new file mode 100644 index 0000000000..0ecad43eaf --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersMatrixExpansionStandards. + */ +public final class PathParametersMatrixExpansionStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersMatrixExpansionStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersMatrixExpansionStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersMatrixExpansionStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersMatrixExpansionStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersMatrixExpansionStandards to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersMatrixExpansionStandardsService { + @Get("/routes/path/matrix/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/matrix/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionExplodesImpl.java new file mode 100644 index 0000000000..2bd5a5c6a1 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersPathExpansionExplodes. + */ +public final class PathParametersPathExpansionExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersPathExpansionExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersPathExpansionExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersPathExpansionExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersPathExpansionExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersPathExpansionExplodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersPathExpansionExplodesService { + @Get("/routes/path/path/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionStandardsImpl.java new file mode 100644 index 0000000000..8ea5a04255 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersPathExpansionStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersPathExpansionStandards. + */ +public final class PathParametersPathExpansionStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersPathExpansionStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersPathExpansionStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersPathExpansionStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersPathExpansionStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersPathExpansionStandards to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersPathExpansionStandardsService { + @Get("/routes/path/path/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/path/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersReservedExpansionsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersReservedExpansionsImpl.java new file mode 100644 index 0000000000..bb6b27b0f9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersReservedExpansionsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersReservedExpansions. + */ +public final class PathParametersReservedExpansionsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersReservedExpansionsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersReservedExpansionsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersReservedExpansionsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersReservedExpansionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersReservedExpansions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersReservedExpansionsService { + @Get("/routes/path/reserved-expansion/template/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> template(@HostParam("endpoint") String endpoint, + @PathParam(value = "param", encoded = true) String param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/reserved-expansion/template/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response templateSync(@HostParam("endpoint") String endpoint, + @PathParam(value = "param", encoded = true) String param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/reserved-expansion/annotation/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> annotation(@HostParam("endpoint") String endpoint, + @PathParam(value = "param", encoded = true) String param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/reserved-expansion/annotation/{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response annotationSync(@HostParam("endpoint") String endpoint, + @PathParam(value = "param", encoded = true) String param, RequestOptions requestOptions, Context context); + } + + /** + * The template operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.template(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The template operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateWithResponse(String param, RequestOptions requestOptions) { + return service.templateSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.annotation(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The annotation operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationWithResponse(String param, RequestOptions requestOptions) { + return service.annotationSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java new file mode 100644 index 0000000000..ac6598473f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersSimpleExpansionExplodes. + */ +public final class PathParametersSimpleExpansionExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersSimpleExpansionExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersSimpleExpansionExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersSimpleExpansionExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersSimpleExpansionExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersSimpleExpansionExplodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersSimpleExpansionExplodesService { + @Get("/routes/path/simple/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/explode/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/explode/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/explode/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java new file mode 100644 index 0000000000..96801f392b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PathParametersSimpleExpansionStandards. + */ +public final class PathParametersSimpleExpansionStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PathParametersSimpleExpansionStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of PathParametersSimpleExpansionStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PathParametersSimpleExpansionStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(PathParametersSimpleExpansionStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientPathParametersSimpleExpansionStandards to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientPathPara") + public interface PathParametersSimpleExpansionStandardsService { + @Get("/routes/path/simple/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/standard/primitive{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/standard/array{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @PathParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/path/simple/standard/record{param}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @PathParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersImpl.java new file mode 100644 index 0000000000..392298e760 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryParameters. + */ +public final class QueryParametersImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryParametersService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of QueryParametersImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryParametersImpl(RoutesClientImpl client) { + this.service + = RestProxy.create(QueryParametersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientQueryParameters to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientQueryPar") + public interface QueryParametersService { + @Get("/routes/query/template-only") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> templateOnly(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/template-only") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response templateOnlySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/explicit") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> explicit(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/explicit") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response explicitSync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/annotation-only") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> annotationOnly(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/annotation-only") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response annotationOnlySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> templateOnlyWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.templateOnly(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The templateOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response templateOnlyWithResponse(String param, RequestOptions requestOptions) { + return service.templateOnlySync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> explicitWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.explicit(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The explicit operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response explicitWithResponse(String param, RequestOptions requestOptions) { + return service.explicitSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> annotationOnlyWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.annotationOnly(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The annotationOnly operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response annotationOnlyWithResponse(String param, RequestOptions requestOptions) { + return service.annotationOnlySync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java new file mode 100644 index 0000000000..4302b3777a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryParametersQueryContinuationExplodes. + */ +public final class QueryParametersQueryContinuationExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryParametersQueryContinuationExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of QueryParametersQueryContinuationExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryParametersQueryContinuationExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(QueryParametersQueryContinuationExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientQueryParametersQueryContinuationExplodes to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientQueryPar") + public interface QueryParametersQueryContinuationExplodesService { + @Get("/routes/query/query-continuation/explode/primitive?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/explode/primitive?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/explode/array?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/explode/array?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/explode/record?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/explode/record?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java new file mode 100644 index 0000000000..07d64acc25 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryParametersQueryContinuationStandards. + */ +public final class QueryParametersQueryContinuationStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryParametersQueryContinuationStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of QueryParametersQueryContinuationStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryParametersQueryContinuationStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(QueryParametersQueryContinuationStandardsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientQueryParametersQueryContinuationStandards to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientQueryPar") + public interface QueryParametersQueryContinuationStandardsService { + @Get("/routes/query/query-continuation/standard/primitive?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/standard/primitive?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/standard/array?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/standard/array?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/standard/record?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-continuation/standard/record?fixed=true") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java new file mode 100644 index 0000000000..a1f086f138 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryParametersQueryExpansionExplodes. + */ +public final class QueryParametersQueryExpansionExplodesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryParametersQueryExpansionExplodesService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of QueryParametersQueryExpansionExplodesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryParametersQueryExpansionExplodesImpl(RoutesClientImpl client) { + this.service = RestProxy.create(QueryParametersQueryExpansionExplodesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientQueryParametersQueryExpansionExplodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientQueryPar") + public interface QueryParametersQueryExpansionExplodesService { + @Get("/routes/query/query-expansion/explode/primitive") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/primitive") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/array") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/array") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/record") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/record") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java new file mode 100644 index 0000000000..c4e44b4426 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryParametersQueryExpansionStandards. + */ +public final class QueryParametersQueryExpansionStandardsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryParametersQueryExpansionStandardsService service; + + /** + * The service client containing this operation class. + */ + private final RoutesClientImpl client; + + /** + * Initializes an instance of QueryParametersQueryExpansionStandardsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryParametersQueryExpansionStandardsImpl(RoutesClientImpl client) { + this.service = RestProxy.create(QueryParametersQueryExpansionStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RoutesClientQueryParametersQueryExpansionStandards to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClientQueryPar") + public interface QueryParametersQueryExpansionStandardsService { + @Get("/routes/query/query-expansion/standard/primitive") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> primitive(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/standard/primitive") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response primitiveSync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/standard/array") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> array(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/standard/array") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response arraySync(@HostParam("endpoint") String endpoint, @QueryParam("param") String param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/standard/record") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> record(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/standard/record") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response recordSync(@HostParam("endpoint") String endpoint, + @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> primitiveWithResponseAsync(String param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.primitive(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The primitive operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response primitiveWithResponse(String param, RequestOptions requestOptions) { + return service.primitiveSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> arrayWithResponseAsync(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.array(this.client.getEndpoint(), paramConverted, requestOptions, context)); + } + + /** + * The array operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response arrayWithResponse(List param, RequestOptions requestOptions) { + String paramConverted = param.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.arraySync(this.client.getEndpoint(), paramConverted, requestOptions, Context.NONE); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> recordWithResponseAsync(Map param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.record(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The record operation. + * + * @param param The param parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordWithResponse(Map param, RequestOptions requestOptions) { + return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/RoutesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/RoutesClientImpl.java new file mode 100644 index 0000000000..c5a4bedb38 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/RoutesClientImpl.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the RoutesClient type. + */ +public final class RoutesClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final RoutesClientService service; + + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The PathParametersImpl object to access its operations. + */ + private final PathParametersImpl pathParameters; + + /** + * Gets the PathParametersImpl object to access its operations. + * + * @return the PathParametersImpl object. + */ + public PathParametersImpl getPathParameters() { + return this.pathParameters; + } + + /** + * The PathParametersReservedExpansionsImpl object to access its operations. + */ + private final PathParametersReservedExpansionsImpl pathParametersReservedExpansions; + + /** + * Gets the PathParametersReservedExpansionsImpl object to access its operations. + * + * @return the PathParametersReservedExpansionsImpl object. + */ + public PathParametersReservedExpansionsImpl getPathParametersReservedExpansions() { + return this.pathParametersReservedExpansions; + } + + /** + * The PathParametersSimpleExpansionStandardsImpl object to access its operations. + */ + private final PathParametersSimpleExpansionStandardsImpl pathParametersSimpleExpansionStandards; + + /** + * Gets the PathParametersSimpleExpansionStandardsImpl object to access its operations. + * + * @return the PathParametersSimpleExpansionStandardsImpl object. + */ + public PathParametersSimpleExpansionStandardsImpl getPathParametersSimpleExpansionStandards() { + return this.pathParametersSimpleExpansionStandards; + } + + /** + * The PathParametersSimpleExpansionExplodesImpl object to access its operations. + */ + private final PathParametersSimpleExpansionExplodesImpl pathParametersSimpleExpansionExplodes; + + /** + * Gets the PathParametersSimpleExpansionExplodesImpl object to access its operations. + * + * @return the PathParametersSimpleExpansionExplodesImpl object. + */ + public PathParametersSimpleExpansionExplodesImpl getPathParametersSimpleExpansionExplodes() { + return this.pathParametersSimpleExpansionExplodes; + } + + /** + * The PathParametersPathExpansionStandardsImpl object to access its operations. + */ + private final PathParametersPathExpansionStandardsImpl pathParametersPathExpansionStandards; + + /** + * Gets the PathParametersPathExpansionStandardsImpl object to access its operations. + * + * @return the PathParametersPathExpansionStandardsImpl object. + */ + public PathParametersPathExpansionStandardsImpl getPathParametersPathExpansionStandards() { + return this.pathParametersPathExpansionStandards; + } + + /** + * The PathParametersPathExpansionExplodesImpl object to access its operations. + */ + private final PathParametersPathExpansionExplodesImpl pathParametersPathExpansionExplodes; + + /** + * Gets the PathParametersPathExpansionExplodesImpl object to access its operations. + * + * @return the PathParametersPathExpansionExplodesImpl object. + */ + public PathParametersPathExpansionExplodesImpl getPathParametersPathExpansionExplodes() { + return this.pathParametersPathExpansionExplodes; + } + + /** + * The PathParametersLabelExpansionStandardsImpl object to access its operations. + */ + private final PathParametersLabelExpansionStandardsImpl pathParametersLabelExpansionStandards; + + /** + * Gets the PathParametersLabelExpansionStandardsImpl object to access its operations. + * + * @return the PathParametersLabelExpansionStandardsImpl object. + */ + public PathParametersLabelExpansionStandardsImpl getPathParametersLabelExpansionStandards() { + return this.pathParametersLabelExpansionStandards; + } + + /** + * The PathParametersLabelExpansionExplodesImpl object to access its operations. + */ + private final PathParametersLabelExpansionExplodesImpl pathParametersLabelExpansionExplodes; + + /** + * Gets the PathParametersLabelExpansionExplodesImpl object to access its operations. + * + * @return the PathParametersLabelExpansionExplodesImpl object. + */ + public PathParametersLabelExpansionExplodesImpl getPathParametersLabelExpansionExplodes() { + return this.pathParametersLabelExpansionExplodes; + } + + /** + * The PathParametersMatrixExpansionStandardsImpl object to access its operations. + */ + private final PathParametersMatrixExpansionStandardsImpl pathParametersMatrixExpansionStandards; + + /** + * Gets the PathParametersMatrixExpansionStandardsImpl object to access its operations. + * + * @return the PathParametersMatrixExpansionStandardsImpl object. + */ + public PathParametersMatrixExpansionStandardsImpl getPathParametersMatrixExpansionStandards() { + return this.pathParametersMatrixExpansionStandards; + } + + /** + * The PathParametersMatrixExpansionExplodesImpl object to access its operations. + */ + private final PathParametersMatrixExpansionExplodesImpl pathParametersMatrixExpansionExplodes; + + /** + * Gets the PathParametersMatrixExpansionExplodesImpl object to access its operations. + * + * @return the PathParametersMatrixExpansionExplodesImpl object. + */ + public PathParametersMatrixExpansionExplodesImpl getPathParametersMatrixExpansionExplodes() { + return this.pathParametersMatrixExpansionExplodes; + } + + /** + * The QueryParametersImpl object to access its operations. + */ + private final QueryParametersImpl queryParameters; + + /** + * Gets the QueryParametersImpl object to access its operations. + * + * @return the QueryParametersImpl object. + */ + public QueryParametersImpl getQueryParameters() { + return this.queryParameters; + } + + /** + * The QueryParametersQueryExpansionStandardsImpl object to access its operations. + */ + private final QueryParametersQueryExpansionStandardsImpl queryParametersQueryExpansionStandards; + + /** + * Gets the QueryParametersQueryExpansionStandardsImpl object to access its operations. + * + * @return the QueryParametersQueryExpansionStandardsImpl object. + */ + public QueryParametersQueryExpansionStandardsImpl getQueryParametersQueryExpansionStandards() { + return this.queryParametersQueryExpansionStandards; + } + + /** + * The QueryParametersQueryExpansionExplodesImpl object to access its operations. + */ + private final QueryParametersQueryExpansionExplodesImpl queryParametersQueryExpansionExplodes; + + /** + * Gets the QueryParametersQueryExpansionExplodesImpl object to access its operations. + * + * @return the QueryParametersQueryExpansionExplodesImpl object. + */ + public QueryParametersQueryExpansionExplodesImpl getQueryParametersQueryExpansionExplodes() { + return this.queryParametersQueryExpansionExplodes; + } + + /** + * The QueryParametersQueryContinuationStandardsImpl object to access its operations. + */ + private final QueryParametersQueryContinuationStandardsImpl queryParametersQueryContinuationStandards; + + /** + * Gets the QueryParametersQueryContinuationStandardsImpl object to access its operations. + * + * @return the QueryParametersQueryContinuationStandardsImpl object. + */ + public QueryParametersQueryContinuationStandardsImpl getQueryParametersQueryContinuationStandards() { + return this.queryParametersQueryContinuationStandards; + } + + /** + * The QueryParametersQueryContinuationExplodesImpl object to access its operations. + */ + private final QueryParametersQueryContinuationExplodesImpl queryParametersQueryContinuationExplodes; + + /** + * Gets the QueryParametersQueryContinuationExplodesImpl object to access its operations. + * + * @return the QueryParametersQueryContinuationExplodesImpl object. + */ + public QueryParametersQueryContinuationExplodesImpl getQueryParametersQueryContinuationExplodes() { + return this.queryParametersQueryContinuationExplodes; + } + + /** + * The InInterfacesImpl object to access its operations. + */ + private final InInterfacesImpl inInterfaces; + + /** + * Gets the InInterfacesImpl object to access its operations. + * + * @return the InInterfacesImpl object. + */ + public InInterfacesImpl getInInterfaces() { + return this.inInterfaces; + } + + /** + * Initializes an instance of RoutesClient client. + * + * @param endpoint Service host. + */ + public RoutesClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of RoutesClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + */ + public RoutesClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of RoutesClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. + */ + public RoutesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.pathParameters = new PathParametersImpl(this); + this.pathParametersReservedExpansions = new PathParametersReservedExpansionsImpl(this); + this.pathParametersSimpleExpansionStandards = new PathParametersSimpleExpansionStandardsImpl(this); + this.pathParametersSimpleExpansionExplodes = new PathParametersSimpleExpansionExplodesImpl(this); + this.pathParametersPathExpansionStandards = new PathParametersPathExpansionStandardsImpl(this); + this.pathParametersPathExpansionExplodes = new PathParametersPathExpansionExplodesImpl(this); + this.pathParametersLabelExpansionStandards = new PathParametersLabelExpansionStandardsImpl(this); + this.pathParametersLabelExpansionExplodes = new PathParametersLabelExpansionExplodesImpl(this); + this.pathParametersMatrixExpansionStandards = new PathParametersMatrixExpansionStandardsImpl(this); + this.pathParametersMatrixExpansionExplodes = new PathParametersMatrixExpansionExplodesImpl(this); + this.queryParameters = new QueryParametersImpl(this); + this.queryParametersQueryExpansionStandards = new QueryParametersQueryExpansionStandardsImpl(this); + this.queryParametersQueryExpansionExplodes = new QueryParametersQueryExpansionExplodesImpl(this); + this.queryParametersQueryContinuationStandards = new QueryParametersQueryContinuationStandardsImpl(this); + this.queryParametersQueryContinuationExplodes = new QueryParametersQueryContinuationExplodesImpl(this); + this.inInterfaces = new InInterfacesImpl(this); + this.service = RestProxy.create(RoutesClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for RoutesClient to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RoutesClient") + public interface RoutesClientService { + @Get("/routes/fixed") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> fixed(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + + @Get("/routes/fixed") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response fixedSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fixedWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.fixed(this.getEndpoint(), requestOptions, context)); + } + + /** + * The fixed operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fixedWithResponse(RequestOptions requestOptions) { + return service.fixedSync(this.getEndpoint(), requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/package-info.java new file mode 100644 index 0000000000..374b3d0df2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the implementations for Routes. + * Define scenario in building the http route/uri. + * + */ +package com.routes.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/package-info.java new file mode 100644 index 0000000000..2c3cac91d3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/routes/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the classes for Routes. + * Define scenario in building the http route/uri. + * + */ +package com.routes; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestAsyncClient.java index fc214ad0cb..68d489b3a8 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestAsyncClient.java @@ -15,8 +15,10 @@ import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; import com.specialheaders.conditionalrequest.implementation.ConditionalRequestClientImpl; +import java.time.OffsetDateTime; import reactor.core.publisher.Mono; /** @@ -85,6 +87,58 @@ public Mono> postIfNoneMatchWithResponse(RequestOptions requestOp return this.serviceClient.postIfNoneMatchWithResponseAsync(requestOptions); } + /** + * Check when only If-Modified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time + * of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> headIfModifiedSinceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.headIfModifiedSinceWithResponseAsync(requestOptions); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Unmodified-SinceOffsetDateTimeNoA timestamp indicating the last modified + * time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postIfUnmodifiedSinceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.postIfUnmodifiedSinceWithResponseAsync(requestOptions); + } + /** * Check when only If-Match in header is defined. * @@ -166,4 +220,92 @@ public Mono postIfNoneMatch() { RequestOptions requestOptions = new RequestOptions(); return postIfNoneMatchWithResponse(requestOptions).flatMap(FluxUtil::toMono); } + + /** + * Check when only If-Modified-Since in header is defined. + * + * @param ifModifiedSince A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono headIfModifiedSince(OffsetDateTime ifModifiedSince) { + // Generated convenience method for headIfModifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + return headIfModifiedSinceWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Check when only If-Modified-Since in header is defined. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono headIfModifiedSince() { + // Generated convenience method for headIfModifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return headIfModifiedSinceWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + * + * @param ifUnmodifiedSince A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono postIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + // Generated convenience method for postIfUnmodifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + return postIfUnmodifiedSinceWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono postIfUnmodifiedSince() { + // Generated convenience method for postIfUnmodifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return postIfUnmodifiedSinceWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClient.java index 4629ed4d3d..b95276b3cf 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClient.java @@ -15,7 +15,9 @@ import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.util.DateTimeRfc1123; import com.specialheaders.conditionalrequest.implementation.ConditionalRequestClientImpl; +import java.time.OffsetDateTime; /** * Initializes a new instance of the synchronous ConditionalRequestClient type. @@ -83,6 +85,58 @@ public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) return this.serviceClient.postIfNoneMatchWithResponse(requestOptions); } + /** + * Check when only If-Modified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time + * of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response headIfModifiedSinceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.headIfModifiedSinceWithResponse(requestOptions); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Unmodified-SinceOffsetDateTimeNoA timestamp indicating the last modified + * time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postIfUnmodifiedSinceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.postIfUnmodifiedSinceWithResponse(requestOptions); + } + /** * Check when only If-Match in header is defined. * @@ -160,4 +214,88 @@ public void postIfNoneMatch() { RequestOptions requestOptions = new RequestOptions(); postIfNoneMatchWithResponse(requestOptions).getValue(); } + + /** + * Check when only If-Modified-Since in header is defined. + * + * @param ifModifiedSince A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void headIfModifiedSince(OffsetDateTime ifModifiedSince) { + // Generated convenience method for headIfModifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + headIfModifiedSinceWithResponse(requestOptions).getValue(); + } + + /** + * Check when only If-Modified-Since in header is defined. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void headIfModifiedSince() { + // Generated convenience method for headIfModifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + headIfModifiedSinceWithResponse(requestOptions).getValue(); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + * + * @param ifUnmodifiedSince A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void postIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + // Generated convenience method for postIfUnmodifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + postIfUnmodifiedSinceWithResponse(requestOptions).getValue(); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void postIfUnmodifiedSince() { + // Generated convenience method for postIfUnmodifiedSinceWithResponse + RequestOptions requestOptions = new RequestOptions(); + postIfUnmodifiedSinceWithResponse(requestOptions).getValue(); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java index a5d41b886c..aae1689a89 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java @@ -5,6 +5,7 @@ package com.specialheaders.conditionalrequest.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Head; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -158,6 +159,42 @@ Mono> postIfNoneMatch(@HostParam("endpoint") String endpoint, Req @UnexpectedResponseExceptionType(HttpResponseException.class) Response postIfNoneMatchSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); + + @Head("/special-headers/conditional-request/if-modified-since") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> headIfModifiedSince(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + + @Head("/special-headers/conditional-request/if-modified-since") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response headIfModifiedSinceSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); + + @Post("/special-headers/conditional-request/if-unmodified-since") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> postIfUnmodifiedSince(@HostParam("endpoint") String endpoint, + RequestOptions requestOptions, Context context); + + @Post("/special-headers/conditional-request/if-unmodified-since") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response postIfUnmodifiedSinceSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -251,4 +288,106 @@ public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requ public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) { return service.postIfNoneMatchSync(this.getEndpoint(), requestOptions, Context.NONE); } + + /** + * Check when only If-Modified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time + * of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> headIfModifiedSinceWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.headIfModifiedSince(this.getEndpoint(), requestOptions, context)); + } + + /** + * Check when only If-Modified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Modified-SinceOffsetDateTimeNoA timestamp indicating the last modified time + * of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response headIfModifiedSinceWithResponse(RequestOptions requestOptions) { + return service.headIfModifiedSinceSync(this.getEndpoint(), requestOptions, Context.NONE); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Unmodified-SinceOffsetDateTimeNoA timestamp indicating the last modified + * time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postIfUnmodifiedSinceWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.postIfUnmodifiedSince(this.getEndpoint(), requestOptions, context)); + } + + /** + * Check when only If-Unmodified-Since in header is defined. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-Unmodified-SinceOffsetDateTimeNoA timestamp indicating the last modified + * time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postIfUnmodifiedSinceWithResponse(RequestOptions requestOptions) { + return service.postIfUnmodifiedSinceSync(this.getEndpoint(), requestOptions, Context.NONE); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-flattenproperty_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-flattenproperty_apiview_properties.json new file mode 100644 index 0000000000..8e8bcacf06 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-flattenproperty_apiview_properties.json @@ -0,0 +1,20 @@ +{ + "flavor": "Azure", + "CrossLanguageDefinitionId": { + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putFlattenModelWithResponse": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putNestedFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putNestedFlattenModelWithResponse": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putFlattenModelWithResponse": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putNestedFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putNestedFlattenModelWithResponse": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClientBuilder": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty", + "com._specs_.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.models.ChildModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.models.FlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.FlattenModel", + "com._specs_.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel" + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-core-basic_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-core-basic_apiview_properties.json index 6f3f2070fd..953c9d1d60 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-core-basic_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-core-basic_apiview_properties.json @@ -9,6 +9,8 @@ "com._specs_.azure.core.basic.BasicAsyncClient.delete": "_Specs_.Azure.Core.Basic.delete", "com._specs_.azure.core.basic.BasicAsyncClient.deleteWithResponse": "_Specs_.Azure.Core.Basic.delete", "com._specs_.azure.core.basic.BasicAsyncClient.export": "_Specs_.Azure.Core.Basic.export", + "com._specs_.azure.core.basic.BasicAsyncClient.exportAllUsers": "_Specs_.Azure.Core.Basic.exportAllUsers", + "com._specs_.azure.core.basic.BasicAsyncClient.exportAllUsersWithResponse": "_Specs_.Azure.Core.Basic.exportAllUsers", "com._specs_.azure.core.basic.BasicAsyncClient.exportWithResponse": "_Specs_.Azure.Core.Basic.export", "com._specs_.azure.core.basic.BasicAsyncClient.get": "_Specs_.Azure.Core.Basic.get", "com._specs_.azure.core.basic.BasicAsyncClient.getWithResponse": "_Specs_.Azure.Core.Basic.get", @@ -21,12 +23,15 @@ "com._specs_.azure.core.basic.BasicClient.delete": "_Specs_.Azure.Core.Basic.delete", "com._specs_.azure.core.basic.BasicClient.deleteWithResponse": "_Specs_.Azure.Core.Basic.delete", "com._specs_.azure.core.basic.BasicClient.export": "_Specs_.Azure.Core.Basic.export", + "com._specs_.azure.core.basic.BasicClient.exportAllUsers": "_Specs_.Azure.Core.Basic.exportAllUsers", + "com._specs_.azure.core.basic.BasicClient.exportAllUsersWithResponse": "_Specs_.Azure.Core.Basic.exportAllUsers", "com._specs_.azure.core.basic.BasicClient.exportWithResponse": "_Specs_.Azure.Core.Basic.export", "com._specs_.azure.core.basic.BasicClient.get": "_Specs_.Azure.Core.Basic.get", "com._specs_.azure.core.basic.BasicClient.getWithResponse": "_Specs_.Azure.Core.Basic.get", "com._specs_.azure.core.basic.BasicClient.list": "_Specs_.Azure.Core.Basic.list", "com._specs_.azure.core.basic.BasicClientBuilder": "_Specs_.Azure.Core.Basic", "com._specs_.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User", + "com._specs_.azure.core.basic.models.UserList": "_Specs_.Azure.Core.Basic.UserList", "com._specs_.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder" } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-clientgenerator-core-flattenproperty_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-clientgenerator-core-flattenproperty_apiview_properties.json deleted file mode 100644 index 8d9e3de2e2..0000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-clientgenerator-core-flattenproperty_apiview_properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "flavor": "Azure", - "CrossLanguageDefinitionId": { - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient": "Azure.ClientGenerator.Core.FlattenProperty", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putFlattenModelWithResponse": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putNestedFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyAsyncClient.putNestedFlattenModelWithResponse": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient": "Azure.ClientGenerator.Core.FlattenProperty", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putFlattenModelWithResponse": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putNestedFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.putNestedFlattenModelWithResponse": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClientBuilder": "Azure.ClientGenerator.Core.FlattenProperty", - "com.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel", - "com.azure.clientgenerator.core.flattenproperty.models.ChildModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildModel", - "com.azure.clientgenerator.core.flattenproperty.models.FlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.FlattenModel", - "com.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel" - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-numeric_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-numeric_apiview_properties.json index 7967813d4b..9bc9733517 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-numeric_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-numeric_apiview_properties.json @@ -6,13 +6,18 @@ "com.encode.numeric.NumericAsyncClient.safeintAsStringWithResponse": "Encode.Numeric.Property.safeintAsString", "com.encode.numeric.NumericAsyncClient.uint32AsStringOptional": "Encode.Numeric.Property.uint32AsStringOptional", "com.encode.numeric.NumericAsyncClient.uint32AsStringOptionalWithResponse": "Encode.Numeric.Property.uint32AsStringOptional", + "com.encode.numeric.NumericAsyncClient.uint8AsString": "Encode.Numeric.Property.uint8AsString", + "com.encode.numeric.NumericAsyncClient.uint8AsStringWithResponse": "Encode.Numeric.Property.uint8AsString", "com.encode.numeric.NumericClient": "null", "com.encode.numeric.NumericClient.safeintAsString": "Encode.Numeric.Property.safeintAsString", "com.encode.numeric.NumericClient.safeintAsStringWithResponse": "Encode.Numeric.Property.safeintAsString", "com.encode.numeric.NumericClient.uint32AsStringOptional": "Encode.Numeric.Property.uint32AsStringOptional", "com.encode.numeric.NumericClient.uint32AsStringOptionalWithResponse": "Encode.Numeric.Property.uint32AsStringOptional", + "com.encode.numeric.NumericClient.uint8AsString": "Encode.Numeric.Property.uint8AsString", + "com.encode.numeric.NumericClient.uint8AsStringWithResponse": "Encode.Numeric.Property.uint8AsString", "com.encode.numeric.NumericClientBuilder": "Encode.Numeric", "com.encode.numeric.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", - "com.encode.numeric.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty" + "com.encode.numeric.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", + "com.encode.numeric.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty" } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-models-resources/proxy-config.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-models-resources/proxy-config.json index 39fb0b0018..f65f2e8854 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-models-resources/proxy-config.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-models-resources/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.models.resources.implementation.NestedProxyResourcesClientImpl$NestedProxyResourcesService"],["com.azure.resourcemanager.models.resources.implementation.TopLevelTrackedResourcesClientImpl$TopLevelTrackedResourcesService"]] \ No newline at end of file +[["com.azure.resourcemanager.models.resources.implementation.NestedProxyResourcesClientImpl$NestedProxyResourcesService"],["com.azure.resourcemanager.models.resources.implementation.SingletonTrackedResourcesClientImpl$SingletonTrackedResourcesService"],["com.azure.resourcemanager.models.resources.implementation.TopLevelTrackedResourcesClientImpl$TopLevelTrackedResourcesService"]] \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-multipart_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-multipart_apiview_properties.json index cff6937e7c..198fe62646 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-multipart_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-multipart_apiview_properties.json @@ -1,52 +1,62 @@ { "flavor": "Azure", "CrossLanguageDefinitionId": { - "com.payload.multipart.MultiPartAsyncClient": "null", - "com.payload.multipart.MultiPartAsyncClient.anonymousModel": "Payload.MultiPart.FormData.anonymousModel", - "com.payload.multipart.MultiPartAsyncClient.anonymousModelWithResponse": "Payload.MultiPart.FormData.anonymousModel", - "com.payload.multipart.MultiPartAsyncClient.basic": "Payload.MultiPart.FormData.basic", - "com.payload.multipart.MultiPartAsyncClient.basicWithResponse": "Payload.MultiPart.FormData.basic", - "com.payload.multipart.MultiPartAsyncClient.binaryArrayParts": "Payload.MultiPart.FormData.binaryArrayParts", - "com.payload.multipart.MultiPartAsyncClient.binaryArrayPartsWithResponse": "Payload.MultiPart.FormData.binaryArrayParts", - "com.payload.multipart.MultiPartAsyncClient.checkFileNameAndContentType": "Payload.MultiPart.FormData.checkFileNameAndContentType", - "com.payload.multipart.MultiPartAsyncClient.checkFileNameAndContentTypeWithResponse": "Payload.MultiPart.FormData.checkFileNameAndContentType", - "com.payload.multipart.MultiPartAsyncClient.complex": "Payload.MultiPart.FormData.complex", - "com.payload.multipart.MultiPartAsyncClient.complexWithHttpPart": "Payload.MultiPart.FormData.complexWithHttpPart", - "com.payload.multipart.MultiPartAsyncClient.complexWithHttpPartWithResponse": "Payload.MultiPart.FormData.complexWithHttpPart", - "com.payload.multipart.MultiPartAsyncClient.complexWithResponse": "Payload.MultiPart.FormData.complex", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartOptionalContentType": "Payload.MultiPart.FormData.fileWithHttpPartOptionalContentType", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartOptionalContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartOptionalContentType", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartRequiredContentType": "Payload.MultiPart.FormData.fileWithHttpPartRequiredContentType", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartRequiredContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartRequiredContentType", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartSpecificContentType": "Payload.MultiPart.FormData.fileWithHttpPartSpecificContentType", - "com.payload.multipart.MultiPartAsyncClient.fileWithHttpPartSpecificContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartSpecificContentType", - "com.payload.multipart.MultiPartAsyncClient.jsonPart": "Payload.MultiPart.FormData.jsonPart", - "com.payload.multipart.MultiPartAsyncClient.jsonPartWithResponse": "Payload.MultiPart.FormData.jsonPart", - "com.payload.multipart.MultiPartAsyncClient.multiBinaryParts": "Payload.MultiPart.FormData.multiBinaryParts", - "com.payload.multipart.MultiPartAsyncClient.multiBinaryPartsWithResponse": "Payload.MultiPart.FormData.multiBinaryParts", - "com.payload.multipart.MultiPartClient": "null", - "com.payload.multipart.MultiPartClient.anonymousModel": "Payload.MultiPart.FormData.anonymousModel", - "com.payload.multipart.MultiPartClient.anonymousModelWithResponse": "Payload.MultiPart.FormData.anonymousModel", - "com.payload.multipart.MultiPartClient.basic": "Payload.MultiPart.FormData.basic", - "com.payload.multipart.MultiPartClient.basicWithResponse": "Payload.MultiPart.FormData.basic", - "com.payload.multipart.MultiPartClient.binaryArrayParts": "Payload.MultiPart.FormData.binaryArrayParts", - "com.payload.multipart.MultiPartClient.binaryArrayPartsWithResponse": "Payload.MultiPart.FormData.binaryArrayParts", - "com.payload.multipart.MultiPartClient.checkFileNameAndContentType": "Payload.MultiPart.FormData.checkFileNameAndContentType", - "com.payload.multipart.MultiPartClient.checkFileNameAndContentTypeWithResponse": "Payload.MultiPart.FormData.checkFileNameAndContentType", - "com.payload.multipart.MultiPartClient.complex": "Payload.MultiPart.FormData.complex", - "com.payload.multipart.MultiPartClient.complexWithHttpPart": "Payload.MultiPart.FormData.complexWithHttpPart", - "com.payload.multipart.MultiPartClient.complexWithHttpPartWithResponse": "Payload.MultiPart.FormData.complexWithHttpPart", - "com.payload.multipart.MultiPartClient.complexWithResponse": "Payload.MultiPart.FormData.complex", - "com.payload.multipart.MultiPartClient.fileWithHttpPartOptionalContentType": "Payload.MultiPart.FormData.fileWithHttpPartOptionalContentType", - "com.payload.multipart.MultiPartClient.fileWithHttpPartOptionalContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartOptionalContentType", - "com.payload.multipart.MultiPartClient.fileWithHttpPartRequiredContentType": "Payload.MultiPart.FormData.fileWithHttpPartRequiredContentType", - "com.payload.multipart.MultiPartClient.fileWithHttpPartRequiredContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartRequiredContentType", - "com.payload.multipart.MultiPartClient.fileWithHttpPartSpecificContentType": "Payload.MultiPart.FormData.fileWithHttpPartSpecificContentType", - "com.payload.multipart.MultiPartClient.fileWithHttpPartSpecificContentTypeWithResponse": "Payload.MultiPart.FormData.fileWithHttpPartSpecificContentType", - "com.payload.multipart.MultiPartClient.jsonPart": "Payload.MultiPart.FormData.jsonPart", - "com.payload.multipart.MultiPartClient.jsonPartWithResponse": "Payload.MultiPart.FormData.jsonPart", - "com.payload.multipart.MultiPartClient.multiBinaryParts": "Payload.MultiPart.FormData.multiBinaryParts", - "com.payload.multipart.MultiPartClient.multiBinaryPartsWithResponse": "Payload.MultiPart.FormData.multiBinaryParts", + "com.payload.multipart.FormDataAsyncClient": "null", + "com.payload.multipart.FormDataAsyncClient.anonymousModel": "Payload.MultiPart.FormData.anonymousModel", + "com.payload.multipart.FormDataAsyncClient.anonymousModelWithResponse": "Payload.MultiPart.FormData.anonymousModel", + "com.payload.multipart.FormDataAsyncClient.basic": "Payload.MultiPart.FormData.basic", + "com.payload.multipart.FormDataAsyncClient.basicWithResponse": "Payload.MultiPart.FormData.basic", + "com.payload.multipart.FormDataAsyncClient.binaryArrayParts": "Payload.MultiPart.FormData.binaryArrayParts", + "com.payload.multipart.FormDataAsyncClient.binaryArrayPartsWithResponse": "Payload.MultiPart.FormData.binaryArrayParts", + "com.payload.multipart.FormDataAsyncClient.checkFileNameAndContentType": "Payload.MultiPart.FormData.checkFileNameAndContentType", + "com.payload.multipart.FormDataAsyncClient.checkFileNameAndContentTypeWithResponse": "Payload.MultiPart.FormData.checkFileNameAndContentType", + "com.payload.multipart.FormDataAsyncClient.fileArrayAndBasic": "Payload.MultiPart.FormData.fileArrayAndBasic", + "com.payload.multipart.FormDataAsyncClient.fileArrayAndBasicWithResponse": "Payload.MultiPart.FormData.fileArrayAndBasic", + "com.payload.multipart.FormDataAsyncClient.jsonPart": "Payload.MultiPart.FormData.jsonPart", + "com.payload.multipart.FormDataAsyncClient.jsonPartWithResponse": "Payload.MultiPart.FormData.jsonPart", + "com.payload.multipart.FormDataAsyncClient.multiBinaryParts": "Payload.MultiPart.FormData.multiBinaryParts", + "com.payload.multipart.FormDataAsyncClient.multiBinaryPartsWithResponse": "Payload.MultiPart.FormData.multiBinaryParts", + "com.payload.multipart.FormDataClient": "null", + "com.payload.multipart.FormDataClient.anonymousModel": "Payload.MultiPart.FormData.anonymousModel", + "com.payload.multipart.FormDataClient.anonymousModelWithResponse": "Payload.MultiPart.FormData.anonymousModel", + "com.payload.multipart.FormDataClient.basic": "Payload.MultiPart.FormData.basic", + "com.payload.multipart.FormDataClient.basicWithResponse": "Payload.MultiPart.FormData.basic", + "com.payload.multipart.FormDataClient.binaryArrayParts": "Payload.MultiPart.FormData.binaryArrayParts", + "com.payload.multipart.FormDataClient.binaryArrayPartsWithResponse": "Payload.MultiPart.FormData.binaryArrayParts", + "com.payload.multipart.FormDataClient.checkFileNameAndContentType": "Payload.MultiPart.FormData.checkFileNameAndContentType", + "com.payload.multipart.FormDataClient.checkFileNameAndContentTypeWithResponse": "Payload.MultiPart.FormData.checkFileNameAndContentType", + "com.payload.multipart.FormDataClient.fileArrayAndBasic": "Payload.MultiPart.FormData.fileArrayAndBasic", + "com.payload.multipart.FormDataClient.fileArrayAndBasicWithResponse": "Payload.MultiPart.FormData.fileArrayAndBasic", + "com.payload.multipart.FormDataClient.jsonPart": "Payload.MultiPart.FormData.jsonPart", + "com.payload.multipart.FormDataClient.jsonPartWithResponse": "Payload.MultiPart.FormData.jsonPart", + "com.payload.multipart.FormDataClient.multiBinaryParts": "Payload.MultiPart.FormData.multiBinaryParts", + "com.payload.multipart.FormDataClient.multiBinaryPartsWithResponse": "Payload.MultiPart.FormData.multiBinaryParts", + "com.payload.multipart.FormDataHttpPartsAsyncClient": "null", + "com.payload.multipart.FormDataHttpPartsAsyncClient.jsonArrayAndFileArray": "Payload.MultiPart.FormData.HttpParts.jsonArrayAndFileArray", + "com.payload.multipart.FormDataHttpPartsAsyncClient.jsonArrayAndFileArrayWithResponse": "Payload.MultiPart.FormData.HttpParts.jsonArrayAndFileArray", + "com.payload.multipart.FormDataHttpPartsClient": "null", + "com.payload.multipart.FormDataHttpPartsClient.jsonArrayAndFileArray": "Payload.MultiPart.FormData.HttpParts.jsonArrayAndFileArray", + "com.payload.multipart.FormDataHttpPartsClient.jsonArrayAndFileArrayWithResponse": "Payload.MultiPart.FormData.HttpParts.jsonArrayAndFileArray", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient": "null", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.imageJpegContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.imageJpegContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.imageJpegContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.imageJpegContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.optionalContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.optionalContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.optionalContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.optionalContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.requiredContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.requiredContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeAsyncClient.requiredContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.requiredContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient": "null", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.imageJpegContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.imageJpegContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.imageJpegContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.imageJpegContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.optionalContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.optionalContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.optionalContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.optionalContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.requiredContentType": "Payload.MultiPart.FormData.HttpParts.ContentType.requiredContentType", + "com.payload.multipart.FormDataHttpPartsContentTypeClient.requiredContentTypeWithResponse": "Payload.MultiPart.FormData.HttpParts.ContentType.requiredContentType", + "com.payload.multipart.FormDataHttpPartsNonStringAsyncClient": "null", + "com.payload.multipart.FormDataHttpPartsNonStringAsyncClient.floatMethod": "Payload.MultiPart.FormData.HttpParts.NonString.float", + "com.payload.multipart.FormDataHttpPartsNonStringAsyncClient.floatMethodWithResponse": "Payload.MultiPart.FormData.HttpParts.NonString.float", + "com.payload.multipart.FormDataHttpPartsNonStringClient": "null", + "com.payload.multipart.FormDataHttpPartsNonStringClient.floatMethod": "Payload.MultiPart.FormData.HttpParts.NonString.float", + "com.payload.multipart.FormDataHttpPartsNonStringClient.floatMethodWithResponse": "Payload.MultiPart.FormData.HttpParts.NonString.float", "com.payload.multipart.MultiPartClientBuilder": "Payload.MultiPart", "com.payload.multipart.implementation.models.AnonymousModelRequest": "anonymousModel.Request.anonymous", "com.payload.multipart.models.Address": "Payload.MultiPart.Address", @@ -59,6 +69,7 @@ "com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest": "Payload.MultiPart.FileWithHttpPartOptionalContentTypeRequest", "com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest", "com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest", + "com.payload.multipart.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", "com.payload.multipart.models.JsonPartRequest": "Payload.MultiPart.JsonPartRequest", "com.payload.multipart.models.MultiBinaryPartsRequest": "Payload.MultiPart.MultiBinaryPartsRequest", "com.payload.multipart.models.MultiPartRequest": "Payload.MultiPart.MultiPartRequest", diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_apiview_properties.json new file mode 100644 index 0000000000..6bb4a500b5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_apiview_properties.json @@ -0,0 +1,224 @@ +{ + "flavor": "Azure", + "CrossLanguageDefinitionId": { + "com.routes.InInterfaceAsyncClient": "null", + "com.routes.InInterfaceAsyncClient.fixed": "Routes.InInterface.fixed", + "com.routes.InInterfaceAsyncClient.fixedWithResponse": "Routes.InInterface.fixed", + "com.routes.InInterfaceClient": "null", + "com.routes.InInterfaceClient.fixed": "Routes.InInterface.fixed", + "com.routes.InInterfaceClient.fixedWithResponse": "Routes.InInterface.fixed", + "com.routes.PathParametersAsyncClient": "null", + "com.routes.PathParametersAsyncClient.annotationOnly": "Routes.PathParameters.annotationOnly", + "com.routes.PathParametersAsyncClient.annotationOnlyWithResponse": "Routes.PathParameters.annotationOnly", + "com.routes.PathParametersAsyncClient.explicit": "Routes.PathParameters.explicit", + "com.routes.PathParametersAsyncClient.explicitWithResponse": "Routes.PathParameters.explicit", + "com.routes.PathParametersAsyncClient.templateOnly": "Routes.PathParameters.templateOnly", + "com.routes.PathParametersAsyncClient.templateOnlyWithResponse": "Routes.PathParameters.templateOnly", + "com.routes.PathParametersClient": "null", + "com.routes.PathParametersClient.annotationOnly": "Routes.PathParameters.annotationOnly", + "com.routes.PathParametersClient.annotationOnlyWithResponse": "Routes.PathParameters.annotationOnly", + "com.routes.PathParametersClient.explicit": "Routes.PathParameters.explicit", + "com.routes.PathParametersClient.explicitWithResponse": "Routes.PathParameters.explicit", + "com.routes.PathParametersClient.templateOnly": "Routes.PathParameters.templateOnly", + "com.routes.PathParametersClient.templateOnlyWithResponse": "Routes.PathParameters.templateOnly", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient": "null", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.array": "Routes.PathParameters.LabelExpansion.Explode.array", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.arrayWithResponse": "Routes.PathParameters.LabelExpansion.Explode.array", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.primitive": "Routes.PathParameters.LabelExpansion.Explode.primitive", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.primitiveWithResponse": "Routes.PathParameters.LabelExpansion.Explode.primitive", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.record": "Routes.PathParameters.LabelExpansion.Explode.record", + "com.routes.PathParametersLabelExpansionExplodeAsyncClient.recordWithResponse": "Routes.PathParameters.LabelExpansion.Explode.record", + "com.routes.PathParametersLabelExpansionExplodeClient": "null", + "com.routes.PathParametersLabelExpansionExplodeClient.array": "Routes.PathParameters.LabelExpansion.Explode.array", + "com.routes.PathParametersLabelExpansionExplodeClient.arrayWithResponse": "Routes.PathParameters.LabelExpansion.Explode.array", + "com.routes.PathParametersLabelExpansionExplodeClient.primitive": "Routes.PathParameters.LabelExpansion.Explode.primitive", + "com.routes.PathParametersLabelExpansionExplodeClient.primitiveWithResponse": "Routes.PathParameters.LabelExpansion.Explode.primitive", + "com.routes.PathParametersLabelExpansionExplodeClient.record": "Routes.PathParameters.LabelExpansion.Explode.record", + "com.routes.PathParametersLabelExpansionExplodeClient.recordWithResponse": "Routes.PathParameters.LabelExpansion.Explode.record", + "com.routes.PathParametersLabelExpansionStandardAsyncClient": "null", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.array": "Routes.PathParameters.LabelExpansion.Standard.array", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.arrayWithResponse": "Routes.PathParameters.LabelExpansion.Standard.array", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.primitive": "Routes.PathParameters.LabelExpansion.Standard.primitive", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.primitiveWithResponse": "Routes.PathParameters.LabelExpansion.Standard.primitive", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.record": "Routes.PathParameters.LabelExpansion.Standard.record", + "com.routes.PathParametersLabelExpansionStandardAsyncClient.recordWithResponse": "Routes.PathParameters.LabelExpansion.Standard.record", + "com.routes.PathParametersLabelExpansionStandardClient": "null", + "com.routes.PathParametersLabelExpansionStandardClient.array": "Routes.PathParameters.LabelExpansion.Standard.array", + "com.routes.PathParametersLabelExpansionStandardClient.arrayWithResponse": "Routes.PathParameters.LabelExpansion.Standard.array", + "com.routes.PathParametersLabelExpansionStandardClient.primitive": "Routes.PathParameters.LabelExpansion.Standard.primitive", + "com.routes.PathParametersLabelExpansionStandardClient.primitiveWithResponse": "Routes.PathParameters.LabelExpansion.Standard.primitive", + "com.routes.PathParametersLabelExpansionStandardClient.record": "Routes.PathParameters.LabelExpansion.Standard.record", + "com.routes.PathParametersLabelExpansionStandardClient.recordWithResponse": "Routes.PathParameters.LabelExpansion.Standard.record", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient": "null", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.array": "Routes.PathParameters.MatrixExpansion.Explode.array", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.arrayWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.array", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.primitive": "Routes.PathParameters.MatrixExpansion.Explode.primitive", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.primitiveWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.primitive", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.record": "Routes.PathParameters.MatrixExpansion.Explode.record", + "com.routes.PathParametersMatrixExpansionExplodeAsyncClient.recordWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.record", + "com.routes.PathParametersMatrixExpansionExplodeClient": "null", + "com.routes.PathParametersMatrixExpansionExplodeClient.array": "Routes.PathParameters.MatrixExpansion.Explode.array", + "com.routes.PathParametersMatrixExpansionExplodeClient.arrayWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.array", + "com.routes.PathParametersMatrixExpansionExplodeClient.primitive": "Routes.PathParameters.MatrixExpansion.Explode.primitive", + "com.routes.PathParametersMatrixExpansionExplodeClient.primitiveWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.primitive", + "com.routes.PathParametersMatrixExpansionExplodeClient.record": "Routes.PathParameters.MatrixExpansion.Explode.record", + "com.routes.PathParametersMatrixExpansionExplodeClient.recordWithResponse": "Routes.PathParameters.MatrixExpansion.Explode.record", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient": "null", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.array": "Routes.PathParameters.MatrixExpansion.Standard.array", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.arrayWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.array", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.primitive": "Routes.PathParameters.MatrixExpansion.Standard.primitive", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.primitiveWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.primitive", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.record": "Routes.PathParameters.MatrixExpansion.Standard.record", + "com.routes.PathParametersMatrixExpansionStandardAsyncClient.recordWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.record", + "com.routes.PathParametersMatrixExpansionStandardClient": "null", + "com.routes.PathParametersMatrixExpansionStandardClient.array": "Routes.PathParameters.MatrixExpansion.Standard.array", + "com.routes.PathParametersMatrixExpansionStandardClient.arrayWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.array", + "com.routes.PathParametersMatrixExpansionStandardClient.primitive": "Routes.PathParameters.MatrixExpansion.Standard.primitive", + "com.routes.PathParametersMatrixExpansionStandardClient.primitiveWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.primitive", + "com.routes.PathParametersMatrixExpansionStandardClient.record": "Routes.PathParameters.MatrixExpansion.Standard.record", + "com.routes.PathParametersMatrixExpansionStandardClient.recordWithResponse": "Routes.PathParameters.MatrixExpansion.Standard.record", + "com.routes.PathParametersPathExpansionExplodeAsyncClient": "null", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.array": "Routes.PathParameters.PathExpansion.Explode.array", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.arrayWithResponse": "Routes.PathParameters.PathExpansion.Explode.array", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.primitive": "Routes.PathParameters.PathExpansion.Explode.primitive", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.primitiveWithResponse": "Routes.PathParameters.PathExpansion.Explode.primitive", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.record": "Routes.PathParameters.PathExpansion.Explode.record", + "com.routes.PathParametersPathExpansionExplodeAsyncClient.recordWithResponse": "Routes.PathParameters.PathExpansion.Explode.record", + "com.routes.PathParametersPathExpansionExplodeClient": "null", + "com.routes.PathParametersPathExpansionExplodeClient.array": "Routes.PathParameters.PathExpansion.Explode.array", + "com.routes.PathParametersPathExpansionExplodeClient.arrayWithResponse": "Routes.PathParameters.PathExpansion.Explode.array", + "com.routes.PathParametersPathExpansionExplodeClient.primitive": "Routes.PathParameters.PathExpansion.Explode.primitive", + "com.routes.PathParametersPathExpansionExplodeClient.primitiveWithResponse": "Routes.PathParameters.PathExpansion.Explode.primitive", + "com.routes.PathParametersPathExpansionExplodeClient.record": "Routes.PathParameters.PathExpansion.Explode.record", + "com.routes.PathParametersPathExpansionExplodeClient.recordWithResponse": "Routes.PathParameters.PathExpansion.Explode.record", + "com.routes.PathParametersPathExpansionStandardAsyncClient": "null", + "com.routes.PathParametersPathExpansionStandardAsyncClient.array": "Routes.PathParameters.PathExpansion.Standard.array", + "com.routes.PathParametersPathExpansionStandardAsyncClient.arrayWithResponse": "Routes.PathParameters.PathExpansion.Standard.array", + "com.routes.PathParametersPathExpansionStandardAsyncClient.primitive": "Routes.PathParameters.PathExpansion.Standard.primitive", + "com.routes.PathParametersPathExpansionStandardAsyncClient.primitiveWithResponse": "Routes.PathParameters.PathExpansion.Standard.primitive", + "com.routes.PathParametersPathExpansionStandardAsyncClient.record": "Routes.PathParameters.PathExpansion.Standard.record", + "com.routes.PathParametersPathExpansionStandardAsyncClient.recordWithResponse": "Routes.PathParameters.PathExpansion.Standard.record", + "com.routes.PathParametersPathExpansionStandardClient": "null", + "com.routes.PathParametersPathExpansionStandardClient.array": "Routes.PathParameters.PathExpansion.Standard.array", + "com.routes.PathParametersPathExpansionStandardClient.arrayWithResponse": "Routes.PathParameters.PathExpansion.Standard.array", + "com.routes.PathParametersPathExpansionStandardClient.primitive": "Routes.PathParameters.PathExpansion.Standard.primitive", + "com.routes.PathParametersPathExpansionStandardClient.primitiveWithResponse": "Routes.PathParameters.PathExpansion.Standard.primitive", + "com.routes.PathParametersPathExpansionStandardClient.record": "Routes.PathParameters.PathExpansion.Standard.record", + "com.routes.PathParametersPathExpansionStandardClient.recordWithResponse": "Routes.PathParameters.PathExpansion.Standard.record", + "com.routes.PathParametersReservedExpansionAsyncClient": "null", + "com.routes.PathParametersReservedExpansionAsyncClient.annotation": "Routes.PathParameters.ReservedExpansion.annotation", + "com.routes.PathParametersReservedExpansionAsyncClient.annotationWithResponse": "Routes.PathParameters.ReservedExpansion.annotation", + "com.routes.PathParametersReservedExpansionAsyncClient.template": "Routes.PathParameters.ReservedExpansion.template", + "com.routes.PathParametersReservedExpansionAsyncClient.templateWithResponse": "Routes.PathParameters.ReservedExpansion.template", + "com.routes.PathParametersReservedExpansionClient": "null", + "com.routes.PathParametersReservedExpansionClient.annotation": "Routes.PathParameters.ReservedExpansion.annotation", + "com.routes.PathParametersReservedExpansionClient.annotationWithResponse": "Routes.PathParameters.ReservedExpansion.annotation", + "com.routes.PathParametersReservedExpansionClient.template": "Routes.PathParameters.ReservedExpansion.template", + "com.routes.PathParametersReservedExpansionClient.templateWithResponse": "Routes.PathParameters.ReservedExpansion.template", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient": "null", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.array": "Routes.PathParameters.SimpleExpansion.Explode.array", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.arrayWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.array", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.primitive": "Routes.PathParameters.SimpleExpansion.Explode.primitive", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.primitiveWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.primitive", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.record": "Routes.PathParameters.SimpleExpansion.Explode.record", + "com.routes.PathParametersSimpleExpansionExplodeAsyncClient.recordWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.record", + "com.routes.PathParametersSimpleExpansionExplodeClient": "null", + "com.routes.PathParametersSimpleExpansionExplodeClient.array": "Routes.PathParameters.SimpleExpansion.Explode.array", + "com.routes.PathParametersSimpleExpansionExplodeClient.arrayWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.array", + "com.routes.PathParametersSimpleExpansionExplodeClient.primitive": "Routes.PathParameters.SimpleExpansion.Explode.primitive", + "com.routes.PathParametersSimpleExpansionExplodeClient.primitiveWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.primitive", + "com.routes.PathParametersSimpleExpansionExplodeClient.record": "Routes.PathParameters.SimpleExpansion.Explode.record", + "com.routes.PathParametersSimpleExpansionExplodeClient.recordWithResponse": "Routes.PathParameters.SimpleExpansion.Explode.record", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient": "null", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.array": "Routes.PathParameters.SimpleExpansion.Standard.array", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.arrayWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.array", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.primitive": "Routes.PathParameters.SimpleExpansion.Standard.primitive", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.primitiveWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.primitive", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.record": "Routes.PathParameters.SimpleExpansion.Standard.record", + "com.routes.PathParametersSimpleExpansionStandardAsyncClient.recordWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.record", + "com.routes.PathParametersSimpleExpansionStandardClient": "null", + "com.routes.PathParametersSimpleExpansionStandardClient.array": "Routes.PathParameters.SimpleExpansion.Standard.array", + "com.routes.PathParametersSimpleExpansionStandardClient.arrayWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.array", + "com.routes.PathParametersSimpleExpansionStandardClient.primitive": "Routes.PathParameters.SimpleExpansion.Standard.primitive", + "com.routes.PathParametersSimpleExpansionStandardClient.primitiveWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.primitive", + "com.routes.PathParametersSimpleExpansionStandardClient.record": "Routes.PathParameters.SimpleExpansion.Standard.record", + "com.routes.PathParametersSimpleExpansionStandardClient.recordWithResponse": "Routes.PathParameters.SimpleExpansion.Standard.record", + "com.routes.QueryParametersAsyncClient": "null", + "com.routes.QueryParametersAsyncClient.annotationOnly": "Routes.QueryParameters.annotationOnly", + "com.routes.QueryParametersAsyncClient.annotationOnlyWithResponse": "Routes.QueryParameters.annotationOnly", + "com.routes.QueryParametersAsyncClient.explicit": "Routes.QueryParameters.explicit", + "com.routes.QueryParametersAsyncClient.explicitWithResponse": "Routes.QueryParameters.explicit", + "com.routes.QueryParametersAsyncClient.templateOnly": "Routes.QueryParameters.templateOnly", + "com.routes.QueryParametersAsyncClient.templateOnlyWithResponse": "Routes.QueryParameters.templateOnly", + "com.routes.QueryParametersClient": "null", + "com.routes.QueryParametersClient.annotationOnly": "Routes.QueryParameters.annotationOnly", + "com.routes.QueryParametersClient.annotationOnlyWithResponse": "Routes.QueryParameters.annotationOnly", + "com.routes.QueryParametersClient.explicit": "Routes.QueryParameters.explicit", + "com.routes.QueryParametersClient.explicitWithResponse": "Routes.QueryParameters.explicit", + "com.routes.QueryParametersClient.templateOnly": "Routes.QueryParameters.templateOnly", + "com.routes.QueryParametersClient.templateOnlyWithResponse": "Routes.QueryParameters.templateOnly", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient": "null", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.array": "Routes.QueryParameters.QueryContinuation.Explode.array", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.arrayWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.array", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.primitive": "Routes.QueryParameters.QueryContinuation.Explode.primitive", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.primitiveWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.primitive", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.record": "Routes.QueryParameters.QueryContinuation.Explode.record", + "com.routes.QueryParametersQueryContinuationExplodeAsyncClient.recordWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.record", + "com.routes.QueryParametersQueryContinuationExplodeClient": "null", + "com.routes.QueryParametersQueryContinuationExplodeClient.array": "Routes.QueryParameters.QueryContinuation.Explode.array", + "com.routes.QueryParametersQueryContinuationExplodeClient.arrayWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.array", + "com.routes.QueryParametersQueryContinuationExplodeClient.primitive": "Routes.QueryParameters.QueryContinuation.Explode.primitive", + "com.routes.QueryParametersQueryContinuationExplodeClient.primitiveWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.primitive", + "com.routes.QueryParametersQueryContinuationExplodeClient.record": "Routes.QueryParameters.QueryContinuation.Explode.record", + "com.routes.QueryParametersQueryContinuationExplodeClient.recordWithResponse": "Routes.QueryParameters.QueryContinuation.Explode.record", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient": "null", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.array": "Routes.QueryParameters.QueryContinuation.Standard.array", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.arrayWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.array", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.primitive": "Routes.QueryParameters.QueryContinuation.Standard.primitive", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.primitiveWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.primitive", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.record": "Routes.QueryParameters.QueryContinuation.Standard.record", + "com.routes.QueryParametersQueryContinuationStandardAsyncClient.recordWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.record", + "com.routes.QueryParametersQueryContinuationStandardClient": "null", + "com.routes.QueryParametersQueryContinuationStandardClient.array": "Routes.QueryParameters.QueryContinuation.Standard.array", + "com.routes.QueryParametersQueryContinuationStandardClient.arrayWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.array", + "com.routes.QueryParametersQueryContinuationStandardClient.primitive": "Routes.QueryParameters.QueryContinuation.Standard.primitive", + "com.routes.QueryParametersQueryContinuationStandardClient.primitiveWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.primitive", + "com.routes.QueryParametersQueryContinuationStandardClient.record": "Routes.QueryParameters.QueryContinuation.Standard.record", + "com.routes.QueryParametersQueryContinuationStandardClient.recordWithResponse": "Routes.QueryParameters.QueryContinuation.Standard.record", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient": "null", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.array": "Routes.QueryParameters.QueryExpansion.Explode.array", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.arrayWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.array", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.primitive": "Routes.QueryParameters.QueryExpansion.Explode.primitive", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.primitiveWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.primitive", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.record": "Routes.QueryParameters.QueryExpansion.Explode.record", + "com.routes.QueryParametersQueryExpansionExplodeAsyncClient.recordWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.record", + "com.routes.QueryParametersQueryExpansionExplodeClient": "null", + "com.routes.QueryParametersQueryExpansionExplodeClient.array": "Routes.QueryParameters.QueryExpansion.Explode.array", + "com.routes.QueryParametersQueryExpansionExplodeClient.arrayWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.array", + "com.routes.QueryParametersQueryExpansionExplodeClient.primitive": "Routes.QueryParameters.QueryExpansion.Explode.primitive", + "com.routes.QueryParametersQueryExpansionExplodeClient.primitiveWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.primitive", + "com.routes.QueryParametersQueryExpansionExplodeClient.record": "Routes.QueryParameters.QueryExpansion.Explode.record", + "com.routes.QueryParametersQueryExpansionExplodeClient.recordWithResponse": "Routes.QueryParameters.QueryExpansion.Explode.record", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient": "null", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.array": "Routes.QueryParameters.QueryExpansion.Standard.array", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.arrayWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.array", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.primitive": "Routes.QueryParameters.QueryExpansion.Standard.primitive", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.primitiveWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.primitive", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.record": "Routes.QueryParameters.QueryExpansion.Standard.record", + "com.routes.QueryParametersQueryExpansionStandardAsyncClient.recordWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.record", + "com.routes.QueryParametersQueryExpansionStandardClient": "null", + "com.routes.QueryParametersQueryExpansionStandardClient.array": "Routes.QueryParameters.QueryExpansion.Standard.array", + "com.routes.QueryParametersQueryExpansionStandardClient.arrayWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.array", + "com.routes.QueryParametersQueryExpansionStandardClient.primitive": "Routes.QueryParameters.QueryExpansion.Standard.primitive", + "com.routes.QueryParametersQueryExpansionStandardClient.primitiveWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.primitive", + "com.routes.QueryParametersQueryExpansionStandardClient.record": "Routes.QueryParameters.QueryExpansion.Standard.record", + "com.routes.QueryParametersQueryExpansionStandardClient.recordWithResponse": "Routes.QueryParameters.QueryExpansion.Standard.record", + "com.routes.RoutesAsyncClient": "Routes", + "com.routes.RoutesAsyncClient.fixed": "Routes.fixed", + "com.routes.RoutesAsyncClient.fixedWithResponse": "Routes.fixed", + "com.routes.RoutesClient": "Routes", + "com.routes.RoutesClient.fixed": "Routes.fixed", + "com.routes.RoutesClient.fixedWithResponse": "Routes.fixed", + "com.routes.RoutesClientBuilder": "Routes" + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/specialheaders-conditionalrequest_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/specialheaders-conditionalrequest_apiview_properties.json index a5a0f50620..84f38a53cf 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/specialheaders-conditionalrequest_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/specialheaders-conditionalrequest_apiview_properties.json @@ -2,15 +2,23 @@ "flavor": "Azure", "CrossLanguageDefinitionId": { "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient": "SpecialHeaders.ConditionalRequest", + "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.headIfModifiedSince": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", + "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.headIfModifiedSinceWithResponse": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfMatch": "SpecialHeaders.ConditionalRequest.postIfMatch", "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfMatchWithResponse": "SpecialHeaders.ConditionalRequest.postIfMatch", "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfNoneMatch": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfNoneMatchWithResponse": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", + "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfUnmodifiedSince": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", + "com.specialheaders.conditionalrequest.ConditionalRequestAsyncClient.postIfUnmodifiedSinceWithResponse": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", "com.specialheaders.conditionalrequest.ConditionalRequestClient": "SpecialHeaders.ConditionalRequest", + "com.specialheaders.conditionalrequest.ConditionalRequestClient.headIfModifiedSince": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", + "com.specialheaders.conditionalrequest.ConditionalRequestClient.headIfModifiedSinceWithResponse": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfMatch": "SpecialHeaders.ConditionalRequest.postIfMatch", "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfMatchWithResponse": "SpecialHeaders.ConditionalRequest.postIfMatch", "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfNoneMatch": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfNoneMatchWithResponse": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", + "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfUnmodifiedSince": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", + "com.specialheaders.conditionalrequest.ConditionalRequestClient.postIfUnmodifiedSinceWithResponse": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", "com.specialheaders.conditionalrequest.ConditionalRequestClientBuilder": "SpecialHeaders.ConditionalRequest" } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-clientgenerator-core-flattenproperty.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-flattenproperty.properties similarity index 100% rename from packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-clientgenerator-core-flattenproperty.properties rename to packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-flattenproperty.properties diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/routes.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/routes.properties new file mode 100644 index 0000000000..ca812989b4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/routes.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java similarity index 59% rename from packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java rename to packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java index 2a4d5906f1..6738eaf97b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.clientgenerator.core.flattenproperty; +package com._specs_.azure.clientgenerator.core.flattenproperty; -import com.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel; -import com.azure.clientgenerator.core.flattenproperty.models.ChildModel; -import com.azure.clientgenerator.core.flattenproperty.models.FlattenModel; -import com.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.ChildModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.FlattenModel; +import com._specs_.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; import org.junit.jupiter.api.Test; public class FlattenClientTests { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java similarity index 86% rename from packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java rename to packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java index 4b7d84689b..7a3daa5e96 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/_specs_/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.clientgenerator.core.flattenproperty.generated; +package com._specs_.azure.clientgenerator.core.flattenproperty.generated; // The Java test files under 'generated' package are generated for your reference. // If you wish to modify these files, please copy them out of the 'generated' package, and modify there. // See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. -import com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient; -import com.azure.clientgenerator.core.flattenproperty.FlattenPropertyClientBuilder; +import com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient; +import com._specs_.azure.clientgenerator.core.flattenproperty.FlattenPropertyClientBuilder; import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/MultipartTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/MultipartTests.java index d46431ea68..96e3bcf47d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/MultipartTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/MultipartTests.java @@ -19,6 +19,7 @@ import com.payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest; import com.payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest; import com.payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest; +import com.payload.multipart.models.FloatRequest; import com.payload.multipart.models.JsonPartRequest; import com.payload.multipart.models.MultiBinaryPartsRequest; import com.payload.multipart.models.MultiPartRequest; @@ -40,12 +41,17 @@ public class MultipartTests { private final MultipartFilenameValidationPolicy validationPolicy = new MultipartFilenameValidationPolicy(); - private final MultiPartClient client = new MultiPartClientBuilder() + + private final FormDataClient client = new MultiPartClientBuilder() + .addPolicy(validationPolicy) + .buildFormDataClient(); + private final FormDataAsyncClient asyncClient = new MultiPartClientBuilder() .addPolicy(validationPolicy) - .buildClient(); - private final MultiPartAsyncClient asyncClient = new MultiPartClientBuilder() + .buildFormDataAsyncClient(); + + private final FormDataHttpPartsContentTypeClient httpPartContentTypeClient = new MultiPartClientBuilder() .addPolicy(validationPolicy) - .buildAsyncClient(); + .buildFormDataHttpPartsContentTypeClient(); private static final Path FILE = FileUtils.getJpgFile(); @@ -229,7 +235,7 @@ public void testFilenameAndContentType() { @Test public void testComplex() { - client.complex(new ComplexPartsRequest( + client.fileArrayAndBasic(new ComplexPartsRequest( "123", new Address("X"), new ProfileImageFileDetails(BinaryData.fromFile(FILE)).setFilename("image.jpg"), @@ -248,25 +254,29 @@ public void testAnonymousModel() { @Test public void testFileWithHttpPartSpecificContentType() { - client.fileWithHttpPartSpecificContentType(new FileWithHttpPartSpecificContentTypeRequest( + httpPartContentTypeClient.imageJpegContentType(new FileWithHttpPartSpecificContentTypeRequest( new FileSpecificContentType(BinaryData.fromFile(FILE), "hello.jpg"))); } @Test public void testFileWithHttpPartRequiredContentType() { - client.fileWithHttpPartRequiredContentType(new FileWithHttpPartRequiredContentTypeRequest( + httpPartContentTypeClient.requiredContentType(new FileWithHttpPartRequiredContentTypeRequest( new FileRequiredMetaData(BinaryData.fromFile(FILE), FILENAME, "application/octet-stream"))); } @Test public void testFileWithHttpPartOptionalContentType() { - client.fileWithHttpPartOptionalContentType(new FileWithHttpPartOptionalContentTypeRequest( + httpPartContentTypeClient.optionalContentType(new FileWithHttpPartOptionalContentTypeRequest( new FileOptionalContentType(BinaryData.fromFile(FILE), FILENAME).setContentType(FILE_CONTENT_TYPE))); } @Test public void testComplexWithHttpPart() { - client.complexWithHttpPart(new ComplexHttpPartsModelRequest( + FormDataHttpPartsClient client = new MultiPartClientBuilder() + .addPolicy(validationPolicy) + .buildFormDataHttpPartsClient(); + + client.jsonArrayAndFileArray(new ComplexHttpPartsModelRequest( "123", new Address("X"), new FileRequiredMetaData(BinaryData.fromFile(FILE), FILENAME, FILE_CONTENT_TYPE), @@ -274,4 +284,13 @@ public void testComplexWithHttpPart() { List.of(new FileRequiredMetaData(BinaryData.fromFile(PNG_FILE), FILENAME + "1", FILE_CONTENT_TYPE), new FileRequiredMetaData(BinaryData.fromFile(PNG_FILE), FILENAME + "2", FILE_CONTENT_TYPE)) )); } + + @Test + public void testNonStringHttpPart() { + FormDataHttpPartsNonStringClient client = new MultiPartClientBuilder() + .addPolicy(validationPolicy) + .buildFormDataHttpPartsNonStringClient(); + + client.floatMethod(new FloatRequest(0.5)); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java index 5b1b0baf87..de53dd77c5 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java @@ -14,24 +14,68 @@ import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.Configuration; -import com.payload.multipart.MultiPartClient; +import com.payload.multipart.FormDataClient; +import com.payload.multipart.FormDataHttpPartsClient; +import com.payload.multipart.FormDataHttpPartsContentTypeClient; +import com.payload.multipart.FormDataHttpPartsNonStringClient; import com.payload.multipart.MultiPartClientBuilder; class MultiPartClientTestBase extends TestProxyTestBase { - protected MultiPartClient multiPartClient; + protected FormDataClient formDataClient; + + protected FormDataHttpPartsClient formDataHttpPartsClient; + + protected FormDataHttpPartsContentTypeClient formDataHttpPartsContentTypeClient; + + protected FormDataHttpPartsNonStringClient formDataHttpPartsNonStringClient; @Override protected void beforeTest() { - MultiPartClientBuilder multiPartClientbuilder = new MultiPartClientBuilder() + MultiPartClientBuilder formDataClientbuilder = new MultiPartClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + formDataClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + formDataClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + formDataClient = formDataClientbuilder.buildFormDataClient(); + + MultiPartClientBuilder formDataHttpPartsClientbuilder = new MultiPartClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + formDataHttpPartsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + formDataHttpPartsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + formDataHttpPartsClient = formDataHttpPartsClientbuilder.buildFormDataHttpPartsClient(); + + MultiPartClientBuilder formDataHttpPartsContentTypeClientbuilder = new MultiPartClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + formDataHttpPartsContentTypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + formDataHttpPartsContentTypeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + formDataHttpPartsContentTypeClient + = formDataHttpPartsContentTypeClientbuilder.buildFormDataHttpPartsContentTypeClient(); + + MultiPartClientBuilder formDataHttpPartsNonStringClientbuilder = new MultiPartClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - multiPartClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + formDataHttpPartsNonStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - multiPartClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + formDataHttpPartsNonStringClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - multiPartClient = multiPartClientbuilder.buildClient(); + formDataHttpPartsNonStringClient + = formDataHttpPartsNonStringClientbuilder.buildFormDataHttpPartsNonStringClient(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/routes/generated/RoutesClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/routes/generated/RoutesClientTestBase.java new file mode 100644 index 0000000000..5c09af6d15 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/com/routes/generated/RoutesClientTestBase.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.routes.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; +import com.routes.InInterfaceClient; +import com.routes.PathParametersClient; +import com.routes.PathParametersLabelExpansionExplodeClient; +import com.routes.PathParametersLabelExpansionStandardClient; +import com.routes.PathParametersMatrixExpansionExplodeClient; +import com.routes.PathParametersMatrixExpansionStandardClient; +import com.routes.PathParametersPathExpansionExplodeClient; +import com.routes.PathParametersPathExpansionStandardClient; +import com.routes.PathParametersReservedExpansionClient; +import com.routes.PathParametersSimpleExpansionExplodeClient; +import com.routes.PathParametersSimpleExpansionStandardClient; +import com.routes.QueryParametersClient; +import com.routes.QueryParametersQueryContinuationExplodeClient; +import com.routes.QueryParametersQueryContinuationStandardClient; +import com.routes.QueryParametersQueryExpansionExplodeClient; +import com.routes.QueryParametersQueryExpansionStandardClient; +import com.routes.RoutesClient; +import com.routes.RoutesClientBuilder; + +class RoutesClientTestBase extends TestProxyTestBase { + protected RoutesClient routesClient; + + protected PathParametersClient pathParametersClient; + + protected PathParametersReservedExpansionClient pathParametersReservedExpansionClient; + + protected PathParametersSimpleExpansionStandardClient pathParametersSimpleExpansionStandardClient; + + protected PathParametersSimpleExpansionExplodeClient pathParametersSimpleExpansionExplodeClient; + + protected PathParametersPathExpansionStandardClient pathParametersPathExpansionStandardClient; + + protected PathParametersPathExpansionExplodeClient pathParametersPathExpansionExplodeClient; + + protected PathParametersLabelExpansionStandardClient pathParametersLabelExpansionStandardClient; + + protected PathParametersLabelExpansionExplodeClient pathParametersLabelExpansionExplodeClient; + + protected PathParametersMatrixExpansionStandardClient pathParametersMatrixExpansionStandardClient; + + protected PathParametersMatrixExpansionExplodeClient pathParametersMatrixExpansionExplodeClient; + + protected QueryParametersClient queryParametersClient; + + protected QueryParametersQueryExpansionStandardClient queryParametersQueryExpansionStandardClient; + + protected QueryParametersQueryExpansionExplodeClient queryParametersQueryExpansionExplodeClient; + + protected QueryParametersQueryContinuationStandardClient queryParametersQueryContinuationStandardClient; + + protected QueryParametersQueryContinuationExplodeClient queryParametersQueryContinuationExplodeClient; + + protected InInterfaceClient inInterfaceClient; + + @Override + protected void beforeTest() { + RoutesClientBuilder routesClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + routesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + routesClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + routesClient = routesClientbuilder.buildClient(); + + RoutesClientBuilder pathParametersClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersClient = pathParametersClientbuilder.buildPathParametersClient(); + + RoutesClientBuilder pathParametersReservedExpansionClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersReservedExpansionClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersReservedExpansionClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersReservedExpansionClient + = pathParametersReservedExpansionClientbuilder.buildPathParametersReservedExpansionClient(); + + RoutesClientBuilder pathParametersSimpleExpansionStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersSimpleExpansionStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersSimpleExpansionStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersSimpleExpansionStandardClient + = pathParametersSimpleExpansionStandardClientbuilder.buildPathParametersSimpleExpansionStandardClient(); + + RoutesClientBuilder pathParametersSimpleExpansionExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersSimpleExpansionExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersSimpleExpansionExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersSimpleExpansionExplodeClient + = pathParametersSimpleExpansionExplodeClientbuilder.buildPathParametersSimpleExpansionExplodeClient(); + + RoutesClientBuilder pathParametersPathExpansionStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersPathExpansionStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersPathExpansionStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersPathExpansionStandardClient + = pathParametersPathExpansionStandardClientbuilder.buildPathParametersPathExpansionStandardClient(); + + RoutesClientBuilder pathParametersPathExpansionExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersPathExpansionExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersPathExpansionExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersPathExpansionExplodeClient + = pathParametersPathExpansionExplodeClientbuilder.buildPathParametersPathExpansionExplodeClient(); + + RoutesClientBuilder pathParametersLabelExpansionStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersLabelExpansionStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersLabelExpansionStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersLabelExpansionStandardClient + = pathParametersLabelExpansionStandardClientbuilder.buildPathParametersLabelExpansionStandardClient(); + + RoutesClientBuilder pathParametersLabelExpansionExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersLabelExpansionExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersLabelExpansionExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersLabelExpansionExplodeClient + = pathParametersLabelExpansionExplodeClientbuilder.buildPathParametersLabelExpansionExplodeClient(); + + RoutesClientBuilder pathParametersMatrixExpansionStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersMatrixExpansionStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersMatrixExpansionStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersMatrixExpansionStandardClient + = pathParametersMatrixExpansionStandardClientbuilder.buildPathParametersMatrixExpansionStandardClient(); + + RoutesClientBuilder pathParametersMatrixExpansionExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + pathParametersMatrixExpansionExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + pathParametersMatrixExpansionExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + pathParametersMatrixExpansionExplodeClient + = pathParametersMatrixExpansionExplodeClientbuilder.buildPathParametersMatrixExpansionExplodeClient(); + + RoutesClientBuilder queryParametersClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryParametersClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + queryParametersClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + queryParametersClient = queryParametersClientbuilder.buildQueryParametersClient(); + + RoutesClientBuilder queryParametersQueryExpansionStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryParametersQueryExpansionStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + queryParametersQueryExpansionStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + queryParametersQueryExpansionStandardClient + = queryParametersQueryExpansionStandardClientbuilder.buildQueryParametersQueryExpansionStandardClient(); + + RoutesClientBuilder queryParametersQueryExpansionExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryParametersQueryExpansionExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + queryParametersQueryExpansionExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + queryParametersQueryExpansionExplodeClient + = queryParametersQueryExpansionExplodeClientbuilder.buildQueryParametersQueryExpansionExplodeClient(); + + RoutesClientBuilder queryParametersQueryContinuationStandardClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryParametersQueryContinuationStandardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + queryParametersQueryContinuationStandardClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + queryParametersQueryContinuationStandardClient = queryParametersQueryContinuationStandardClientbuilder + .buildQueryParametersQueryContinuationStandardClient(); + + RoutesClientBuilder queryParametersQueryContinuationExplodeClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryParametersQueryContinuationExplodeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + queryParametersQueryContinuationExplodeClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + queryParametersQueryContinuationExplodeClient + = queryParametersQueryContinuationExplodeClientbuilder.buildQueryParametersQueryContinuationExplodeClient(); + + RoutesClientBuilder inInterfaceClientbuilder = new RoutesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + inInterfaceClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + inInterfaceClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + inInterfaceClient = inInterfaceClientbuilder.buildInInterfaceClient(); + + } +} diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json index 09b64de7e2..fa9029ce2c 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -25,7 +25,7 @@ "node": ">=18.0.0" }, "scripts": { - "clean": "rimraf ./dist ./temp ./generator/target/emitter.jar", + "clean": "rimraf ./dist ./temp ./emitter/temp ./generator/target/emitter.jar", "build": "npm run build:generator && npm run build:emitter", "build:emitter": "tsc -p ./emitter/tsconfig.build.json", "build:generator": "mvn clean install --no-transfer-progress -T 1C -f ./generator/pom.xml",