From b07240acd653e4649c2d6b848cd26efffda5ef13 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 11:20:14 +0800 Subject: [PATCH 01/12] enable tests for xml --- .../generator/http-client-generator-test/Generate.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a2fe1389a67..fcfd434dd35 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 @@ -19,7 +19,7 @@ Write-Host "Parallelization: $Parallelization" $generateScript = { $tspFile = $_ - if ((($tspFile -match "payload[\\/]pageable[\\/]main\.tsp") -and (-not ($tspFile -match "azure[\\/]payload[\\/]pageable[\\/]main\.tsp"))) -or ($tspFile -match "payload[\\/]xml[\\/]main\.tsp")) { + if ((($tspFile -match "payload[\\/]pageable[\\/]main\.tsp") -and (-not ($tspFile -match "azure[\\/]payload[\\/]pageable[\\/]main\.tsp")))) { Write-Host " SKIPPED $tspFile From 82c7cad55bb3b7dfac6e36c4ce49220184694216 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 11:30:32 +0800 Subject: [PATCH 02/12] regen --- .../fluent/LargeHeadersClient.java | 8 +- .../LargeHeadersClientImpl.java | 20 +- .../largeheader/models/LargeHeaders.java | 4 +- .../fluent/LroPagingsClient.java | 4 +- .../fluent/LroesClient.java | 32 +- .../implementation/LroPagingsClientImpl.java | 20 +- .../implementation/LroesClientImpl.java | 74 +- .../operationtemplates/models/LroPagings.java | 4 +- .../operationtemplates/models/Lroes.java | 18 +- .../operationtemplates/models/Order.java | 38 +- .../duration/DurationClientBuilder.java | 20 +- .../encode/duration/LossyAsyncClient.java | 10 +- .../java/encode/duration/LossyClient.java | 10 +- .../implementation/DurationClientImpl.java | 20 +- .../duration/implementation/LossiesImpl.java | 10 +- .../implementation/SpecialCharsImpl.java | 6 +- ...ModelWithArrayOfModelValueAsyncClient.java | 140 +++ .../xml/ModelWithArrayOfModelValueClient.java | 136 +++ .../ModelWithAttributesValueAsyncClient.java | 135 +++ .../xml/ModelWithAttributesValueClient.java | 130 +++ .../ModelWithDatetimeValueAsyncClient.java | 133 +++ .../xml/ModelWithDatetimeValueClient.java | 128 +++ .../ModelWithDictionaryValueAsyncClient.java | 135 +++ .../xml/ModelWithDictionaryValueClient.java | 130 +++ .../ModelWithEmptyArrayValueAsyncClient.java | 142 +++ .../xml/ModelWithEmptyArrayValueClient.java | 137 +++ ...ModelWithEncodedNamesValueAsyncClient.java | 144 +++ .../xml/ModelWithEncodedNamesValueClient.java | 138 +++ .../xml/ModelWithEnumValueAsyncClient.java | 131 +++ .../payload/xml/ModelWithEnumValueClient.java | 126 +++ ...NamespaceOnPropertiesValueAsyncClient.java | 136 +++ ...lWithNamespaceOnPropertiesValueClient.java | 131 +++ .../ModelWithNamespaceValueAsyncClient.java | 133 +++ .../xml/ModelWithNamespaceValueClient.java | 128 +++ .../ModelWithNestedModelValueAsyncClient.java | 137 +++ .../xml/ModelWithNestedModelValueClient.java | 132 +++ ...odelWithOptionalFieldValueAsyncClient.java | 132 +++ .../ModelWithOptionalFieldValueClient.java | 128 +++ ...odelWithRenamedArraysValueAsyncClient.java | 142 +++ .../ModelWithRenamedArraysValueClient.java | 138 +++ ...lWithRenamedAttributeValueAsyncClient.java | 135 +++ .../ModelWithRenamedAttributeValueClient.java | 130 +++ ...odelWithRenamedFieldsValueAsyncClient.java | 140 +++ .../ModelWithRenamedFieldsValueClient.java | 135 +++ ...ithRenamedNestedModelValueAsyncClient.java | 135 +++ ...odelWithRenamedNestedModelValueClient.java | 130 +++ ...elWithRenamedPropertyValueAsyncClient.java | 133 +++ .../ModelWithRenamedPropertyValueClient.java | 128 +++ ...edUnwrappedModelArrayValueAsyncClient.java | 142 +++ ...RenamedUnwrappedModelArrayValueClient.java | 136 +++ ...ppedAndItemModelArrayValueAsyncClient.java | 141 +++ ...edWrappedAndItemModelArrayValueClient.java | 135 +++ ...amedWrappedModelArrayValueAsyncClient.java | 142 +++ ...thRenamedWrappedModelArrayValueClient.java | 136 +++ ...ModelWithSimpleArraysValueAsyncClient.java | 141 +++ .../xml/ModelWithSimpleArraysValueClient.java | 136 +++ .../xml/ModelWithTextValueAsyncClient.java | 133 +++ .../payload/xml/ModelWithTextValueClient.java | 128 +++ ...delWithUnwrappedArrayValueAsyncClient.java | 142 +++ .../ModelWithUnwrappedArrayValueClient.java | 136 +++ ...thUnwrappedModelArrayValueAsyncClient.java | 141 +++ ...delWithUnwrappedModelArrayValueClient.java | 136 +++ ...mitiveCustomItemNamesValueAsyncClient.java | 137 +++ ...edPrimitiveCustomItemNamesValueClient.java | 131 +++ .../xml/SimpleModelValueAsyncClient.java | 133 +++ .../payload/xml/SimpleModelValueClient.java | 128 +++ .../java/payload/xml/XmlClientBuilder.java | 857 ++++++++++++++++++ .../payload/xml/XmlErrorValueAsyncClient.java | 86 ++ .../java/payload/xml/XmlErrorValueClient.java | 82 ++ .../ModelWithArrayOfModelValuesImpl.java | 222 +++++ .../ModelWithAttributesValuesImpl.java | 211 +++++ .../ModelWithDatetimeValuesImpl.java | 207 +++++ .../ModelWithDictionaryValuesImpl.java | 211 +++++ .../ModelWithEmptyArrayValuesImpl.java | 224 +++++ .../ModelWithEncodedNamesValuesImpl.java | 227 +++++ .../ModelWithEnumValuesImpl.java | 203 +++++ ...elWithNamespaceOnPropertiesValuesImpl.java | 212 +++++ .../ModelWithNamespaceValuesImpl.java | 207 +++++ .../ModelWithNestedModelValuesImpl.java | 215 +++++ .../ModelWithOptionalFieldValuesImpl.java | 206 +++++ .../ModelWithRenamedArraysValuesImpl.java | 224 +++++ .../ModelWithRenamedAttributeValuesImpl.java | 211 +++++ .../ModelWithRenamedFieldsValuesImpl.java | 220 +++++ ...ModelWithRenamedNestedModelValuesImpl.java | 211 +++++ .../ModelWithRenamedPropertyValuesImpl.java | 207 +++++ ...hRenamedUnwrappedModelArrayValuesImpl.java | 223 +++++ ...medWrappedAndItemModelArrayValuesImpl.java | 220 +++++ ...ithRenamedWrappedModelArrayValuesImpl.java | 223 +++++ .../ModelWithSimpleArraysValuesImpl.java | 223 +++++ .../ModelWithTextValuesImpl.java | 207 +++++ .../ModelWithUnwrappedArrayValuesImpl.java | 223 +++++ ...odelWithUnwrappedModelArrayValuesImpl.java | 223 +++++ ...pedPrimitiveCustomItemNamesValuesImpl.java | 212 +++++ .../implementation/SimpleModelValuesImpl.java | 207 +++++ .../xml/implementation/XmlClientImpl.java | 484 ++++++++++ .../implementation/XmlErrorValuesImpl.java | 131 +++ .../xml/implementation/package-info.java | 11 + .../main/java/payload/xml/models/Author.java | 105 +++ .../main/java/payload/xml/models/Book.java | 105 +++ .../xml/models/ModelWithArrayOfModel.java | 128 +++ .../xml/models/ModelWithAttributes.java | 146 +++ .../payload/xml/models/ModelWithDatetime.java | 143 +++ .../xml/models/ModelWithDictionary.java | 119 +++ .../xml/models/ModelWithEmptyArray.java | 128 +++ .../xml/models/ModelWithEncodedNames.java | 150 +++ .../payload/xml/models/ModelWithEnum.java | 105 +++ .../xml/models/ModelWithNamespace.java | 130 +++ .../ModelWithNamespaceOnProperties.java | 160 ++++ .../xml/models/ModelWithNestedModel.java | 106 +++ .../xml/models/ModelWithOptionalField.java | 142 +++ .../xml/models/ModelWithRenamedArrays.java | 159 ++++ .../xml/models/ModelWithRenamedAttribute.java | 149 +++ .../xml/models/ModelWithRenamedFields.java | 129 +++ .../models/ModelWithRenamedNestedModel.java | 107 +++ .../xml/models/ModelWithRenamedProperty.java | 129 +++ .../ModelWithRenamedUnwrappedModelArray.java | 118 +++ ...elWithRenamedWrappedAndItemModelArray.java | 132 +++ .../ModelWithRenamedWrappedModelArray.java | 131 +++ .../xml/models/ModelWithSimpleArrays.java | 169 ++++ .../payload/xml/models/ModelWithText.java | 114 +++ .../xml/models/ModelWithUnwrappedArray.java | 158 ++++ .../models/ModelWithUnwrappedModelArray.java | 116 +++ ...elWithWrappedPrimitiveCustomItemNames.java | 132 +++ .../java/payload/xml/models/SimpleModel.java | 127 +++ .../main/java/payload/xml/models/Status.java | 63 ++ .../java/payload/xml/models/package-info.java | 11 + .../main/java/payload/xml/package-info.java | 11 + ...etersQueryExpansionExplodeAsyncClient.java | 18 +- ...ParametersQueryExpansionExplodeClient.java | 18 +- ...yParametersQueryExpansionExplodesImpl.java | 18 +- .../ChildResourcesInterfacesClient.java | 64 +- .../fluent/LroNoBodiesClient.java | 28 +- .../TopLevelArmResourceInterfacesClient.java | 78 +- .../ChildResourcesInterfacesClientImpl.java | 90 +- .../implementation/LroNoBodiesClientImpl.java | 38 +- ...pLevelArmResourceInterfacesClientImpl.java | 116 +-- .../models/ChildResource.java | 50 +- .../models/ChildResourcesInterfaces.java | 26 +- .../models/LroNoBodies.java | 8 +- .../models/TopLevelArmResource.java | 80 +- .../models/TopLevelArmResourceInterfaces.java | 34 +- .../META-INF/payload-xml_metadata.json | 1 + ...t-multipleclientssameversion_metadata.json | 2 +- .../src/main/resources/payload-xml.properties | 2 + .../xml/generated/XmlClientTestBase.java | 350 +++++++ 145 files changed, 18230 insertions(+), 483 deletions(-) create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java index 0643f9b4f58..e550a85514c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java @@ -17,7 +17,7 @@ public interface LargeHeadersClient { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +31,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -46,7 +46,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -59,7 +59,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java index 64190f72e4c..424b24424af 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java @@ -47,7 +47,7 @@ public final class LargeHeadersClientImpl implements LargeHeadersClient { /** * Initializes an instance of LargeHeadersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LargeHeadersClientImpl(LargeHeaderClientImpl client) { @@ -86,7 +86,7 @@ Response two6kSync(@HostParam("endpoint") String endpoint, /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -105,7 +105,7 @@ private Mono>> two6kWithResponseAsync(String resourceG /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ private Response two6kWithResponse(String resourceGroupName, String /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -140,7 +140,7 @@ private Response two6kWithResponse(String resourceGroupName, String /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +158,7 @@ private PollerFlux, CancelResultInner> beginTwo6kA /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -176,7 +176,7 @@ public SyncPoller, CancelResultInner> beginTwo6k(S /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -195,7 +195,7 @@ public SyncPoller, CancelResultInner> beginTwo6k(S /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -211,7 +211,7 @@ private Mono two6kAsync(String resourceGroupName, String larg /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -226,7 +226,7 @@ public CancelResultInner two6k(String resourceGroupName, String largeHeaderName) /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java index b07c442552f..9cb0b0a212e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java @@ -12,7 +12,7 @@ public interface LargeHeaders { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +24,7 @@ public interface LargeHeaders { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java index 0c3baa5636a..f3940053347 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java @@ -16,7 +16,7 @@ public interface LroPagingsClient { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +29,7 @@ public interface LroPagingsClient { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java index 039f5a4ce6d..11a2184a407 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java @@ -20,7 +20,7 @@ public interface LroesClient { /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -36,7 +36,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -53,7 +53,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -67,7 +67,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -82,7 +82,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -97,7 +97,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -113,7 +113,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -127,7 +127,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -142,7 +142,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -155,7 +155,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -169,7 +169,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +181,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -194,7 +194,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -206,7 +206,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -220,7 +220,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -232,7 +232,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java index 7e2f603bb65..f9f8bf7316d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java @@ -50,7 +50,7 @@ public final class LroPagingsClientImpl implements LroPagingsClient { /** * Initializes an instance of LroPagingsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroPagingsClientImpl(OperationTemplatesClientImpl client) { @@ -103,7 +103,7 @@ Response postPagingLroNextSync( /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +137,7 @@ private Mono> postPagingLroSinglePageAsync(String re /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,7 +153,7 @@ private PagedFlux postPagingLroAsync(String resourceGroupName, Str /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -176,7 +176,7 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -201,7 +201,7 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -217,7 +217,7 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -234,7 +234,7 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin /** * 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. @@ -254,7 +254,7 @@ private Mono> postPagingLroNextSinglePageAsync(Strin /** * 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. @@ -272,7 +272,7 @@ private PagedResponse postPagingLroNextSinglePage(String nextLink) /** * 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java index 52d40164eaa..ac00784d002 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java @@ -54,7 +54,7 @@ public final class LroesClientImpl implements LroesClient { /** * Initializes an instance of LroesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroesClientImpl(OperationTemplatesClientImpl client) { @@ -142,7 +142,7 @@ Response exportArraySync(@HostParam("endpoint") String endpoint, /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -165,7 +165,7 @@ private Mono>> createOrReplaceWithResponseAsync(String /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -186,7 +186,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -208,7 +208,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -229,7 +229,7 @@ private PollerFlux, OrderInner> beginCreateOrReplaceAsync /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -249,7 +249,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -269,7 +269,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -287,7 +287,7 @@ private Mono createOrReplaceAsync(String resourceGroupName, String o /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -303,7 +303,7 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or /** * Create a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param resource Resource create parameters. @@ -321,7 +321,7 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -343,7 +343,7 @@ private Mono>> exportWithResponseAsync(String resource /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -362,7 +362,7 @@ private Response exportWithResponse(String resourceGroupName, String /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -383,7 +383,7 @@ private Response exportWithResponse(String resourceGroupName, String /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -402,7 +402,7 @@ private PollerFlux, ExportResultInner> beginExport /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -421,7 +421,7 @@ public SyncPoller, ExportResultInner> beginExport( /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -441,7 +441,7 @@ public SyncPoller, ExportResultInner> beginExport( /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -458,7 +458,7 @@ private Mono exportAsync(String resourceGroupName, String ord /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -474,7 +474,7 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -491,7 +491,7 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -509,7 +509,7 @@ private Mono>> deleteWithResponseAsync(String resource /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -525,7 +525,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -542,7 +542,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -559,7 +559,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -575,7 +575,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -592,7 +592,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -607,7 +607,7 @@ private Mono deleteAsync(String resourceGroupName, String orderName) { /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -621,7 +621,7 @@ public void delete(String resourceGroupName, String orderName) { /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -636,7 +636,7 @@ public void delete(String resourceGroupName, String orderName, Context context) /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -655,7 +655,7 @@ private Mono>> exportArrayWithResponseAsync(ExportRequ /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -672,7 +672,7 @@ private Response exportArrayWithResponse(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -690,7 +690,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -709,7 +709,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -728,7 +728,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -748,7 +748,7 @@ public SyncPoller>, List> /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -762,7 +762,7 @@ private Mono> exportArrayAsync(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -776,7 +776,7 @@ public List exportArray(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java index 1aee18a2904..bb4bbd2c4d3 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java @@ -13,7 +13,7 @@ public interface LroPagings { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,7 +25,7 @@ public interface LroPagings { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java index b7806be61da..047b2f96cc5 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java @@ -13,7 +13,7 @@ public interface Lroes { /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -26,7 +26,7 @@ public interface Lroes { /** * The export operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param body The content of the action request. @@ -40,7 +40,7 @@ public interface Lroes { /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,7 +51,7 @@ public interface Lroes { /** * Delete a Order. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param orderName The name of the Order. * @param context The context to associate with this operation. @@ -63,7 +63,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -74,7 +74,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,7 +86,7 @@ public interface Lroes { /** * Delete a Order. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -96,7 +96,7 @@ public interface Lroes { /** * Delete a Order. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,7 +107,7 @@ public interface Lroes { /** * Begins definition for a new Order resource. - * + * * @param name resource name. * @return the first stage of the new Order definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java index 26cc9f8300a..0a4befe0aba 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java @@ -16,70 +16,70 @@ public interface Order { /** * 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. */ OrderProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the inner azure.resourcemanager.operationtemplates.fluent.models.OrderInner object. - * + * * @return the inner object. */ OrderInner innerModel(); @@ -107,7 +107,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -115,7 +115,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -128,7 +128,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -142,14 +142,14 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Order create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -162,7 +162,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -175,7 +175,7 @@ interface WithTags { interface WithProperties { /** * Specifies the properties property: The resource-specific properties for this resource.. - * + * * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ @@ -185,7 +185,7 @@ interface WithProperties { /** * The export operation. - * + * * @param body The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -196,7 +196,7 @@ interface WithProperties { /** * The export operation. - * + * * @param body The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java index f1903a68876..1e296aab372 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java @@ -206,7 +206,7 @@ public DurationClientBuilder endpoint(String endpoint) { /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the DurationClientBuilder. */ @@ -218,7 +218,7 @@ public DurationClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of DurationClientImpl with the provided parameters. - * + * * @return an instance of DurationClientImpl. */ @Generated @@ -274,7 +274,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of QueryAsyncClient class. - * + * * @return an instance of QueryAsyncClient. */ @Generated @@ -284,7 +284,7 @@ public QueryAsyncClient buildQueryAsyncClient() { /** * Builds an instance of PropertyAsyncClient class. - * + * * @return an instance of PropertyAsyncClient. */ @Generated @@ -294,7 +294,7 @@ public PropertyAsyncClient buildPropertyAsyncClient() { /** * Builds an instance of HeaderAsyncClient class. - * + * * @return an instance of HeaderAsyncClient. */ @Generated @@ -304,7 +304,7 @@ public HeaderAsyncClient buildHeaderAsyncClient() { /** * Builds an instance of LossyAsyncClient class. - * + * * @return an instance of LossyAsyncClient. */ @Generated @@ -314,7 +314,7 @@ public LossyAsyncClient buildLossyAsyncClient() { /** * Builds an instance of QueryClient class. - * + * * @return an instance of QueryClient. */ @Generated @@ -324,7 +324,7 @@ public QueryClient buildQueryClient() { /** * Builds an instance of PropertyClient class. - * + * * @return an instance of PropertyClient. */ @Generated @@ -334,7 +334,7 @@ public PropertyClient buildPropertyClient() { /** * Builds an instance of HeaderClient class. - * + * * @return an instance of HeaderClient. */ @Generated @@ -344,7 +344,7 @@ public HeaderClient buildHeaderClient() { /** * Builds an instance of LossyClient class. - * + * * @return an instance of LossyClient. */ @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java index 38e7713d7a0..68d1b615916 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java @@ -29,7 +29,7 @@ public final class LossyAsyncClient { /** * Initializes an instance of LossyAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -39,7 +39,7 @@ public final class LossyAsyncClient { /** * The intSeconds operation. - * + * * @param input The input 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. @@ -56,7 +56,7 @@ public Mono> intSecondsWithResponse(Duration input, RequestOption /** * The intMilliseconds operation. - * + * * @param input The input 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. @@ -73,7 +73,7 @@ public Mono> intMillisecondsWithResponse(Duration input, RequestO /** * The intSeconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -93,7 +93,7 @@ public Mono intSeconds(Duration input) { /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java index 0fc3ebb1f9a..05752a1a19a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java @@ -27,7 +27,7 @@ public final class LossyClient { /** * Initializes an instance of LossyClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -37,7 +37,7 @@ public final class LossyClient { /** * The intSeconds operation. - * + * * @param input The input 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. @@ -54,7 +54,7 @@ public Response intSecondsWithResponse(Duration input, RequestOptions requ /** * The intMilliseconds operation. - * + * * @param input The input 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. @@ -71,7 +71,7 @@ public Response intMillisecondsWithResponse(Duration input, RequestOptions /** * The intSeconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -90,7 +90,7 @@ public void intSeconds(Duration input) { /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java index 1910f0a3fce..13503c06a55 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java @@ -22,7 +22,7 @@ public final class DurationClientImpl { /** * Gets Service host. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -36,7 +36,7 @@ public String getEndpoint() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -50,7 +50,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -64,7 +64,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Gets the QueriesImpl object to access its operations. - * + * * @return the QueriesImpl object. */ public QueriesImpl getQueries() { @@ -78,7 +78,7 @@ public QueriesImpl getQueries() { /** * Gets the PropertiesImpl object to access its operations. - * + * * @return the PropertiesImpl object. */ public PropertiesImpl getProperties() { @@ -92,7 +92,7 @@ public PropertiesImpl getProperties() { /** * Gets the HeadersImpl object to access its operations. - * + * * @return the HeadersImpl object. */ public HeadersImpl getHeaders() { @@ -106,7 +106,7 @@ public HeadersImpl getHeaders() { /** * Gets the LossiesImpl object to access its operations. - * + * * @return the LossiesImpl object. */ public LossiesImpl getLossies() { @@ -115,7 +115,7 @@ public LossiesImpl getLossies() { /** * Initializes an instance of DurationClient client. - * + * * @param endpoint Service host. */ public DurationClientImpl(String endpoint) { @@ -125,7 +125,7 @@ public DurationClientImpl(String endpoint) { /** * Initializes an instance of DurationClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service host. */ @@ -135,7 +135,7 @@ public DurationClientImpl(HttpPipeline httpPipeline, String endpoint) { /** * Initializes an instance of DurationClient 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java index 0d1b87ee919..9b0d270ecb2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java @@ -41,7 +41,7 @@ public final class LossiesImpl { /** * Initializes an instance of LossiesImpl. - * + * * @param client the instance of the service client containing this operation class. */ LossiesImpl(DurationClientImpl client) { @@ -95,7 +95,7 @@ Response intMillisecondsSync(@HostParam("endpoint") String endpoint, @Quer /** * The intSeconds operation. - * + * * @param input The input 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. @@ -113,7 +113,7 @@ public Mono> intSecondsWithResponseAsync(Duration input, RequestO /** * The intSeconds operation. - * + * * @param input The input 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. @@ -130,7 +130,7 @@ public Response intSecondsWithResponse(Duration input, RequestOptions requ /** * The intMilliseconds operation. - * + * * @param input The input 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. @@ -148,7 +148,7 @@ public Mono> intMillisecondsWithResponseAsync(Duration input, Req /** * The intMilliseconds operation. - * + * * @param input The input 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java index 47f54069466..f0d9fcf5c5d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java @@ -40,7 +40,7 @@ public final class SpecialCharsImpl { /** * Initializes an instance of SpecialCharsImpl. - * + * * @param client the instance of the service client containing this operation class. */ SpecialCharsImpl(QueryClientImpl client) { @@ -77,7 +77,7 @@ Response dollarSignSync(@HostParam("endpoint") String endpoint, @QueryPara /** * The dollarSign operation. - * + * * @param filter The filter 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. @@ -94,7 +94,7 @@ public Mono> dollarSignWithResponseAsync(String filter, RequestOp /** * The dollarSign operation. - * + * * @param filter The filter 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java new file mode 100644 index 00000000000..c9f27edb74b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.models.ModelWithArrayOfModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithArrayOfModelValueAsyncClient { + @Generated + private final ModelWithArrayOfModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithArrayOfModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithArrayOfModelValueAsyncClient(ModelWithArrayOfModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.1 — Contains an array of models along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.1 — Contains an array of models on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithArrayOfModel.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithArrayOfModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java new file mode 100644 index 00000000000..2eade41e31d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.models.ModelWithArrayOfModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithArrayOfModelValueClient { + @Generated + private final ModelWithArrayOfModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithArrayOfModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithArrayOfModelValueClient(ModelWithArrayOfModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.1 — Contains an array of models along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.1 — Contains an array of models. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithArrayOfModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithArrayOfModel.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithArrayOfModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java new file mode 100644 index 00000000000..9f1cc6db82b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.models.ModelWithAttributes; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithAttributesValueAsyncClient { + @Generated + private final ModelWithAttributesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithAttributesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithAttributesValueAsyncClient(ModelWithAttributesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.1 — Contains fields that are XML attributes along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §5.1 — Contains fields that are XML attributes on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithAttributes.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithAttributes input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java new file mode 100644 index 00000000000..72eb3700211 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.models.ModelWithAttributes; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithAttributesValueClient { + @Generated + private final ModelWithAttributesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithAttributesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithAttributesValueClient(ModelWithAttributesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.1 — Contains fields that are XML attributes along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §5.1 — Contains fields that are XML attributes. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithAttributes get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithAttributes.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithAttributes input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java new file mode 100644 index 00000000000..e4d8ae2dc68 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.models.ModelWithDatetime; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithDatetimeValueAsyncClient { + @Generated + private final ModelWithDatetimeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDatetimeValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDatetimeValueAsyncClient(ModelWithDatetimeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains datetime properties with different encodings along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains datetime properties with different encodings on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDatetime.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithDatetime input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java new file mode 100644 index 00000000000..3e7e8567a2b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.models.ModelWithDatetime; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithDatetimeValueClient { + @Generated + private final ModelWithDatetimeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDatetimeValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDatetimeValueClient(ModelWithDatetimeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains datetime properties with different encodings along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains datetime properties with different encodings. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithDatetime get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDatetime.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithDatetime input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java new file mode 100644 index 00000000000..90f66724e53 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.models.ModelWithDictionary; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithDictionaryValueAsyncClient { + @Generated + private final ModelWithDictionaryValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDictionaryValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDictionaryValueAsyncClient(ModelWithDictionaryValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 contains a dictionary of key value pairs along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains a dictionary of key value pairs on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDictionary.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithDictionary input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java new file mode 100644 index 00000000000..3b3e0d9d3f6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.models.ModelWithDictionary; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithDictionaryValueClient { + @Generated + private final ModelWithDictionaryValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDictionaryValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDictionaryValueClient(ModelWithDictionaryValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 contains a dictionary of key value pairs along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains a dictionary of key value pairs. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithDictionary get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDictionary.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithDictionary input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java new file mode 100644 index 00000000000..09f040a126d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.models.ModelWithEmptyArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEmptyArrayValueAsyncClient { + @Generated + private final ModelWithEmptyArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEmptyArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEmptyArrayValueAsyncClient(ModelWithEmptyArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains an array of models that's supposed to be sent/received as an empty XML element on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEmptyArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEmptyArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java new file mode 100644 index 00000000000..a34f5ce93ce --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.models.ModelWithEmptyArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEmptyArrayValueClient { + @Generated + private final ModelWithEmptyArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEmptyArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEmptyArrayValueClient(ModelWithEmptyArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains an array of models that's supposed to be sent/received as an empty XML element. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEmptyArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEmptyArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEmptyArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java new file mode 100644 index 00000000000..feb90f3117c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.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 payload.xml; + +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 payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.models.ModelWithEncodedNames; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEncodedNamesValueAsyncClient { + @Generated + private final ModelWithEncodedNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEncodedNamesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEncodedNamesValueAsyncClient(ModelWithEncodedNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 uses encodedName instead of Xml.Name which is functionally equivalent on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEncodedNames.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEncodedNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java new file mode 100644 index 00000000000..8a1bab4804f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.models.ModelWithEncodedNames; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEncodedNamesValueClient { + @Generated + private final ModelWithEncodedNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEncodedNamesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEncodedNamesValueClient(ModelWithEncodedNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 uses encodedName instead of Xml.Name which is functionally equivalent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEncodedNames get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEncodedNames.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEncodedNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java new file mode 100644 index 00000000000..6e6818526e5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.models.ModelWithEnum; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEnumValueAsyncClient { + @Generated + private final ModelWithEnumValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEnumValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEnumValueAsyncClient(ModelWithEnumValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains a single property with an enum value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains a single property with an enum value on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEnum.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEnum input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java new file mode 100644 index 00000000000..f5206f2a10e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.models.ModelWithEnum; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEnumValueClient { + @Generated + private final ModelWithEnumValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEnumValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEnumValueClient(ModelWithEnumValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains a single property with an enum value along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains a single property with an enum value. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEnum get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEnum.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithEnum input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java new file mode 100644 index 00000000000..c8f0ebbfb2a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.models.ModelWithNamespaceOnProperties; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNamespaceOnPropertiesValueAsyncClient { + @Generated + private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceOnPropertiesValueAsyncClient(ModelWithNamespaceOnPropertiesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespaceOnProperties.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNamespaceOnProperties input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java new file mode 100644 index 00000000000..5c28fc8a042 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.models.ModelWithNamespaceOnProperties; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNamespaceOnPropertiesValueClient { + @Generated + private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceOnPropertiesValueClient(ModelWithNamespaceOnPropertiesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNamespaceOnProperties get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespaceOnProperties.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNamespaceOnProperties input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java new file mode 100644 index 00000000000..d4e3b6dbb8a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.models.ModelWithNamespace; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNamespaceValueAsyncClient { + @Generated + private final ModelWithNamespaceValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceValueAsyncClient(ModelWithNamespaceValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §6.1, §7.1 — Contains fields with XML namespace on the model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespace.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNamespace input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java new file mode 100644 index 00000000000..74ede515d78 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.models.ModelWithNamespace; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNamespaceValueClient { + @Generated + private final ModelWithNamespaceValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceValueClient(ModelWithNamespaceValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §6.1, §7.1 — Contains fields with XML namespace on the model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNamespace get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespace.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNamespace input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java new file mode 100644 index 00000000000..61bb169d759 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.models.ModelWithNestedModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNestedModelValueAsyncClient { + @Generated + private final ModelWithNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNestedModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNestedModelValueAsyncClient(ModelWithNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.1 — Contains a property that references another model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §2.1 — Contains a property that references another model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNestedModel.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java new file mode 100644 index 00000000000..f28dab71b61 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.models.ModelWithNestedModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNestedModelValueClient { + @Generated + private final ModelWithNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNestedModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNestedModelValueClient(ModelWithNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.1 — Contains a property that references another model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §2.1 — Contains a property that references another model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNestedModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNestedModel.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java new file mode 100644 index 00000000000..534f9c0391d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.models.ModelWithOptionalField; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithOptionalFieldValueAsyncClient { + @Generated + private final ModelWithOptionalFieldValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithOptionalFieldValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithOptionalFieldValueAsyncClient(ModelWithOptionalFieldValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @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 contains an optional field along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains an optional field on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithOptionalField.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithOptionalField input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java new file mode 100644 index 00000000000..046f1460a19 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.models.ModelWithOptionalField; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithOptionalFieldValueClient { + @Generated + private final ModelWithOptionalFieldValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithOptionalFieldValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithOptionalFieldValueClient(ModelWithOptionalFieldValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @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 contains an optional field along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains an optional field. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithOptionalField get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithOptionalField.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithOptionalField input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java new file mode 100644 index 00000000000..bb75ac7a6fa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.models.ModelWithRenamedArrays; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedArraysValueAsyncClient { + @Generated + private final ModelWithRenamedArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedArraysValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedArraysValueAsyncClient(ModelWithRenamedArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedArrays.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java new file mode 100644 index 00000000000..a6792ff674b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.models.ModelWithRenamedArrays; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedArraysValueClient { + @Generated + private final ModelWithRenamedArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedArraysValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedArraysValueClient(ModelWithRenamedArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedArrays get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedArrays.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java new file mode 100644 index 00000000000..751785ec4fe --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.models.ModelWithRenamedAttribute; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedAttributeValueAsyncClient { + @Generated + private final ModelWithRenamedAttributeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedAttributeValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedAttributeValueAsyncClient(ModelWithRenamedAttributeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.2 — Contains a renamed XML attribute along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §5.2 — Contains a renamed XML attribute on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedAttribute.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedAttribute input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java new file mode 100644 index 00000000000..e0b403376ae --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.models.ModelWithRenamedAttribute; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedAttributeValueClient { + @Generated + private final ModelWithRenamedAttributeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedAttributeValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedAttributeValueClient(ModelWithRenamedAttributeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.2 — Contains a renamed XML attribute along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §5.2 — Contains a renamed XML attribute. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedAttribute get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedAttribute.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedAttribute input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java new file mode 100644 index 00000000000..3c68ba49052 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.models.ModelWithRenamedFields; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedFieldsValueAsyncClient { + @Generated + private final ModelWithRenamedFieldsValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedFieldsValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedFieldsValueAsyncClient(ModelWithRenamedFieldsValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.3, §2.3 — Contains fields of the same type that have different XML representation on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedFields.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedFields input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java new file mode 100644 index 00000000000..930cefda41b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.models.ModelWithRenamedFields; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedFieldsValueClient { + @Generated + private final ModelWithRenamedFieldsValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedFieldsValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedFieldsValueClient(ModelWithRenamedFieldsValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.3, §2.3 — Contains fields of the same type that have different XML representation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedFields get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedFields.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedFields input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java new file mode 100644 index 00000000000..8f9a8eb1e5c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.models.ModelWithRenamedNestedModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedNestedModelValueAsyncClient { + @Generated + private final ModelWithRenamedNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedNestedModelValueAsyncClient(ModelWithRenamedNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.2 — Contains a property whose type has along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §2.2 — Contains a property whose type has on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedNestedModel.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java new file mode 100644 index 00000000000..a47d917046f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.models.ModelWithRenamedNestedModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedNestedModelValueClient { + @Generated + private final ModelWithRenamedNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedNestedModelValueClient(ModelWithRenamedNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.2 — Contains a property whose type has along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §2.2 — Contains a property whose type has. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedNestedModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedNestedModel.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java new file mode 100644 index 00000000000..fd0ebcb1119 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.models.ModelWithRenamedProperty; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedPropertyValueAsyncClient { + @Generated + private final ModelWithRenamedPropertyValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedPropertyValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedPropertyValueAsyncClient(ModelWithRenamedPropertyValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.2 — Contains a scalar property with a custom XML name on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedProperty.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedProperty input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java new file mode 100644 index 00000000000..f6a0db83fd6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.models.ModelWithRenamedProperty; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedPropertyValueClient { + @Generated + private final ModelWithRenamedPropertyValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedPropertyValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedPropertyValueClient(ModelWithRenamedPropertyValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.2 — Contains a scalar property with a custom XML name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedProperty get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedProperty.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedProperty input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..394e7ab7cc8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedUnwrappedModelArrayValueAsyncClient { + @Generated + private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedUnwrappedModelArrayValueAsyncClient(ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.4 — Contains an unwrapped array of models with a custom item name on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedUnwrappedModelArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java new file mode 100644 index 00000000000..5cba045b671 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedUnwrappedModelArrayValueClient { + @Generated + private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedUnwrappedModelArrayValueClient(ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.4 — Contains an unwrapped array of models with a custom item name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedUnwrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedUnwrappedModelArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..7e8c8740f1d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient { + @Generated + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient( + ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedAndItemModelArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedWrappedAndItemModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java new file mode 100644 index 00000000000..a779f7a2d69 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedWrappedAndItemModelArrayValueClient { + @Generated + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedAndItemModelArrayValueClient( + ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedWrappedAndItemModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedAndItemModelArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedWrappedAndItemModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..57cf41a65dc --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedWrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedWrappedModelArrayValueAsyncClient { + @Generated + private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedModelArrayValueAsyncClient(ModelWithRenamedWrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.3 — Contains a wrapped array of models with a custom wrapper name on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedModelArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedWrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java new file mode 100644 index 00000000000..0599e763abb --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithRenamedWrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedWrappedModelArrayValueClient { + @Generated + private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedModelArrayValueClient(ModelWithRenamedWrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.3 — Contains a wrapped array of models with a custom wrapper name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedWrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedModelArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithRenamedWrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java new file mode 100644 index 00000000000..1d033fb0668 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.models.ModelWithSimpleArrays; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithSimpleArraysValueAsyncClient { + @Generated + private final ModelWithSimpleArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithSimpleArraysValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithSimpleArraysValueAsyncClient(ModelWithSimpleArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.1 — Contains fields of arrays of primitive types along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.1 — Contains fields of arrays of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithSimpleArrays.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithSimpleArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java new file mode 100644 index 00000000000..c0a80f42612 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.models.ModelWithSimpleArrays; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithSimpleArraysValueClient { + @Generated + private final ModelWithSimpleArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithSimpleArraysValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithSimpleArraysValueClient(ModelWithSimpleArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.1 — Contains fields of arrays of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.1 — Contains fields of arrays of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithSimpleArrays get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithSimpleArrays.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithSimpleArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java new file mode 100644 index 00000000000..c170627e776 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.models.ModelWithText; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithTextValueAsyncClient { + @Generated + private final ModelWithTextValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithTextValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithTextValueAsyncClient(ModelWithTextValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §8.1 — Contains an attribute and text along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §8.1 — Contains an attribute and text on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithText.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithText input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java new file mode 100644 index 00000000000..ed7cf02a66a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.models.ModelWithText; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithTextValueClient { + @Generated + private final ModelWithTextValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithTextValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithTextValueClient(ModelWithTextValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §8.1 — Contains an attribute and text along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §8.1 — Contains an attribute and text. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithText get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithText.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithText input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java new file mode 100644 index 00000000000..184c10eb2e8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.models.ModelWithUnwrappedArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithUnwrappedArrayValueAsyncClient { + @Generated + private final ModelWithUnwrappedArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedArrayValueAsyncClient(ModelWithUnwrappedArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithUnwrappedArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java new file mode 100644 index 00000000000..a8c5c6bff5c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.models.ModelWithUnwrappedArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithUnwrappedArrayValueClient { + @Generated + private final ModelWithUnwrappedArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedArrayValueClient(ModelWithUnwrappedArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithUnwrappedArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithUnwrappedArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..0d931bee331 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithUnwrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithUnwrappedModelArrayValueAsyncClient { + @Generated + private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedModelArrayValueAsyncClient(ModelWithUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.2 — Contains an unwrapped array of models along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.2 — Contains an unwrapped array of models on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedModelArray.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java new file mode 100644 index 00000000000..ee44d1a3569 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.models.ModelWithUnwrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithUnwrappedModelArrayValueClient { + @Generated + private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedModelArrayValueClient(ModelWithUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.2 — Contains an unwrapped array of models along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.2 — Contains an unwrapped array of models. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithUnwrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedModelArray.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java new file mode 100644 index 00000000000..5a99b4ed6f5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient { + @Generated + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient( + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithWrappedPrimitiveCustomItemNames.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithWrappedPrimitiveCustomItemNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java new file mode 100644 index 00000000000..bad23899728 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithWrappedPrimitiveCustomItemNamesValueClient { + @Generated + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithWrappedPrimitiveCustomItemNamesValueClient( + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithWrappedPrimitiveCustomItemNames get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithWrappedPrimitiveCustomItemNames.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(ModelWithWrappedPrimitiveCustomItemNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java new file mode 100644 index 00000000000..3fc5c90057c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.models.SimpleModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class SimpleModelValueAsyncClient { + @Generated + private final SimpleModelValuesImpl serviceClient; + + /** + * Initializes an instance of SimpleModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + SimpleModelValueAsyncClient(SimpleModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class)); + } + + /** + * The put operation. + * + * @param input The input 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 put(SimpleModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java new file mode 100644 index 00000000000..00f5c8a5c4d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.models.SimpleModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class SimpleModelValueClient { + @Generated + private final SimpleModelValuesImpl serviceClient; + + /** + * Initializes an instance of SimpleModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + SimpleModelValueClient(SimpleModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public SimpleModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class); + } + + /** + * The put operation. + * + * @param input The input 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 put(SimpleModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java new file mode 100644 index 00000000000..d948db09542 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java @@ -0,0 +1,857 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +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 java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import payload.xml.implementation.XmlClientImpl; + +/** + * A builder for creating a new instance of the XmlClient type. + */ +@ServiceClientBuilder( + serviceClients = { + SimpleModelValueClient.class, + ModelWithRenamedPropertyValueClient.class, + ModelWithRenamedFieldsValueClient.class, + ModelWithNestedModelValueClient.class, + ModelWithRenamedNestedModelValueClient.class, + ModelWithSimpleArraysValueClient.class, + ModelWithUnwrappedArrayValueClient.class, + ModelWithRenamedArraysValueClient.class, + ModelWithWrappedPrimitiveCustomItemNamesValueClient.class, + ModelWithArrayOfModelValueClient.class, + ModelWithUnwrappedModelArrayValueClient.class, + ModelWithRenamedWrappedModelArrayValueClient.class, + ModelWithRenamedUnwrappedModelArrayValueClient.class, + ModelWithRenamedWrappedAndItemModelArrayValueClient.class, + ModelWithAttributesValueClient.class, + ModelWithRenamedAttributeValueClient.class, + ModelWithNamespaceValueClient.class, + ModelWithNamespaceOnPropertiesValueClient.class, + ModelWithTextValueClient.class, + ModelWithOptionalFieldValueClient.class, + ModelWithEmptyArrayValueClient.class, + ModelWithDictionaryValueClient.class, + ModelWithEncodedNamesValueClient.class, + ModelWithEnumValueClient.class, + ModelWithDatetimeValueClient.class, + XmlErrorValueClient.class, + SimpleModelValueAsyncClient.class, + ModelWithRenamedPropertyValueAsyncClient.class, + ModelWithRenamedFieldsValueAsyncClient.class, + ModelWithNestedModelValueAsyncClient.class, + ModelWithRenamedNestedModelValueAsyncClient.class, + ModelWithSimpleArraysValueAsyncClient.class, + ModelWithUnwrappedArrayValueAsyncClient.class, + ModelWithRenamedArraysValueAsyncClient.class, + ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.class, + ModelWithArrayOfModelValueAsyncClient.class, + ModelWithUnwrappedModelArrayValueAsyncClient.class, + ModelWithRenamedWrappedModelArrayValueAsyncClient.class, + ModelWithRenamedUnwrappedModelArrayValueAsyncClient.class, + ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.class, + ModelWithAttributesValueAsyncClient.class, + ModelWithRenamedAttributeValueAsyncClient.class, + ModelWithNamespaceValueAsyncClient.class, + ModelWithNamespaceOnPropertiesValueAsyncClient.class, + ModelWithTextValueAsyncClient.class, + ModelWithOptionalFieldValueAsyncClient.class, + ModelWithEmptyArrayValueAsyncClient.class, + ModelWithDictionaryValueAsyncClient.class, + ModelWithEncodedNamesValueAsyncClient.class, + ModelWithEnumValueAsyncClient.class, + ModelWithDatetimeValueAsyncClient.class, + XmlErrorValueAsyncClient.class }) +public final class XmlClientBuilder + 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("payload-xml.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the XmlClientBuilder. + */ + @Generated + public XmlClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder 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 XmlClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder. + */ + @Generated + public XmlClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of XmlClientImpl with the provided parameters. + * + * @return an instance of XmlClientImpl. + */ + @Generated + private XmlClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + XmlClientImpl client + = new XmlClientImpl(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 SimpleModelValueAsyncClient class. + * + * @return an instance of SimpleModelValueAsyncClient. + */ + @Generated + public SimpleModelValueAsyncClient buildSimpleModelValueAsyncClient() { + return new SimpleModelValueAsyncClient(buildInnerClient().getSimpleModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedPropertyValueAsyncClient class. + * + * @return an instance of ModelWithRenamedPropertyValueAsyncClient. + */ + @Generated + public ModelWithRenamedPropertyValueAsyncClient buildModelWithRenamedPropertyValueAsyncClient() { + return new ModelWithRenamedPropertyValueAsyncClient(buildInnerClient().getModelWithRenamedPropertyValues()); + } + + /** + * Builds an instance of ModelWithRenamedFieldsValueAsyncClient class. + * + * @return an instance of ModelWithRenamedFieldsValueAsyncClient. + */ + @Generated + public ModelWithRenamedFieldsValueAsyncClient buildModelWithRenamedFieldsValueAsyncClient() { + return new ModelWithRenamedFieldsValueAsyncClient(buildInnerClient().getModelWithRenamedFieldsValues()); + } + + /** + * Builds an instance of ModelWithNestedModelValueAsyncClient class. + * + * @return an instance of ModelWithNestedModelValueAsyncClient. + */ + @Generated + public ModelWithNestedModelValueAsyncClient buildModelWithNestedModelValueAsyncClient() { + return new ModelWithNestedModelValueAsyncClient(buildInnerClient().getModelWithNestedModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedNestedModelValueAsyncClient class. + * + * @return an instance of ModelWithRenamedNestedModelValueAsyncClient. + */ + @Generated + public ModelWithRenamedNestedModelValueAsyncClient buildModelWithRenamedNestedModelValueAsyncClient() { + return new ModelWithRenamedNestedModelValueAsyncClient( + buildInnerClient().getModelWithRenamedNestedModelValues()); + } + + /** + * Builds an instance of ModelWithSimpleArraysValueAsyncClient class. + * + * @return an instance of ModelWithSimpleArraysValueAsyncClient. + */ + @Generated + public ModelWithSimpleArraysValueAsyncClient buildModelWithSimpleArraysValueAsyncClient() { + return new ModelWithSimpleArraysValueAsyncClient(buildInnerClient().getModelWithSimpleArraysValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedArrayValueAsyncClient class. + * + * @return an instance of ModelWithUnwrappedArrayValueAsyncClient. + */ + @Generated + public ModelWithUnwrappedArrayValueAsyncClient buildModelWithUnwrappedArrayValueAsyncClient() { + return new ModelWithUnwrappedArrayValueAsyncClient(buildInnerClient().getModelWithUnwrappedArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedArraysValueAsyncClient class. + * + * @return an instance of ModelWithRenamedArraysValueAsyncClient. + */ + @Generated + public ModelWithRenamedArraysValueAsyncClient buildModelWithRenamedArraysValueAsyncClient() { + return new ModelWithRenamedArraysValueAsyncClient(buildInnerClient().getModelWithRenamedArraysValues()); + } + + /** + * Builds an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient class. + * + * @return an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient + buildModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient() { + return new ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient( + buildInnerClient().getModelWithWrappedPrimitiveCustomItemNamesValues()); + } + + /** + * Builds an instance of ModelWithArrayOfModelValueAsyncClient class. + * + * @return an instance of ModelWithArrayOfModelValueAsyncClient. + */ + @Generated + public ModelWithArrayOfModelValueAsyncClient buildModelWithArrayOfModelValueAsyncClient() { + return new ModelWithArrayOfModelValueAsyncClient(buildInnerClient().getModelWithArrayOfModelValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithUnwrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithUnwrappedModelArrayValueAsyncClient buildModelWithUnwrappedModelArrayValueAsyncClient() { + return new ModelWithUnwrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedWrappedModelArrayValueAsyncClient buildModelWithRenamedWrappedModelArrayValueAsyncClient() { + return new ModelWithRenamedWrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedWrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedUnwrappedModelArrayValueAsyncClient + buildModelWithRenamedUnwrappedModelArrayValueAsyncClient() { + return new ModelWithRenamedUnwrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient + buildModelWithRenamedWrappedAndItemModelArrayValueAsyncClient() { + return new ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedWrappedAndItemModelArrayValues()); + } + + /** + * Builds an instance of ModelWithAttributesValueAsyncClient class. + * + * @return an instance of ModelWithAttributesValueAsyncClient. + */ + @Generated + public ModelWithAttributesValueAsyncClient buildModelWithAttributesValueAsyncClient() { + return new ModelWithAttributesValueAsyncClient(buildInnerClient().getModelWithAttributesValues()); + } + + /** + * Builds an instance of ModelWithRenamedAttributeValueAsyncClient class. + * + * @return an instance of ModelWithRenamedAttributeValueAsyncClient. + */ + @Generated + public ModelWithRenamedAttributeValueAsyncClient buildModelWithRenamedAttributeValueAsyncClient() { + return new ModelWithRenamedAttributeValueAsyncClient(buildInnerClient().getModelWithRenamedAttributeValues()); + } + + /** + * Builds an instance of ModelWithNamespaceValueAsyncClient class. + * + * @return an instance of ModelWithNamespaceValueAsyncClient. + */ + @Generated + public ModelWithNamespaceValueAsyncClient buildModelWithNamespaceValueAsyncClient() { + return new ModelWithNamespaceValueAsyncClient(buildInnerClient().getModelWithNamespaceValues()); + } + + /** + * Builds an instance of ModelWithNamespaceOnPropertiesValueAsyncClient class. + * + * @return an instance of ModelWithNamespaceOnPropertiesValueAsyncClient. + */ + @Generated + public ModelWithNamespaceOnPropertiesValueAsyncClient buildModelWithNamespaceOnPropertiesValueAsyncClient() { + return new ModelWithNamespaceOnPropertiesValueAsyncClient( + buildInnerClient().getModelWithNamespaceOnPropertiesValues()); + } + + /** + * Builds an instance of ModelWithTextValueAsyncClient class. + * + * @return an instance of ModelWithTextValueAsyncClient. + */ + @Generated + public ModelWithTextValueAsyncClient buildModelWithTextValueAsyncClient() { + return new ModelWithTextValueAsyncClient(buildInnerClient().getModelWithTextValues()); + } + + /** + * Builds an instance of ModelWithOptionalFieldValueAsyncClient class. + * + * @return an instance of ModelWithOptionalFieldValueAsyncClient. + */ + @Generated + public ModelWithOptionalFieldValueAsyncClient buildModelWithOptionalFieldValueAsyncClient() { + return new ModelWithOptionalFieldValueAsyncClient(buildInnerClient().getModelWithOptionalFieldValues()); + } + + /** + * Builds an instance of ModelWithEmptyArrayValueAsyncClient class. + * + * @return an instance of ModelWithEmptyArrayValueAsyncClient. + */ + @Generated + public ModelWithEmptyArrayValueAsyncClient buildModelWithEmptyArrayValueAsyncClient() { + return new ModelWithEmptyArrayValueAsyncClient(buildInnerClient().getModelWithEmptyArrayValues()); + } + + /** + * Builds an instance of ModelWithDictionaryValueAsyncClient class. + * + * @return an instance of ModelWithDictionaryValueAsyncClient. + */ + @Generated + public ModelWithDictionaryValueAsyncClient buildModelWithDictionaryValueAsyncClient() { + return new ModelWithDictionaryValueAsyncClient(buildInnerClient().getModelWithDictionaryValues()); + } + + /** + * Builds an instance of ModelWithEncodedNamesValueAsyncClient class. + * + * @return an instance of ModelWithEncodedNamesValueAsyncClient. + */ + @Generated + public ModelWithEncodedNamesValueAsyncClient buildModelWithEncodedNamesValueAsyncClient() { + return new ModelWithEncodedNamesValueAsyncClient(buildInnerClient().getModelWithEncodedNamesValues()); + } + + /** + * Builds an instance of ModelWithEnumValueAsyncClient class. + * + * @return an instance of ModelWithEnumValueAsyncClient. + */ + @Generated + public ModelWithEnumValueAsyncClient buildModelWithEnumValueAsyncClient() { + return new ModelWithEnumValueAsyncClient(buildInnerClient().getModelWithEnumValues()); + } + + /** + * Builds an instance of ModelWithDatetimeValueAsyncClient class. + * + * @return an instance of ModelWithDatetimeValueAsyncClient. + */ + @Generated + public ModelWithDatetimeValueAsyncClient buildModelWithDatetimeValueAsyncClient() { + return new ModelWithDatetimeValueAsyncClient(buildInnerClient().getModelWithDatetimeValues()); + } + + /** + * Builds an instance of XmlErrorValueAsyncClient class. + * + * @return an instance of XmlErrorValueAsyncClient. + */ + @Generated + public XmlErrorValueAsyncClient buildXmlErrorValueAsyncClient() { + return new XmlErrorValueAsyncClient(buildInnerClient().getXmlErrorValues()); + } + + /** + * Builds an instance of SimpleModelValueClient class. + * + * @return an instance of SimpleModelValueClient. + */ + @Generated + public SimpleModelValueClient buildSimpleModelValueClient() { + return new SimpleModelValueClient(buildInnerClient().getSimpleModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedPropertyValueClient class. + * + * @return an instance of ModelWithRenamedPropertyValueClient. + */ + @Generated + public ModelWithRenamedPropertyValueClient buildModelWithRenamedPropertyValueClient() { + return new ModelWithRenamedPropertyValueClient(buildInnerClient().getModelWithRenamedPropertyValues()); + } + + /** + * Builds an instance of ModelWithRenamedFieldsValueClient class. + * + * @return an instance of ModelWithRenamedFieldsValueClient. + */ + @Generated + public ModelWithRenamedFieldsValueClient buildModelWithRenamedFieldsValueClient() { + return new ModelWithRenamedFieldsValueClient(buildInnerClient().getModelWithRenamedFieldsValues()); + } + + /** + * Builds an instance of ModelWithNestedModelValueClient class. + * + * @return an instance of ModelWithNestedModelValueClient. + */ + @Generated + public ModelWithNestedModelValueClient buildModelWithNestedModelValueClient() { + return new ModelWithNestedModelValueClient(buildInnerClient().getModelWithNestedModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedNestedModelValueClient class. + * + * @return an instance of ModelWithRenamedNestedModelValueClient. + */ + @Generated + public ModelWithRenamedNestedModelValueClient buildModelWithRenamedNestedModelValueClient() { + return new ModelWithRenamedNestedModelValueClient(buildInnerClient().getModelWithRenamedNestedModelValues()); + } + + /** + * Builds an instance of ModelWithSimpleArraysValueClient class. + * + * @return an instance of ModelWithSimpleArraysValueClient. + */ + @Generated + public ModelWithSimpleArraysValueClient buildModelWithSimpleArraysValueClient() { + return new ModelWithSimpleArraysValueClient(buildInnerClient().getModelWithSimpleArraysValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedArrayValueClient class. + * + * @return an instance of ModelWithUnwrappedArrayValueClient. + */ + @Generated + public ModelWithUnwrappedArrayValueClient buildModelWithUnwrappedArrayValueClient() { + return new ModelWithUnwrappedArrayValueClient(buildInnerClient().getModelWithUnwrappedArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedArraysValueClient class. + * + * @return an instance of ModelWithRenamedArraysValueClient. + */ + @Generated + public ModelWithRenamedArraysValueClient buildModelWithRenamedArraysValueClient() { + return new ModelWithRenamedArraysValueClient(buildInnerClient().getModelWithRenamedArraysValues()); + } + + /** + * Builds an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient class. + * + * @return an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNamesValueClient + buildModelWithWrappedPrimitiveCustomItemNamesValueClient() { + return new ModelWithWrappedPrimitiveCustomItemNamesValueClient( + buildInnerClient().getModelWithWrappedPrimitiveCustomItemNamesValues()); + } + + /** + * Builds an instance of ModelWithArrayOfModelValueClient class. + * + * @return an instance of ModelWithArrayOfModelValueClient. + */ + @Generated + public ModelWithArrayOfModelValueClient buildModelWithArrayOfModelValueClient() { + return new ModelWithArrayOfModelValueClient(buildInnerClient().getModelWithArrayOfModelValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedModelArrayValueClient class. + * + * @return an instance of ModelWithUnwrappedModelArrayValueClient. + */ + @Generated + public ModelWithUnwrappedModelArrayValueClient buildModelWithUnwrappedModelArrayValueClient() { + return new ModelWithUnwrappedModelArrayValueClient(buildInnerClient().getModelWithUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedWrappedModelArrayValueClient. + */ + @Generated + public ModelWithRenamedWrappedModelArrayValueClient buildModelWithRenamedWrappedModelArrayValueClient() { + return new ModelWithRenamedWrappedModelArrayValueClient( + buildInnerClient().getModelWithRenamedWrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedUnwrappedModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedUnwrappedModelArrayValueClient. + */ + @Generated + public ModelWithRenamedUnwrappedModelArrayValueClient buildModelWithRenamedUnwrappedModelArrayValueClient() { + return new ModelWithRenamedUnwrappedModelArrayValueClient( + buildInnerClient().getModelWithRenamedUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArrayValueClient + buildModelWithRenamedWrappedAndItemModelArrayValueClient() { + return new ModelWithRenamedWrappedAndItemModelArrayValueClient( + buildInnerClient().getModelWithRenamedWrappedAndItemModelArrayValues()); + } + + /** + * Builds an instance of ModelWithAttributesValueClient class. + * + * @return an instance of ModelWithAttributesValueClient. + */ + @Generated + public ModelWithAttributesValueClient buildModelWithAttributesValueClient() { + return new ModelWithAttributesValueClient(buildInnerClient().getModelWithAttributesValues()); + } + + /** + * Builds an instance of ModelWithRenamedAttributeValueClient class. + * + * @return an instance of ModelWithRenamedAttributeValueClient. + */ + @Generated + public ModelWithRenamedAttributeValueClient buildModelWithRenamedAttributeValueClient() { + return new ModelWithRenamedAttributeValueClient(buildInnerClient().getModelWithRenamedAttributeValues()); + } + + /** + * Builds an instance of ModelWithNamespaceValueClient class. + * + * @return an instance of ModelWithNamespaceValueClient. + */ + @Generated + public ModelWithNamespaceValueClient buildModelWithNamespaceValueClient() { + return new ModelWithNamespaceValueClient(buildInnerClient().getModelWithNamespaceValues()); + } + + /** + * Builds an instance of ModelWithNamespaceOnPropertiesValueClient class. + * + * @return an instance of ModelWithNamespaceOnPropertiesValueClient. + */ + @Generated + public ModelWithNamespaceOnPropertiesValueClient buildModelWithNamespaceOnPropertiesValueClient() { + return new ModelWithNamespaceOnPropertiesValueClient( + buildInnerClient().getModelWithNamespaceOnPropertiesValues()); + } + + /** + * Builds an instance of ModelWithTextValueClient class. + * + * @return an instance of ModelWithTextValueClient. + */ + @Generated + public ModelWithTextValueClient buildModelWithTextValueClient() { + return new ModelWithTextValueClient(buildInnerClient().getModelWithTextValues()); + } + + /** + * Builds an instance of ModelWithOptionalFieldValueClient class. + * + * @return an instance of ModelWithOptionalFieldValueClient. + */ + @Generated + public ModelWithOptionalFieldValueClient buildModelWithOptionalFieldValueClient() { + return new ModelWithOptionalFieldValueClient(buildInnerClient().getModelWithOptionalFieldValues()); + } + + /** + * Builds an instance of ModelWithEmptyArrayValueClient class. + * + * @return an instance of ModelWithEmptyArrayValueClient. + */ + @Generated + public ModelWithEmptyArrayValueClient buildModelWithEmptyArrayValueClient() { + return new ModelWithEmptyArrayValueClient(buildInnerClient().getModelWithEmptyArrayValues()); + } + + /** + * Builds an instance of ModelWithDictionaryValueClient class. + * + * @return an instance of ModelWithDictionaryValueClient. + */ + @Generated + public ModelWithDictionaryValueClient buildModelWithDictionaryValueClient() { + return new ModelWithDictionaryValueClient(buildInnerClient().getModelWithDictionaryValues()); + } + + /** + * Builds an instance of ModelWithEncodedNamesValueClient class. + * + * @return an instance of ModelWithEncodedNamesValueClient. + */ + @Generated + public ModelWithEncodedNamesValueClient buildModelWithEncodedNamesValueClient() { + return new ModelWithEncodedNamesValueClient(buildInnerClient().getModelWithEncodedNamesValues()); + } + + /** + * Builds an instance of ModelWithEnumValueClient class. + * + * @return an instance of ModelWithEnumValueClient. + */ + @Generated + public ModelWithEnumValueClient buildModelWithEnumValueClient() { + return new ModelWithEnumValueClient(buildInnerClient().getModelWithEnumValues()); + } + + /** + * Builds an instance of ModelWithDatetimeValueClient class. + * + * @return an instance of ModelWithDatetimeValueClient. + */ + @Generated + public ModelWithDatetimeValueClient buildModelWithDatetimeValueClient() { + return new ModelWithDatetimeValueClient(buildInnerClient().getModelWithDatetimeValues()); + } + + /** + * Builds an instance of XmlErrorValueClient class. + * + * @return an instance of XmlErrorValueClient. + */ + @Generated + public XmlErrorValueClient buildXmlErrorValueClient() { + return new XmlErrorValueClient(buildInnerClient().getXmlErrorValues()); + } + + private static final ClientLogger LOGGER = new ClientLogger(XmlClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java new file mode 100644 index 00000000000..106d45740f2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.models.SimpleModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class XmlErrorValueAsyncClient { + @Generated + private final XmlErrorValuesImpl serviceClient; + + /** + * Initializes an instance of XmlErrorValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + XmlErrorValueAsyncClient(XmlErrorValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java new file mode 100644 index 00000000000..199e73344de --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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 payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.models.SimpleModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class XmlErrorValueClient { + @Generated + private final XmlErrorValuesImpl serviceClient; + + /** + * Initializes an instance of XmlErrorValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + XmlErrorValueClient(XmlErrorValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public SimpleModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java new file mode 100644 index 00000000000..25fb8840bca --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.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 payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithArrayOfModelValues. + */ +public final class ModelWithArrayOfModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithArrayOfModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithArrayOfModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithArrayOfModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithArrayOfModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithArrayOfModelValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithArrayOfModelValues") + public interface ModelWithArrayOfModelValuesService { + @Get("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.1 — Contains an array of models along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.1 — Contains an array of models along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java new file mode 100644 index 00000000000..9179deb03db --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithAttributesValues. + */ +public final class ModelWithAttributesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithAttributesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithAttributesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithAttributesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithAttributesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithAttributesValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithAttributesValues") + public interface ModelWithAttributesValuesService { + @Get("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.1 — Contains fields that are XML attributes along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.1 — Contains fields that are XML attributes along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java new file mode 100644 index 00000000000..efcb2723116 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithDatetimeValues. + */ +public final class ModelWithDatetimeValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithDatetimeValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithDatetimeValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithDatetimeValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithDatetimeValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithDatetimeValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithDatetimeValues") + public interface ModelWithDatetimeValuesService { + @Get("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains datetime properties with different encodings along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains datetime properties with different encodings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java new file mode 100644 index 00000000000..9badecf1983 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithDictionaryValues. + */ +public final class ModelWithDictionaryValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithDictionaryValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithDictionaryValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithDictionaryValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithDictionaryValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithDictionaryValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithDictionaryValues") + public interface ModelWithDictionaryValuesService { + @Get("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 contains a dictionary of key value pairs along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 contains a dictionary of key value pairs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java new file mode 100644 index 00000000000..b718e492aba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithEmptyArrayValues. + */ +public final class ModelWithEmptyArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEmptyArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEmptyArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEmptyArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEmptyArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEmptyArrayValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEmptyArrayValues") + public interface ModelWithEmptyArrayValuesService { + @Get("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java new file mode 100644 index 00000000000..7632f29359c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithEncodedNamesValues. + */ +public final class ModelWithEncodedNamesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEncodedNamesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEncodedNamesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEncodedNamesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEncodedNamesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEncodedNamesValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEncodedNamesValues") + public interface ModelWithEncodedNamesValuesService { + @Get("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java new file mode 100644 index 00000000000..519cadc6cbc --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithEnumValues. + */ +public final class ModelWithEnumValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEnumValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEnumValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEnumValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEnumValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEnumValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEnumValues") + public interface ModelWithEnumValuesService { + @Get("/payload/xml/modelWithEnum") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEnum") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEnum") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEnum") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains a single property with an enum value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @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 contains a single property with an enum value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java new file mode 100644 index 00000000000..b4071042553 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.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 payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithNamespaceOnPropertiesValues. + */ +public final class ModelWithNamespaceOnPropertiesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNamespaceOnPropertiesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNamespaceOnPropertiesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNamespaceOnPropertiesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNamespaceOnPropertiesValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNamespaceOnPropertiesValues") + public interface ModelWithNamespaceOnPropertiesValuesService { + @Get("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java new file mode 100644 index 00000000000..883a9aa16a4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithNamespaceValues. + */ +public final class ModelWithNamespaceValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNamespaceValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNamespaceValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNamespaceValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNamespaceValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNamespaceValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNamespaceValues") + public interface ModelWithNamespaceValuesService { + @Get("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java new file mode 100644 index 00000000000..e268ba5a383 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithNestedModelValues. + */ +public final class ModelWithNestedModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNestedModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNestedModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNestedModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNestedModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNestedModelValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNestedModelValues") + public interface ModelWithNestedModelValuesService { + @Get("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.1 — Contains a property that references another model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.1 — Contains a property that references another model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java new file mode 100644 index 00000000000..c92669917ba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithOptionalFieldValues. + */ +public final class ModelWithOptionalFieldValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithOptionalFieldValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithOptionalFieldValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithOptionalFieldValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithOptionalFieldValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithOptionalFieldValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithOptionalFieldValues") + public interface ModelWithOptionalFieldValuesService { + @Get("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @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 contains an optional field along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @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 contains an optional field along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java new file mode 100644 index 00000000000..d385e242bfd --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedArraysValues. + */ +public final class ModelWithRenamedArraysValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedArraysValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedArraysValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedArraysValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedArraysValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedArraysValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedArraysValues") + public interface ModelWithRenamedArraysValuesService { + @Get("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java new file mode 100644 index 00000000000..584f5ede3a8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedAttributeValues. + */ +public final class ModelWithRenamedAttributeValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedAttributeValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedAttributeValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedAttributeValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedAttributeValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedAttributeValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedAttributeValues") + public interface ModelWithRenamedAttributeValuesService { + @Get("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.2 — Contains a renamed XML attribute along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §5.2 — Contains a renamed XML attribute along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java new file mode 100644 index 00000000000..0e03e2846e8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedFieldsValues. + */ +public final class ModelWithRenamedFieldsValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedFieldsValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedFieldsValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedFieldsValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedFieldsValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedFieldsValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedFieldsValues") + public interface ModelWithRenamedFieldsValuesService { + @Get("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java new file mode 100644 index 00000000000..d9f80b9e44d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedNestedModelValues. + */ +public final class ModelWithRenamedNestedModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedNestedModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedNestedModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedNestedModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedNestedModelValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedNestedModelValues") + public interface ModelWithRenamedNestedModelValuesService { + @Get("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.2 — Contains a property whose type has along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 §2.2 — Contains a property whose type has along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java new file mode 100644 index 00000000000..96d7a28d586 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedPropertyValues. + */ +public final class ModelWithRenamedPropertyValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedPropertyValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedPropertyValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedPropertyValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedPropertyValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedPropertyValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedPropertyValues") + public interface ModelWithRenamedPropertyValuesService { + @Get("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..c04789a86ae --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedUnwrappedModelArrayValues. + */ +public final class ModelWithRenamedUnwrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedUnwrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedUnwrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedUnwrappedModelArrayValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedUnwrappedModelArrayValues to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedUnwrappedModelArrayValues") + public interface ModelWithRenamedUnwrappedModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java new file mode 100644 index 00000000000..a7c9f36b2d9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 + * ModelWithRenamedWrappedAndItemModelArrayValues. + */ +public final class ModelWithRenamedWrappedAndItemModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedWrappedAndItemModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedWrappedAndItemModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedWrappedAndItemModelArrayValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedWrappedAndItemModelArrayValues to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedWrappedAndItemModelArrayValues") + public interface ModelWithRenamedWrappedAndItemModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..4cc47a6fb03 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithRenamedWrappedModelArrayValues. + */ +public final class ModelWithRenamedWrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedWrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedWrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedWrappedModelArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedWrappedModelArrayValues to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedWrappedModelArrayValues") + public interface ModelWithRenamedWrappedModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java new file mode 100644 index 00000000000..b9ebe06e11e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithSimpleArraysValues. + */ +public final class ModelWithSimpleArraysValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithSimpleArraysValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithSimpleArraysValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithSimpleArraysValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithSimpleArraysValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithSimpleArraysValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithSimpleArraysValues") + public interface ModelWithSimpleArraysValuesService { + @Get("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.1 — Contains fields of arrays of primitive types along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.1 — Contains fields of arrays of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java new file mode 100644 index 00000000000..95af58d7dab --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithTextValues. + */ +public final class ModelWithTextValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithTextValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithTextValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithTextValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithTextValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithTextValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithTextValues") + public interface ModelWithTextValuesService { + @Get("/payload/xml/modelWithText") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithText") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithText") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithText") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §8.1 — Contains an attribute and text along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @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 §8.1 — Contains an attribute and text along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java new file mode 100644 index 00000000000..b4b5a36f89d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithUnwrappedArrayValues. + */ +public final class ModelWithUnwrappedArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithUnwrappedArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithUnwrappedArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithUnwrappedArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithUnwrappedArrayValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithUnwrappedArrayValues") + public interface ModelWithUnwrappedArrayValuesService { + @Get("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..6916e345448 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 ModelWithUnwrappedModelArrayValues. + */ +public final class ModelWithUnwrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithUnwrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithUnwrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithUnwrappedModelArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithUnwrappedModelArrayValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithUnwrappedModelArrayValues") + public interface ModelWithUnwrappedModelArrayValuesService { + @Get("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.2 — Contains an unwrapped array of models along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §4.2 — Contains an unwrapped array of models along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java new file mode 100644 index 00000000000..6e75b937e9d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.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 payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 + * ModelWithWrappedPrimitiveCustomItemNamesValues. + */ +public final class ModelWithWrappedPrimitiveCustomItemNamesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithWrappedPrimitiveCustomItemNamesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithWrappedPrimitiveCustomItemNamesValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithWrappedPrimitiveCustomItemNamesValues to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithWrappedPrimitiveCustomItemNamesValues") + public interface ModelWithWrappedPrimitiveCustomItemNamesValuesService { + @Get("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java new file mode 100644 index 00000000000..c7118dac973 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +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 SimpleModelValues. + */ +public final class SimpleModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final SimpleModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of SimpleModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SimpleModelValuesImpl(XmlClientImpl client) { + this.service + = RestProxy.create(SimpleModelValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientSimpleModelValues to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientSimpleModelValues") + public interface SimpleModelValuesService { + @Get("/payload/xml/simpleModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/simpleModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/simpleModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/simpleModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input 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 putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java new file mode 100644 index 00000000000..8cb3afa3c6b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +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.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the XmlClient type. + */ +public final class XmlClientImpl { + /** + * 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 SimpleModelValuesImpl object to access its operations. + */ + private final SimpleModelValuesImpl simpleModelValues; + + /** + * Gets the SimpleModelValuesImpl object to access its operations. + * + * @return the SimpleModelValuesImpl object. + */ + public SimpleModelValuesImpl getSimpleModelValues() { + return this.simpleModelValues; + } + + /** + * The ModelWithRenamedPropertyValuesImpl object to access its operations. + */ + private final ModelWithRenamedPropertyValuesImpl modelWithRenamedPropertyValues; + + /** + * Gets the ModelWithRenamedPropertyValuesImpl object to access its operations. + * + * @return the ModelWithRenamedPropertyValuesImpl object. + */ + public ModelWithRenamedPropertyValuesImpl getModelWithRenamedPropertyValues() { + return this.modelWithRenamedPropertyValues; + } + + /** + * The ModelWithRenamedFieldsValuesImpl object to access its operations. + */ + private final ModelWithRenamedFieldsValuesImpl modelWithRenamedFieldsValues; + + /** + * Gets the ModelWithRenamedFieldsValuesImpl object to access its operations. + * + * @return the ModelWithRenamedFieldsValuesImpl object. + */ + public ModelWithRenamedFieldsValuesImpl getModelWithRenamedFieldsValues() { + return this.modelWithRenamedFieldsValues; + } + + /** + * The ModelWithNestedModelValuesImpl object to access its operations. + */ + private final ModelWithNestedModelValuesImpl modelWithNestedModelValues; + + /** + * Gets the ModelWithNestedModelValuesImpl object to access its operations. + * + * @return the ModelWithNestedModelValuesImpl object. + */ + public ModelWithNestedModelValuesImpl getModelWithNestedModelValues() { + return this.modelWithNestedModelValues; + } + + /** + * The ModelWithRenamedNestedModelValuesImpl object to access its operations. + */ + private final ModelWithRenamedNestedModelValuesImpl modelWithRenamedNestedModelValues; + + /** + * Gets the ModelWithRenamedNestedModelValuesImpl object to access its operations. + * + * @return the ModelWithRenamedNestedModelValuesImpl object. + */ + public ModelWithRenamedNestedModelValuesImpl getModelWithRenamedNestedModelValues() { + return this.modelWithRenamedNestedModelValues; + } + + /** + * The ModelWithSimpleArraysValuesImpl object to access its operations. + */ + private final ModelWithSimpleArraysValuesImpl modelWithSimpleArraysValues; + + /** + * Gets the ModelWithSimpleArraysValuesImpl object to access its operations. + * + * @return the ModelWithSimpleArraysValuesImpl object. + */ + public ModelWithSimpleArraysValuesImpl getModelWithSimpleArraysValues() { + return this.modelWithSimpleArraysValues; + } + + /** + * The ModelWithUnwrappedArrayValuesImpl object to access its operations. + */ + private final ModelWithUnwrappedArrayValuesImpl modelWithUnwrappedArrayValues; + + /** + * Gets the ModelWithUnwrappedArrayValuesImpl object to access its operations. + * + * @return the ModelWithUnwrappedArrayValuesImpl object. + */ + public ModelWithUnwrappedArrayValuesImpl getModelWithUnwrappedArrayValues() { + return this.modelWithUnwrappedArrayValues; + } + + /** + * The ModelWithRenamedArraysValuesImpl object to access its operations. + */ + private final ModelWithRenamedArraysValuesImpl modelWithRenamedArraysValues; + + /** + * Gets the ModelWithRenamedArraysValuesImpl object to access its operations. + * + * @return the ModelWithRenamedArraysValuesImpl object. + */ + public ModelWithRenamedArraysValuesImpl getModelWithRenamedArraysValues() { + return this.modelWithRenamedArraysValues; + } + + /** + * The ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object to access its operations. + */ + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl modelWithWrappedPrimitiveCustomItemNamesValues; + + /** + * Gets the ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object to access its operations. + * + * @return the ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object. + */ + public ModelWithWrappedPrimitiveCustomItemNamesValuesImpl getModelWithWrappedPrimitiveCustomItemNamesValues() { + return this.modelWithWrappedPrimitiveCustomItemNamesValues; + } + + /** + * The ModelWithArrayOfModelValuesImpl object to access its operations. + */ + private final ModelWithArrayOfModelValuesImpl modelWithArrayOfModelValues; + + /** + * Gets the ModelWithArrayOfModelValuesImpl object to access its operations. + * + * @return the ModelWithArrayOfModelValuesImpl object. + */ + public ModelWithArrayOfModelValuesImpl getModelWithArrayOfModelValues() { + return this.modelWithArrayOfModelValues; + } + + /** + * The ModelWithUnwrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithUnwrappedModelArrayValuesImpl modelWithUnwrappedModelArrayValues; + + /** + * Gets the ModelWithUnwrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithUnwrappedModelArrayValuesImpl object. + */ + public ModelWithUnwrappedModelArrayValuesImpl getModelWithUnwrappedModelArrayValues() { + return this.modelWithUnwrappedModelArrayValues; + } + + /** + * The ModelWithRenamedWrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedWrappedModelArrayValuesImpl modelWithRenamedWrappedModelArrayValues; + + /** + * Gets the ModelWithRenamedWrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedWrappedModelArrayValuesImpl object. + */ + public ModelWithRenamedWrappedModelArrayValuesImpl getModelWithRenamedWrappedModelArrayValues() { + return this.modelWithRenamedWrappedModelArrayValues; + } + + /** + * The ModelWithRenamedUnwrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedUnwrappedModelArrayValuesImpl modelWithRenamedUnwrappedModelArrayValues; + + /** + * Gets the ModelWithRenamedUnwrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedUnwrappedModelArrayValuesImpl object. + */ + public ModelWithRenamedUnwrappedModelArrayValuesImpl getModelWithRenamedUnwrappedModelArrayValues() { + return this.modelWithRenamedUnwrappedModelArrayValues; + } + + /** + * The ModelWithRenamedWrappedAndItemModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl modelWithRenamedWrappedAndItemModelArrayValues; + + /** + * Gets the ModelWithRenamedWrappedAndItemModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedWrappedAndItemModelArrayValuesImpl object. + */ + public ModelWithRenamedWrappedAndItemModelArrayValuesImpl getModelWithRenamedWrappedAndItemModelArrayValues() { + return this.modelWithRenamedWrappedAndItemModelArrayValues; + } + + /** + * The ModelWithAttributesValuesImpl object to access its operations. + */ + private final ModelWithAttributesValuesImpl modelWithAttributesValues; + + /** + * Gets the ModelWithAttributesValuesImpl object to access its operations. + * + * @return the ModelWithAttributesValuesImpl object. + */ + public ModelWithAttributesValuesImpl getModelWithAttributesValues() { + return this.modelWithAttributesValues; + } + + /** + * The ModelWithRenamedAttributeValuesImpl object to access its operations. + */ + private final ModelWithRenamedAttributeValuesImpl modelWithRenamedAttributeValues; + + /** + * Gets the ModelWithRenamedAttributeValuesImpl object to access its operations. + * + * @return the ModelWithRenamedAttributeValuesImpl object. + */ + public ModelWithRenamedAttributeValuesImpl getModelWithRenamedAttributeValues() { + return this.modelWithRenamedAttributeValues; + } + + /** + * The ModelWithNamespaceValuesImpl object to access its operations. + */ + private final ModelWithNamespaceValuesImpl modelWithNamespaceValues; + + /** + * Gets the ModelWithNamespaceValuesImpl object to access its operations. + * + * @return the ModelWithNamespaceValuesImpl object. + */ + public ModelWithNamespaceValuesImpl getModelWithNamespaceValues() { + return this.modelWithNamespaceValues; + } + + /** + * The ModelWithNamespaceOnPropertiesValuesImpl object to access its operations. + */ + private final ModelWithNamespaceOnPropertiesValuesImpl modelWithNamespaceOnPropertiesValues; + + /** + * Gets the ModelWithNamespaceOnPropertiesValuesImpl object to access its operations. + * + * @return the ModelWithNamespaceOnPropertiesValuesImpl object. + */ + public ModelWithNamespaceOnPropertiesValuesImpl getModelWithNamespaceOnPropertiesValues() { + return this.modelWithNamespaceOnPropertiesValues; + } + + /** + * The ModelWithTextValuesImpl object to access its operations. + */ + private final ModelWithTextValuesImpl modelWithTextValues; + + /** + * Gets the ModelWithTextValuesImpl object to access its operations. + * + * @return the ModelWithTextValuesImpl object. + */ + public ModelWithTextValuesImpl getModelWithTextValues() { + return this.modelWithTextValues; + } + + /** + * The ModelWithOptionalFieldValuesImpl object to access its operations. + */ + private final ModelWithOptionalFieldValuesImpl modelWithOptionalFieldValues; + + /** + * Gets the ModelWithOptionalFieldValuesImpl object to access its operations. + * + * @return the ModelWithOptionalFieldValuesImpl object. + */ + public ModelWithOptionalFieldValuesImpl getModelWithOptionalFieldValues() { + return this.modelWithOptionalFieldValues; + } + + /** + * The ModelWithEmptyArrayValuesImpl object to access its operations. + */ + private final ModelWithEmptyArrayValuesImpl modelWithEmptyArrayValues; + + /** + * Gets the ModelWithEmptyArrayValuesImpl object to access its operations. + * + * @return the ModelWithEmptyArrayValuesImpl object. + */ + public ModelWithEmptyArrayValuesImpl getModelWithEmptyArrayValues() { + return this.modelWithEmptyArrayValues; + } + + /** + * The ModelWithDictionaryValuesImpl object to access its operations. + */ + private final ModelWithDictionaryValuesImpl modelWithDictionaryValues; + + /** + * Gets the ModelWithDictionaryValuesImpl object to access its operations. + * + * @return the ModelWithDictionaryValuesImpl object. + */ + public ModelWithDictionaryValuesImpl getModelWithDictionaryValues() { + return this.modelWithDictionaryValues; + } + + /** + * The ModelWithEncodedNamesValuesImpl object to access its operations. + */ + private final ModelWithEncodedNamesValuesImpl modelWithEncodedNamesValues; + + /** + * Gets the ModelWithEncodedNamesValuesImpl object to access its operations. + * + * @return the ModelWithEncodedNamesValuesImpl object. + */ + public ModelWithEncodedNamesValuesImpl getModelWithEncodedNamesValues() { + return this.modelWithEncodedNamesValues; + } + + /** + * The ModelWithEnumValuesImpl object to access its operations. + */ + private final ModelWithEnumValuesImpl modelWithEnumValues; + + /** + * Gets the ModelWithEnumValuesImpl object to access its operations. + * + * @return the ModelWithEnumValuesImpl object. + */ + public ModelWithEnumValuesImpl getModelWithEnumValues() { + return this.modelWithEnumValues; + } + + /** + * The ModelWithDatetimeValuesImpl object to access its operations. + */ + private final ModelWithDatetimeValuesImpl modelWithDatetimeValues; + + /** + * Gets the ModelWithDatetimeValuesImpl object to access its operations. + * + * @return the ModelWithDatetimeValuesImpl object. + */ + public ModelWithDatetimeValuesImpl getModelWithDatetimeValues() { + return this.modelWithDatetimeValues; + } + + /** + * The XmlErrorValuesImpl object to access its operations. + */ + private final XmlErrorValuesImpl xmlErrorValues; + + /** + * Gets the XmlErrorValuesImpl object to access its operations. + * + * @return the XmlErrorValuesImpl object. + */ + public XmlErrorValuesImpl getXmlErrorValues() { + return this.xmlErrorValues; + } + + /** + * Initializes an instance of XmlClient client. + * + * @param endpoint Service host. + */ + public XmlClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of XmlClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + */ + public XmlClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of XmlClient 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 XmlClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.simpleModelValues = new SimpleModelValuesImpl(this); + this.modelWithRenamedPropertyValues = new ModelWithRenamedPropertyValuesImpl(this); + this.modelWithRenamedFieldsValues = new ModelWithRenamedFieldsValuesImpl(this); + this.modelWithNestedModelValues = new ModelWithNestedModelValuesImpl(this); + this.modelWithRenamedNestedModelValues = new ModelWithRenamedNestedModelValuesImpl(this); + this.modelWithSimpleArraysValues = new ModelWithSimpleArraysValuesImpl(this); + this.modelWithUnwrappedArrayValues = new ModelWithUnwrappedArrayValuesImpl(this); + this.modelWithRenamedArraysValues = new ModelWithRenamedArraysValuesImpl(this); + this.modelWithWrappedPrimitiveCustomItemNamesValues + = new ModelWithWrappedPrimitiveCustomItemNamesValuesImpl(this); + this.modelWithArrayOfModelValues = new ModelWithArrayOfModelValuesImpl(this); + this.modelWithUnwrappedModelArrayValues = new ModelWithUnwrappedModelArrayValuesImpl(this); + this.modelWithRenamedWrappedModelArrayValues = new ModelWithRenamedWrappedModelArrayValuesImpl(this); + this.modelWithRenamedUnwrappedModelArrayValues = new ModelWithRenamedUnwrappedModelArrayValuesImpl(this); + this.modelWithRenamedWrappedAndItemModelArrayValues + = new ModelWithRenamedWrappedAndItemModelArrayValuesImpl(this); + this.modelWithAttributesValues = new ModelWithAttributesValuesImpl(this); + this.modelWithRenamedAttributeValues = new ModelWithRenamedAttributeValuesImpl(this); + this.modelWithNamespaceValues = new ModelWithNamespaceValuesImpl(this); + this.modelWithNamespaceOnPropertiesValues = new ModelWithNamespaceOnPropertiesValuesImpl(this); + this.modelWithTextValues = new ModelWithTextValuesImpl(this); + this.modelWithOptionalFieldValues = new ModelWithOptionalFieldValuesImpl(this); + this.modelWithEmptyArrayValues = new ModelWithEmptyArrayValuesImpl(this); + this.modelWithDictionaryValues = new ModelWithDictionaryValuesImpl(this); + this.modelWithEncodedNamesValues = new ModelWithEncodedNamesValuesImpl(this); + this.modelWithEnumValues = new ModelWithEnumValuesImpl(this); + this.modelWithDatetimeValues = new ModelWithDatetimeValuesImpl(this); + this.xmlErrorValues = new XmlErrorValuesImpl(this); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java new file mode 100644 index 00000000000..7afe99f802f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.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 XmlErrorValues. + */ +public final class XmlErrorValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final XmlErrorValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of XmlErrorValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + XmlErrorValuesImpl(XmlClientImpl client) { + this.service + = RestProxy.create(XmlErrorValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientXmlErrorValues to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientXmlErrorValues") + public interface XmlErrorValuesService { + @Get("/payload/xml/error") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/error") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java new file mode 100644 index 00000000000..01798e3cbc8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/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 Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java new file mode 100644 index 00000000000..10501b0d4a4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Author model with a custom XML name. + */ +@Immutable +public final class Author implements XmlSerializable { + /* + * The name property. + */ + @Generated + private final String name; + + /** + * Creates an instance of Author class. + * + * @param name the name value to set. + */ + @Generated + public Author(String name) { + this.name = name; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "XmlAuthor" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("name", this.name); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of Author from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of Author if the XmlReader was pointing to an instance of it, or null if it was pointing to + * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Author. + */ + @Generated + public static Author fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of Author from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of Author if the XmlReader was pointing to an instance of it, or null if it was pointing to + * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Author. + */ + @Generated + public static Author fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "XmlAuthor" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String name = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("name".equals(elementName.getLocalPart())) { + name = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new Author(name); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java new file mode 100644 index 00000000000..67db0bf1c81 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Book model with a custom XML name. + */ +@Immutable +public final class Book implements XmlSerializable { + /* + * The title property. + */ + @Generated + private final String title; + + /** + * Creates an instance of Book class. + * + * @param title the title value to set. + */ + @Generated + public Book(String title) { + this.title = title; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "XmlBook" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("title", this.title); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of Book from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of Book if the XmlReader was pointing to an instance of it, or null if it was pointing to XML + * null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Book. + */ + @Generated + public static Book fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of Book from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of Book if the XmlReader was pointing to an instance of it, or null if it was pointing to XML + * null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Book. + */ + @Generated + public static Book fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "XmlBook" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new Book(title); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java new file mode 100644 index 00000000000..b704fe56ec2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.1 — Contains an array of models. + */ +@Immutable +public final class ModelWithArrayOfModel implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithArrayOfModel class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithArrayOfModel(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithArrayOfModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("items"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithArrayOfModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithArrayOfModel if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithArrayOfModel. + */ + @Generated + public static ModelWithArrayOfModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithArrayOfModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithArrayOfModel if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithArrayOfModel. + */ + @Generated + public static ModelWithArrayOfModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithArrayOfModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithArrayOfModel(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java new file mode 100644 index 00000000000..9c138a93a50 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §5.1 — Contains fields that are XML attributes. + */ +@Immutable +public final class ModelWithAttributes implements XmlSerializable { + /* + * The id1 property. + */ + @Generated + private final int id1; + + /* + * The id2 property. + */ + @Generated + private final String id2; + + /* + * The enabled property. + */ + @Generated + private final boolean enabled; + + /** + * Creates an instance of ModelWithAttributes class. + * + * @param id1 the id1 value to set. + * @param id2 the id2 value to set. + * @param enabled the enabled value to set. + */ + @Generated + public ModelWithAttributes(int id1, String id2, boolean enabled) { + this.id1 = id1; + this.id2 = id2; + this.enabled = enabled; + } + + /** + * Get the id1 property: The id1 property. + * + * @return the id1 value. + */ + @Generated + public int getId1() { + return this.id1; + } + + /** + * Get the id2 property: The id2 property. + * + * @return the id2 value. + */ + @Generated + public String getId2() { + return this.id2; + } + + /** + * Get the enabled property: The enabled property. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithAttributes" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeIntAttribute("id1", this.id1); + xmlWriter.writeStringAttribute("id2", this.id2); + xmlWriter.writeBooleanElement("enabled", this.enabled); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithAttributes from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithAttributes if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithAttributes. + */ + @Generated + public static ModelWithAttributes fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithAttributes from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithAttributes if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithAttributes. + */ + @Generated + public static ModelWithAttributes fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithAttributes" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + boolean enabled = false; + int id1 = reader.getIntAttribute(null, "id1"); + String id2 = reader.getStringAttribute(null, "id2"); + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("enabled".equals(elementName.getLocalPart())) { + enabled = reader.getBooleanElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithAttributes(id1, id2, enabled); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java new file mode 100644 index 00000000000..9d668e28050 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains datetime properties with different encodings. + */ +@Immutable +public final class ModelWithDatetime implements XmlSerializable { + /* + * DateTime value with rfc3339 encoding. + */ + @Generated + private final OffsetDateTime rfc3339; + + /* + * DateTime value with rfc7231 encoding. + */ + @Generated + private final DateTimeRfc1123 rfc7231; + + /** + * Creates an instance of ModelWithDatetime class. + * + * @param rfc3339 the rfc3339 value to set. + * @param rfc7231 the rfc7231 value to set. + */ + @Generated + public ModelWithDatetime(OffsetDateTime rfc3339, OffsetDateTime rfc7231) { + this.rfc3339 = rfc3339; + if (rfc7231 == null) { + this.rfc7231 = null; + } else { + this.rfc7231 = new DateTimeRfc1123(rfc7231); + } + } + + /** + * Get the rfc3339 property: DateTime value with rfc3339 encoding. + * + * @return the rfc3339 value. + */ + @Generated + public OffsetDateTime getRfc3339() { + return this.rfc3339; + } + + /** + * Get the rfc7231 property: DateTime value with rfc7231 encoding. + * + * @return the rfc7231 value. + */ + @Generated + public OffsetDateTime getRfc7231() { + if (this.rfc7231 == null) { + return null; + } + return this.rfc7231.getDateTime(); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDatetime" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("rfc3339", + this.rfc3339 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.rfc3339)); + xmlWriter.writeStringElement("rfc7231", Objects.toString(this.rfc7231, null)); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithDatetime from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithDatetime if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDatetime. + */ + @Generated + public static ModelWithDatetime fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithDatetime from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithDatetime if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDatetime. + */ + @Generated + public static ModelWithDatetime fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDatetime" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + OffsetDateTime rfc3339 = null; + OffsetDateTime rfc7231 = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("rfc3339".equals(elementName.getLocalPart())) { + rfc3339 = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); + } else if ("rfc7231".equals(elementName.getLocalPart())) { + DateTimeRfc1123 rfc7231Holder = reader.getNullableElement(DateTimeRfc1123::new); + if (rfc7231Holder != null) { + rfc7231 = rfc7231Holder.getDateTime(); + } + } else { + reader.skipElement(); + } + } + return new ModelWithDatetime(rfc3339, rfc7231); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java new file mode 100644 index 00000000000..10a30294918 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains a dictionary of key value pairs. + */ +@Immutable +public final class ModelWithDictionary implements XmlSerializable { + /* + * The metadata property. + */ + @Generated + private final Map metadata; + + /** + * Creates an instance of ModelWithDictionary class. + * + * @param metadata the metadata value to set. + */ + @Generated + public ModelWithDictionary(Map metadata) { + this.metadata = metadata; + } + + /** + * Get the metadata property: The metadata property. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDictionary" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.metadata != null) { + xmlWriter.writeStartElement("metadata"); + for (Map.Entry entry : this.metadata.entrySet()) { + xmlWriter.writeStringElement(entry.getKey(), entry.getValue()); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithDictionary from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithDictionary if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDictionary. + */ + @Generated + public static ModelWithDictionary fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithDictionary from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithDictionary if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDictionary. + */ + @Generated + public static ModelWithDictionary fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDictionary" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Map metadata = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("metadata".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + if (metadata == null) { + metadata = new LinkedHashMap<>(); + } + metadata.put(reader.getElementName().getLocalPart(), reader.getStringElement()); + } + } else { + reader.skipElement(); + } + } + return new ModelWithDictionary(metadata); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java new file mode 100644 index 00000000000..6bcda4230e3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains an array of models that's supposed to be sent/received as an empty XML element. + */ +@Immutable +public final class ModelWithEmptyArray implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithEmptyArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithEmptyArray(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEmptyArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("items"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEmptyArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEmptyArray if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEmptyArray. + */ + @Generated + public static ModelWithEmptyArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEmptyArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEmptyArray if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEmptyArray. + */ + @Generated + public static ModelWithEmptyArray fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEmptyArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithEmptyArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java new file mode 100644 index 00000000000..f291aec6929 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Uses encodedName instead of Xml.Name which is functionally equivalent. + */ +@Immutable +public final class ModelWithEncodedNames implements XmlSerializable { + /* + * The SimpleModelData property. + */ + @Generated + private final SimpleModel modelData; + + /* + * The PossibleColors property. + */ + @Generated + private final List colors; + + /** + * Creates an instance of ModelWithEncodedNames class. + * + * @param modelData the modelData value to set. + * @param colors the colors value to set. + */ + @Generated + public ModelWithEncodedNames(SimpleModel modelData, List colors) { + this.modelData = modelData; + this.colors = colors; + } + + /** + * Get the modelData property: The SimpleModelData property. + * + * @return the modelData value. + */ + @Generated + public SimpleModel getModelData() { + return this.modelData; + } + + /** + * Get the colors property: The PossibleColors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + if (this.colors == null) { + return Collections.emptyList(); + } + return this.colors; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEncodedNamesSrc" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.modelData, "SimpleModelData"); + if (this.colors != null) { + xmlWriter.writeStartElement("PossibleColors"); + for (String element : this.colors) { + xmlWriter.writeStringElement("string", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEncodedNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEncodedNames if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEncodedNames. + */ + @Generated + public static ModelWithEncodedNames fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEncodedNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEncodedNames if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEncodedNames. + */ + @Generated + public static ModelWithEncodedNames fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEncodedNamesSrc" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel modelData = null; + List colors = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("SimpleModelData".equals(elementName.getLocalPart())) { + modelData = SimpleModel.fromXml(reader, "SimpleModelData"); + } else if ("PossibleColors".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("string".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithEncodedNames(modelData, colors); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java new file mode 100644 index 00000000000..552919e682d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains a single property with an enum value. + */ +@Immutable +public final class ModelWithEnum implements XmlSerializable { + /* + * The status property. + */ + @Generated + private final Status status; + + /** + * Creates an instance of ModelWithEnum class. + * + * @param status the status value to set. + */ + @Generated + public ModelWithEnum(Status status) { + this.status = status; + } + + /** + * Get the status property: The status property. + * + * @return the status value. + */ + @Generated + public Status getStatus() { + return this.status; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEnum" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("status", this.status == null ? null : this.status.toString()); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEnum from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEnum if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEnum. + */ + @Generated + public static ModelWithEnum fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEnum from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEnum if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEnum. + */ + @Generated + public static ModelWithEnum fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEnum" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Status status = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("status".equals(elementName.getLocalPart())) { + status = Status.fromString(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + return new ModelWithEnum(status); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java new file mode 100644 index 00000000000..94ce00a218f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §6.1, §7.1 — Contains fields with XML namespace on the model. + */ +@Immutable +public final class ModelWithNamespace implements XmlSerializable { + private static final String EXAMPLE_COM__SCHEMA = "http://example.com/schema"; + + /* + * The id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /** + * Creates an instance of ModelWithNamespace class. + * + * @param id the id value to set. + * @param title the title value to set. + */ + @Generated + public ModelWithNamespace(int id, String title) { + this.id = id; + this.title = title; + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespace" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeNamespace(EXAMPLE_COM__SCHEMA); + xmlWriter.writeIntElement("id", this.id); + xmlWriter.writeStringElement("title", this.title); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNamespace from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNamespace if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespace. + */ + @Generated + public static ModelWithNamespace fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNamespace from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNamespace if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespace. + */ + @Generated + public static ModelWithNamespace fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespace" : rootElementName; + return xmlReader.readObject(EXAMPLE_COM__SCHEMA, finalRootElementName, reader -> { + int id = 0; + String title = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("id".equals(elementName.getLocalPart())) { + id = reader.getIntElement(); + } else if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithNamespace(id, title); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java new file mode 100644 index 00000000000..8703b51c53b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §6.2, §7.2 — Contains fields with different XML namespaces on individual properties. + */ +@Immutable +public final class ModelWithNamespaceOnProperties implements XmlSerializable { + private static final String EXAMPLE_COM__SCHEMA = "http://example.com/schema"; + + private static final String EXAMPLE_COM__NS2 = "http://example.com/ns2"; + + /* + * The id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithNamespaceOnProperties class. + * + * @param id the id value to set. + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithNamespaceOnProperties(int id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespaceOnProperties" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeNamespace(EXAMPLE_COM__SCHEMA); + xmlWriter.writeNamespace("smp", EXAMPLE_COM__SCHEMA); + xmlWriter.writeNamespace("ns2", EXAMPLE_COM__NS2); + xmlWriter.writeIntElement("id", this.id); + xmlWriter.writeStringElement(EXAMPLE_COM__SCHEMA, "title", this.title); + xmlWriter.writeStringElement(EXAMPLE_COM__NS2, "author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNamespaceOnProperties from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNamespaceOnProperties if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespaceOnProperties. + */ + @Generated + public static ModelWithNamespaceOnProperties fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNamespaceOnProperties from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNamespaceOnProperties if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespaceOnProperties. + */ + @Generated + public static ModelWithNamespaceOnProperties fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespaceOnProperties" : rootElementName; + return xmlReader.readObject(EXAMPLE_COM__SCHEMA, finalRootElementName, reader -> { + int id = 0; + String title = null; + String author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("id".equals(elementName.getLocalPart())) { + id = reader.getIntElement(); + } else if ("title".equals(elementName.getLocalPart()) + && EXAMPLE_COM__SCHEMA.equals(elementName.getNamespaceURI())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart()) + && EXAMPLE_COM__NS2.equals(elementName.getNamespaceURI())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithNamespaceOnProperties(id, title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java new file mode 100644 index 00000000000..9bed9ec2d2d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §2.1 — Contains a property that references another model. + */ +@Immutable +public final class ModelWithNestedModel implements XmlSerializable { + /* + * The nested property. + */ + @Generated + private final SimpleModel nested; + + /** + * Creates an instance of ModelWithNestedModel class. + * + * @param nested the nested value to set. + */ + @Generated + public ModelWithNestedModel(SimpleModel nested) { + this.nested = nested; + } + + /** + * Get the nested property: The nested property. + * + * @return the nested value. + */ + @Generated + public SimpleModel getNested() { + return this.nested; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNestedModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.nested, "nested"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNestedModel if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNestedModel. + */ + @Generated + public static ModelWithNestedModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNestedModel if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNestedModel. + */ + @Generated + public static ModelWithNestedModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNestedModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel nested = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("nested".equals(elementName.getLocalPart())) { + nested = SimpleModel.fromXml(reader, "nested"); + } else { + reader.skipElement(); + } + } + return new ModelWithNestedModel(nested); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java new file mode 100644 index 00000000000..ee2a303a98d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains an optional field. + */ +@Fluent +public final class ModelWithOptionalField implements XmlSerializable { + /* + * The item property. + */ + @Generated + private final String item; + + /* + * The value property. + */ + @Generated + private Integer value; + + /** + * Creates an instance of ModelWithOptionalField class. + * + * @param item the item value to set. + */ + @Generated + public ModelWithOptionalField(String item) { + this.item = item; + } + + /** + * Get the item property: The item property. + * + * @return the item value. + */ + @Generated + public String getItem() { + return this.item; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Integer getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ModelWithOptionalField object itself. + */ + @Generated + public ModelWithOptionalField setValue(Integer value) { + this.value = value; + return this; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithOptionalField" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("item", this.item); + xmlWriter.writeNumberElement("value", this.value); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithOptionalField from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithOptionalField if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithOptionalField. + */ + @Generated + public static ModelWithOptionalField fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithOptionalField from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithOptionalField if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithOptionalField. + */ + @Generated + public static ModelWithOptionalField fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithOptionalField" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String item = null; + Integer value = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("item".equals(elementName.getLocalPart())) { + item = reader.getStringElement(); + } else if ("value".equals(elementName.getLocalPart())) { + value = reader.getNullableElement(Integer::parseInt); + } else { + reader.skipElement(); + } + } + ModelWithOptionalField deserializedModelWithOptionalField = new ModelWithOptionalField(item); + deserializedModelWithOptionalField.value = value; + + return deserializedModelWithOptionalField; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java new file mode 100644 index 00000000000..9763df0711c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations. + */ +@Immutable +public final class ModelWithRenamedArrays implements XmlSerializable { + /* + * The Colors property. + */ + @Generated + private final List colors; + + /* + * The Counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithRenamedArrays class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithRenamedArrays(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The Colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + return this.colors; + } + + /** + * Get the counts property: The Counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedArrays" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + for (String element : this.colors) { + xmlWriter.writeStringElement("Colors", element); + } + } + if (this.counts != null) { + xmlWriter.writeStartElement("Counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedArrays. + */ + @Generated + public static ModelWithRenamedArrays fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedArrays. + */ + @Generated + public static ModelWithRenamedArrays fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedArrays" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("Colors".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else if ("Counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedArrays(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java new file mode 100644 index 00000000000..8dc41c76ef0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §5.2 — Contains a renamed XML attribute. + */ +@Immutable +public final class ModelWithRenamedAttribute implements XmlSerializable { + /* + * The xml-id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithRenamedAttribute class. + * + * @param id the id value to set. + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedAttribute(int id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Get the id property: The xml-id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedAttribute" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeIntAttribute("xml-id", this.id); + xmlWriter.writeStringElement("title", this.title); + xmlWriter.writeStringElement("author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedAttribute from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedAttribute if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedAttribute. + */ + @Generated + public static ModelWithRenamedAttribute fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedAttribute from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedAttribute if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedAttribute. + */ + @Generated + public static ModelWithRenamedAttribute fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedAttribute" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + String author = null; + int id = reader.getIntAttribute(null, "xml-id"); + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedAttribute(id, title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java new file mode 100644 index 00000000000..af2ea3211ce --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.3, §2.3 — Contains fields of the same type that have different XML representation. + */ +@Immutable +public final class ModelWithRenamedFields implements XmlSerializable { + /* + * The InputData property. + */ + @Generated + private final SimpleModel inputData; + + /* + * The OutputData property. + */ + @Generated + private final SimpleModel outputData; + + /** + * Creates an instance of ModelWithRenamedFields class. + * + * @param inputData the inputData value to set. + * @param outputData the outputData value to set. + */ + @Generated + public ModelWithRenamedFields(SimpleModel inputData, SimpleModel outputData) { + this.inputData = inputData; + this.outputData = outputData; + } + + /** + * Get the inputData property: The InputData property. + * + * @return the inputData value. + */ + @Generated + public SimpleModel getInputData() { + return this.inputData; + } + + /** + * Get the outputData property: The OutputData property. + * + * @return the outputData value. + */ + @Generated + public SimpleModel getOutputData() { + return this.outputData; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedFieldsSrc" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.inputData, "InputData"); + xmlWriter.writeXml(this.outputData, "OutputData"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedFields from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedFields if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedFields. + */ + @Generated + public static ModelWithRenamedFields fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedFields from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedFields if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedFields. + */ + @Generated + public static ModelWithRenamedFields fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedFieldsSrc" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel inputData = null; + SimpleModel outputData = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("InputData".equals(elementName.getLocalPart())) { + inputData = SimpleModel.fromXml(reader, "InputData"); + } else if ("OutputData".equals(elementName.getLocalPart())) { + outputData = SimpleModel.fromXml(reader, "OutputData"); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedFields(inputData, outputData); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java new file mode 100644 index 00000000000..a0547db93c3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §2.2 — Contains a property whose type has. + */ +@Immutable +public final class ModelWithRenamedNestedModel implements XmlSerializable { + /* + * The author property. + */ + @Generated + private final Author author; + + /** + * Creates an instance of ModelWithRenamedNestedModel class. + * + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedNestedModel(Author author) { + this.author = author; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public Author getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedNestedModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.author, "author"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedNestedModel if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedNestedModel. + */ + @Generated + public static ModelWithRenamedNestedModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedNestedModel if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedNestedModel. + */ + @Generated + public static ModelWithRenamedNestedModel fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedNestedModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Author author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("author".equals(elementName.getLocalPart())) { + author = Author.fromXml(reader, "author"); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedNestedModel(author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java new file mode 100644 index 00000000000..1f2b4fe0751 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.2 — Contains a scalar property with a custom XML name. + */ +@Immutable +public final class ModelWithRenamedProperty implements XmlSerializable { + /* + * The renamedTitle property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithRenamedProperty class. + * + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedProperty(String title, String author) { + this.title = title; + this.author = author; + } + + /** + * Get the title property: The renamedTitle property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedProperty" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("renamedTitle", this.title); + xmlWriter.writeStringElement("author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedProperty from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedProperty if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedProperty. + */ + @Generated + public static ModelWithRenamedProperty fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedProperty from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedProperty if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedProperty. + */ + @Generated + public static ModelWithRenamedProperty fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedProperty" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + String author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("renamedTitle".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedProperty(title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java new file mode 100644 index 00000000000..9d8e72c78cf --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.4 — Contains an unwrapped array of models with a custom item name. + */ +@Immutable +public final class ModelWithRenamedUnwrappedModelArray implements XmlSerializable { + /* + * The ModelItem property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithRenamedUnwrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithRenamedUnwrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The ModelItem property. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedUnwrappedModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "ModelItem"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedUnwrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedUnwrappedModelArray. + */ + @Generated + public static ModelWithRenamedUnwrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedUnwrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedUnwrappedModelArray. + */ + @Generated + public static ModelWithRenamedUnwrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedUnwrappedModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("ModelItem".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "ModelItem")); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedUnwrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java new file mode 100644 index 00000000000..a312125463c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.5 — Contains a wrapped array of models with custom wrapper and item names. + */ +@Immutable +public final class ModelWithRenamedWrappedAndItemModelArray + implements XmlSerializable { + /* + * The AllBooks property. + */ + @Generated + private final List books; + + /** + * Creates an instance of ModelWithRenamedWrappedAndItemModelArray class. + * + * @param books the books value to set. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArray(List books) { + this.books = books; + } + + /** + * Get the books property: The AllBooks property. + * + * @return the books value. + */ + @Generated + public List getBooks() { + if (this.books == null) { + return Collections.emptyList(); + } + return this.books; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedAndItemModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.books != null) { + xmlWriter.writeStartElement("AllBooks"); + for (Book element : this.books) { + xmlWriter.writeXml(element, "XmlBook"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedWrappedAndItemModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedWrappedAndItemModelArray if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedAndItemModelArray. + */ + @Generated + public static ModelWithRenamedWrappedAndItemModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedWrappedAndItemModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedWrappedAndItemModelArray if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedAndItemModelArray. + */ + @Generated + public static ModelWithRenamedWrappedAndItemModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedAndItemModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List books = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("AllBooks".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("XmlBook".equals(elementName.getLocalPart())) { + if (books == null) { + books = new ArrayList<>(); + } + books.add(Book.fromXml(reader, "XmlBook")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedWrappedAndItemModelArray(books); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java new file mode 100644 index 00000000000..911f9c9f6c4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.3 — Contains a wrapped array of models with a custom wrapper name. + */ +@Immutable +public final class ModelWithRenamedWrappedModelArray implements XmlSerializable { + /* + * The AllItems property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithRenamedWrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithRenamedWrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The AllItems property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("AllItems"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedWrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedWrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedModelArray. + */ + @Generated + public static ModelWithRenamedWrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedWrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedWrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedModelArray. + */ + @Generated + public static ModelWithRenamedWrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("AllItems".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedWrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java new file mode 100644 index 00000000000..c9af743ddee --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.1 — Contains fields of arrays of primitive types. + */ +@Immutable +public final class ModelWithSimpleArrays implements XmlSerializable { + /* + * The colors property. + */ + @Generated + private final List colors; + + /* + * The counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithSimpleArrays class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithSimpleArrays(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + if (this.colors == null) { + return Collections.emptyList(); + } + return this.colors; + } + + /** + * Get the counts property: The counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithSimpleArrays" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + xmlWriter.writeStartElement("colors"); + for (String element : this.colors) { + xmlWriter.writeStringElement("string", element); + } + xmlWriter.writeEndElement(); + } + if (this.counts != null) { + xmlWriter.writeStartElement("counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithSimpleArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithSimpleArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithSimpleArrays. + */ + @Generated + public static ModelWithSimpleArrays fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithSimpleArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithSimpleArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithSimpleArrays. + */ + @Generated + public static ModelWithSimpleArrays fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithSimpleArrays" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("colors".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("string".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else if ("counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithSimpleArrays(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java new file mode 100644 index 00000000000..1872225f83d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import javax.xml.stream.XMLStreamException; + +/** + * §8.1 — Contains an attribute and text. + */ +@Immutable +public final class ModelWithText implements XmlSerializable { + /* + * The language property. + */ + @Generated + private final String language; + + /* + * The content property. + */ + @Generated + private final String content; + + /** + * Creates an instance of ModelWithText class. + * + * @param language the language value to set. + * @param content the content value to set. + */ + @Generated + public ModelWithText(String language, String content) { + this.language = language; + this.content = content; + } + + /** + * Get the language property: The language property. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Get the content property: The content property. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithText" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringAttribute("language", this.language); + xmlWriter.writeString(this.content); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithText from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithText if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithText. + */ + @Generated + public static ModelWithText fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithText from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithText if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithText. + */ + @Generated + public static ModelWithText fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithText" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String language = reader.getStringAttribute(null, "language"); + String content = reader.getStringElement(); + return new ModelWithText(language, content); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java new file mode 100644 index 00000000000..be68b0b5076 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types. + */ +@Immutable +public final class ModelWithUnwrappedArray implements XmlSerializable { + /* + * The colors property. + */ + @Generated + private final List colors; + + /* + * The counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithUnwrappedArray class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithUnwrappedArray(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + return this.colors; + } + + /** + * Get the counts property: The counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + for (String element : this.colors) { + xmlWriter.writeStringElement("colors", element); + } + } + if (this.counts != null) { + xmlWriter.writeStartElement("counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithUnwrappedArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithUnwrappedArray if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedArray. + */ + @Generated + public static ModelWithUnwrappedArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithUnwrappedArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithUnwrappedArray if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedArray. + */ + @Generated + public static ModelWithUnwrappedArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("colors".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else if ("counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithUnwrappedArray(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java new file mode 100644 index 00000000000..98f549f4216 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.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 payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.2 — Contains an unwrapped array of models. + */ +@Immutable +public final class ModelWithUnwrappedModelArray implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithUnwrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithUnwrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedModelArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "items"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithUnwrappedModelArray if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedModelArray. + */ + @Generated + public static ModelWithUnwrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithUnwrappedModelArray if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedModelArray. + */ + @Generated + public static ModelWithUnwrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedModelArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "items")); + } else { + reader.skipElement(); + } + } + return new ModelWithUnwrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java new file mode 100644 index 00000000000..2891d72589f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.5 — Contains a wrapped primitive array with custom wrapper and item names. + */ +@Immutable +public final class ModelWithWrappedPrimitiveCustomItemNames + implements XmlSerializable { + /* + * The ItemsTags property. + */ + @Generated + private final List tags; + + /** + * Creates an instance of ModelWithWrappedPrimitiveCustomItemNames class. + * + * @param tags the tags value to set. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNames(List tags) { + this.tags = tags; + } + + /** + * Get the tags property: The ItemsTags property. + * + * @return the tags value. + */ + @Generated + public List getTags() { + if (this.tags == null) { + return Collections.emptyList(); + } + return this.tags; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithWrappedPrimitiveCustomItemNames" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.tags != null) { + xmlWriter.writeStartElement("ItemsTags"); + for (String element : this.tags) { + xmlWriter.writeStringElement("ItemName", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithWrappedPrimitiveCustomItemNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithWrappedPrimitiveCustomItemNames if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithWrappedPrimitiveCustomItemNames. + */ + @Generated + public static ModelWithWrappedPrimitiveCustomItemNames fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithWrappedPrimitiveCustomItemNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithWrappedPrimitiveCustomItemNames if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithWrappedPrimitiveCustomItemNames. + */ + @Generated + public static ModelWithWrappedPrimitiveCustomItemNames fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithWrappedPrimitiveCustomItemNames" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List tags = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("ItemsTags".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("ItemName".equals(elementName.getLocalPart())) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithWrappedPrimitiveCustomItemNames(tags); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java new file mode 100644 index 00000000000..28c6c4db80c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.1 — Contains fields of primitive types. + */ +@Immutable +public final class SimpleModel implements XmlSerializable { + /* + * The name property. + */ + @Generated + private final String name; + + /* + * The age property. + */ + @Generated + private final int age; + + /** + * Creates an instance of SimpleModel class. + * + * @param name the name value to set. + * @param age the age value to set. + */ + @Generated + public SimpleModel(String name, int age) { + this.name = name; + this.age = age; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the age property: The age property. + * + * @return the age value. + */ + @Generated + public int getAge() { + return this.age; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SimpleModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("name", this.name); + xmlWriter.writeIntElement("age", this.age); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of SimpleModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of SimpleModel if the XmlReader was pointing to an instance of it, or null if it was pointing + * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SimpleModel. + */ + @Generated + public static SimpleModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of SimpleModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of SimpleModel if the XmlReader was pointing to an instance of it, or null if it was pointing + * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SimpleModel. + */ + @Generated + public static SimpleModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "SimpleModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String name = null; + int age = 0; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("name".equals(elementName.getLocalPart())) { + name = reader.getStringElement(); + } else if ("age".equals(elementName.getLocalPart())) { + age = reader.getIntElement(); + } else { + reader.skipElement(); + } + } + return new SimpleModel(name, age); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java new file mode 100644 index 00000000000..58df1c63742 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status values for the model with enum. + */ +public final class Status extends ExpandableStringEnum { + /** + * Pending status. + */ + @Generated + public static final Status PENDING = fromString("pending"); + + /** + * Success status. + */ + @Generated + public static final Status SUCCESS = fromString("success"); + + /** + * Error status. + */ + @Generated + public static final Status ERROR = fromString("error"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @Generated + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + @Generated + public static Collection values() { + return values(Status.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java new file mode 100644 index 00000000000..84cbf169271 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/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 data models for Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java new file mode 100644 index 00000000000..97e6da50516 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/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 Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java index 0db178e9812..50e1b4e254d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java @@ -31,7 +31,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -41,7 +41,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * 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. @@ -58,7 +58,7 @@ public Mono> primitiveWithResponse(String param, RequestOptions r /** * 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. @@ -75,7 +75,7 @@ public Mono> arrayWithResponse(List 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. @@ -92,7 +92,7 @@ public Mono> recordWithResponse(Map param, Reque /** * The model 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. @@ -109,7 +109,7 @@ public Mono> modelWithResponse(ExpandParameters param, RequestOpt /** * 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. @@ -129,7 +129,7 @@ public Mono primitive(String param) { /** * 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. @@ -149,7 +149,7 @@ public Mono array(List param) { /** * 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. @@ -169,7 +169,7 @@ public Mono record(Map param) { /** * The model operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java index 93fc57f51f5..44bdd1b9569 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java @@ -29,7 +29,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -39,7 +39,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * 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. @@ -56,7 +56,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * 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. @@ -73,7 +73,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * 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. @@ -90,7 +90,7 @@ public Response recordWithResponse(Map param, RequestOpti /** * The model 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. @@ -107,7 +107,7 @@ public Response modelWithResponse(ExpandParameters param, RequestOptions r /** * 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. @@ -126,7 +126,7 @@ public void primitive(String param) { /** * 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. @@ -145,7 +145,7 @@ public void array(List param) { /** * 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. @@ -164,7 +164,7 @@ public void record(Map param) { /** * The model operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java index 40267284f41..36c8031da86 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java @@ -45,7 +45,7 @@ public final class QueryParametersQueryExpansionExplodesImpl { /** * Initializes an instance of QueryParametersQueryExpansionExplodesImpl. - * + * * @param client the instance of the service client containing this operation class. */ QueryParametersQueryExpansionExplodesImpl(RoutesClientImpl client) { @@ -138,7 +138,7 @@ Response modelSync(@HostParam("endpoint") String endpoint, @QueryParam("pa /** * 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. @@ -155,7 +155,7 @@ public Mono> primitiveWithResponseAsync(String param, RequestOpti /** * 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. @@ -171,7 +171,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * 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. @@ -190,7 +190,7 @@ public Mono> arrayWithResponseAsync(List param, RequestOp /** * 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. @@ -208,7 +208,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * 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. @@ -225,7 +225,7 @@ public Mono> recordWithResponseAsync(Map param, /** * 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. @@ -241,7 +241,7 @@ public Response recordWithResponse(Map param, RequestOpti /** * The model 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. @@ -258,7 +258,7 @@ public Mono> modelWithResponseAsync(ExpandParameters param, Reque /** * The model 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index 42d47c981f5..def6bf62f56 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -25,7 +25,7 @@ public interface ChildResourcesInterfacesClient { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -40,7 +40,7 @@ Mono> getWithResponseAsync(String resourceGroupName /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -55,7 +55,7 @@ Mono getAsync(String resourceGroupName, String topLevelArmRe /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -71,7 +71,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -85,7 +85,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -102,7 +102,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -118,7 +118,7 @@ PollerFlux, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -134,7 +134,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -151,7 +151,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -167,7 +167,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -183,7 +183,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -200,7 +200,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -217,7 +217,7 @@ Mono> updateWithResponseAsync(String resourceGroupN /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -233,7 +233,7 @@ Mono updateAsync(String resourceGroupName, String topLevelAr /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -250,7 +250,7 @@ Response updateWithResponse(String resourceGroupName, String /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -266,7 +266,7 @@ ChildResourceInner update(String resourceGroupName, String topLevelArmResourceNa /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -281,7 +281,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -296,7 +296,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -311,7 +311,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -327,7 +327,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -341,7 +341,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -354,7 +354,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -368,7 +368,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -382,7 +382,7 @@ PagedFlux listByTopLevelArmResourceAsync(String resourceGrou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -396,7 +396,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroup /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -411,7 +411,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroup /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -426,7 +426,7 @@ Mono>> actionWithoutBodyWithResponseAsync(String resou /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -441,7 +441,7 @@ PollerFlux, Void> beginActionWithoutBodyAsync(String resourceGr /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -456,7 +456,7 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -472,7 +472,7 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -487,7 +487,7 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -500,7 +500,7 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java index ec7042e626e..035d05577de 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java @@ -23,7 +23,7 @@ public interface LroNoBodiesClient { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -38,7 +38,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -53,7 +53,7 @@ PollerFlux, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -68,7 +68,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -84,7 +84,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -99,7 +99,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String res /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -130,7 +130,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -143,7 +143,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,7 +157,7 @@ PollerFlux, ActionFinalResult> beginActionAsync(St /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -171,7 +171,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -186,7 +186,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -199,7 +199,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +212,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index afc61cdc14e..74d68c86378 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface TopLevelArmResourceInterfacesClient { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -54,7 +54,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -69,7 +69,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -82,7 +82,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -98,7 +98,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ PollerFlux, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -130,7 +130,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -147,7 +147,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -163,7 +163,7 @@ Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -178,7 +178,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -194,7 +194,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -210,7 +210,7 @@ Mono> updateWithResponseAsync(String resource /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -226,7 +226,7 @@ Mono updateAsync(String resourceGroupName, String topL /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -243,7 +243,7 @@ Response updateWithResponse(String resourceGroupName, /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -258,7 +258,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -271,7 +271,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -284,7 +284,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -297,7 +297,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -312,7 +312,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -325,7 +325,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,7 +337,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -350,7 +350,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource 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. @@ -362,7 +362,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource 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. @@ -374,7 +374,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource 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. @@ -387,7 +387,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -397,7 +397,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -407,7 +407,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -419,7 +419,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -432,7 +432,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -446,7 +446,7 @@ PollerFlux, ResultInner> beginActionAsync(String resourc /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -460,7 +460,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -475,7 +475,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -488,7 +488,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -501,7 +501,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -515,7 +515,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -528,7 +528,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,7 +541,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -556,7 +556,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index 2d0813ac890..2a1b8023152 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -58,7 +58,7 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI /** * Initializes an instance of ChildResourcesInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ChildResourcesInterfacesClientImpl(ArmClientImpl client) { @@ -219,7 +219,7 @@ Response listByTopLevelArmResourceNextSync( /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -241,7 +241,7 @@ public Mono> getWithResponseAsync(String resourceGr /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -259,7 +259,7 @@ public Mono getAsync(String resourceGroupName, String topLev /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -279,7 +279,7 @@ public Response getWithResponse(String resourceGroupName, St /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -295,7 +295,7 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -320,7 +320,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -342,7 +342,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -365,7 +365,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -387,7 +387,7 @@ public PollerFlux, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -408,7 +408,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -430,7 +430,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -449,7 +449,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, St /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -468,7 +468,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -488,7 +488,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -513,7 +513,7 @@ public Mono> updateWithResponseAsync(String resourc /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -532,7 +532,7 @@ public Mono updateAsync(String resourceGroupName, String top /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -555,7 +555,7 @@ public Response updateWithResponse(String resourceGroupName, /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -574,7 +574,7 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -593,7 +593,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -612,7 +612,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -631,7 +631,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -651,7 +651,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -670,7 +670,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -690,7 +690,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -707,7 +707,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -722,7 +722,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -763,7 +763,7 @@ private Mono> listByTopLevelArmResourceSingleP /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -781,7 +781,7 @@ public PagedFlux listByTopLevelArmResourceAsync(String resou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -802,7 +802,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -824,7 +824,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -842,7 +842,7 @@ public PagedIterable listByTopLevelArmResource(String resour /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -861,7 +861,7 @@ public PagedIterable listByTopLevelArmResource(String resour /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -882,7 +882,7 @@ public Mono>> actionWithoutBodyWithResponseAsync(Strin /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -901,7 +901,7 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -920,7 +920,7 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -940,7 +940,7 @@ public PollerFlux, Void> beginActionWithoutBodyAsync(String res /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -959,7 +959,7 @@ public SyncPoller, Void> beginActionWithoutBody(String resource /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -979,7 +979,7 @@ public SyncPoller, Void> beginActionWithoutBody(String resource /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -997,7 +997,7 @@ public Mono actionWithoutBodyAsync(String resourceGroupName, String topLev /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1012,7 +1012,7 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1029,7 +1029,7 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour /** * 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. @@ -1050,7 +1050,7 @@ private Mono> listByTopLevelArmResourceNextSin /** * 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. @@ -1068,7 +1068,7 @@ private PagedResponse listByTopLevelArmResourceNextSinglePag /** * 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java index 6c16d9e70ec..ec4d1b05aac 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java @@ -50,7 +50,7 @@ public final class LroNoBodiesClientImpl implements LroNoBodiesClient { /** * Initializes an instance of LroNoBodiesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroNoBodiesClientImpl(ArmClientImpl client) { @@ -111,7 +111,7 @@ Response actionSync(@HostParam("endpoint") String endpoint, /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -133,7 +133,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -153,7 +153,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -173,7 +173,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -193,7 +193,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -212,7 +212,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -233,7 +233,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -251,7 +251,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -268,7 +268,7 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -286,7 +286,7 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -306,7 +306,7 @@ public Mono>> actionWithResponseAsync(String resourceG /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -323,7 +323,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -342,7 +342,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -360,7 +360,7 @@ public PollerFlux, ActionFinalResult> beginActionA /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -378,7 +378,7 @@ public SyncPoller, ActionFinalResult> beginAction( /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -397,7 +397,7 @@ public SyncPoller, ActionFinalResult> beginAction( /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -413,7 +413,7 @@ public Mono actionAsync(String resourceGroupName, String reso /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -428,7 +428,7 @@ public ActionFinalResult action(String resourceGroupName, String resourceLroNoBo /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 2f8df3c431d..9afa8c34fe2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -59,7 +59,7 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr /** * Initializes an instance of TopLevelArmResourceInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TopLevelArmResourceInterfacesClientImpl(ArmClientImpl client) { @@ -262,7 +262,7 @@ Response listBySubscriptionNextSync( /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,7 +282,7 @@ public Mono> getByResourceGroupWithResponseAs /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,7 +299,7 @@ public Mono getByResourceGroupAsync(String resourceGro /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -318,7 +318,7 @@ public Response getByResourceGroupWithResponse(String /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -333,7 +333,7 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -357,7 +357,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -379,7 +379,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -402,7 +402,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -424,7 +424,7 @@ public PollerFlux, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -445,7 +445,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -467,7 +467,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -486,7 +486,7 @@ public Mono createOrUpdateAsync(String resourceGroupNa /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -503,7 +503,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -521,7 +521,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -545,7 +545,7 @@ public Mono> updateWithResponseAsync(String r /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -564,7 +564,7 @@ public Mono updateAsync(String resourceGroupName, Stri /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -587,7 +587,7 @@ public Response updateWithResponse(String resourceGrou /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -604,7 +604,7 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -623,7 +623,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -639,7 +639,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -657,7 +657,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -675,7 +675,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -691,7 +691,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -709,7 +709,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -725,7 +725,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName) { /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -754,7 +754,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con /** * List TopLevelArmResource 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. @@ -775,7 +775,7 @@ private Mono> listByResourceGroupSingleP /** * List TopLevelArmResource 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. @@ -790,7 +790,7 @@ public PagedFlux listByResourceGroupAsync(String resou /** * List TopLevelArmResource 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. @@ -808,7 +808,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource 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. @@ -828,7 +828,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource 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. @@ -843,7 +843,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource 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. @@ -859,7 +859,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation along with {@link PagedResponse} on successful @@ -878,7 +878,7 @@ private Mono> listSinglePageAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -891,7 +891,7 @@ public PagedFlux listAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation along with {@link PagedResponse}. @@ -907,7 +907,7 @@ private PagedResponse listSinglePage() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -925,7 +925,7 @@ private PagedResponse listSinglePage(Context context) /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -937,7 +937,7 @@ public PagedIterable list() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -952,7 +952,7 @@ public PagedIterable list(Context context) { /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -972,7 +972,7 @@ public Mono>> actionWithResponseAsync(String resourceG /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -989,7 +989,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1008,7 +1008,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1026,7 +1026,7 @@ public PollerFlux, ResultInner> beginActionAsync(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1044,7 +1044,7 @@ public SyncPoller, ResultInner> beginAction(String resou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1063,7 +1063,7 @@ public SyncPoller, ResultInner> beginAction(String resou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1079,7 +1079,7 @@ public Mono actionAsync(String resourceGroupName, String topLevelAr /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1094,7 +1094,7 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1110,7 +1110,7 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1130,7 +1130,7 @@ public Mono> publishXmlWithResponseAsync(String resourceGro /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1146,7 +1146,7 @@ public Mono publishXmlAsync(String resourceGroupName, String topLeve /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1165,7 +1165,7 @@ public Response publishXmlWithResponse(String resourceGroupName, Str /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1180,7 +1180,7 @@ public BinaryData publishXml(String resourceGroupName, String topLevelArmResourc /** * 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. @@ -1201,7 +1201,7 @@ private Mono> listByResourceGroupNextSin /** * 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. @@ -1219,7 +1219,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * 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. @@ -1239,7 +1239,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * 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. @@ -1260,7 +1260,7 @@ private Mono> listBySubscriptionNextSing /** * 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. @@ -1278,7 +1278,7 @@ private PagedResponse listBySubscriptionNextSinglePage /** * 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java index 1c3094c01ba..0e705f4e6bb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java @@ -16,77 +16,77 @@ public interface ChildResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: Provisioning State of Top Level Arm Resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.ChildResourceInner object. - * + * * @return the inner object. */ ChildResourceInner innerModel(); @@ -114,7 +114,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -122,7 +122,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -135,7 +135,7 @@ interface WithLocation { interface WithParentResource { /** * Specifies resourceGroupName, topLevelArmResourceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @return the next definition stage. @@ -150,14 +150,14 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ ChildResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -170,7 +170,7 @@ interface WithCreate extends DefinitionStages.WithTags { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -180,7 +180,7 @@ interface WithTags { /** * Begins update for the ChildResource resource. - * + * * @return the stage of resource update. */ ChildResource.Update update(); @@ -191,14 +191,14 @@ interface WithTags { interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ ChildResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -215,7 +215,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -225,14 +225,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ChildResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -240,7 +240,7 @@ interface WithTags { /** * The actionWithoutBody operation. - * + * * @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. */ @@ -248,7 +248,7 @@ interface WithTags { /** * The actionWithoutBody operation. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java index b444c4076b2..61b9bb2d56c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java @@ -14,7 +14,7 @@ public interface ChildResourcesInterfaces { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -29,7 +29,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -42,7 +42,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -54,7 +54,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -67,7 +67,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +79,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -93,7 +93,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -105,7 +105,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -119,7 +119,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -130,7 +130,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +142,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -152,7 +152,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,7 +163,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Begins definition for a new ChildResource resource. - * + * * @param name resource name. * @return the first stage of the new ChildResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java index 55c3b53818c..491876f952b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java @@ -12,7 +12,7 @@ public interface LroNoBodies { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -26,7 +26,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -41,7 +41,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -53,7 +53,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java index eb481f1e0d3..1e361be04f8 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java @@ -20,119 +20,119 @@ public interface TopLevelArmResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the configurationEndpoints property: Configuration Endpoints. - * + * * @return the configurationEndpoints value. */ List configurationEndpoints(); /** * Gets the userName property: The userName property. - * + * * @return the userName value. */ String userName(); /** * Gets the userNames property: The userNames property. - * + * * @return the userNames value. */ String userNames(); /** * Gets the accuserName property: The accuserName property. - * + * * @return the accuserName value. */ String accuserName(); /** * Gets the startTimeStamp property: The startTimeStamp property. - * + * * @return the startTimeStamp value. */ OffsetDateTime startTimeStamp(); /** * Gets the size property: The size property. - * + * * @return the size value. */ Float size(); /** * Gets the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.TopLevelArmResourceInner object. - * + * * @return the inner object. */ TopLevelArmResourceInner innerModel(); @@ -160,7 +160,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -168,7 +168,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -181,7 +181,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -196,14 +196,14 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse DefinitionStages.WithUserNames, DefinitionStages.WithAccuserName, DefinitionStages.WithStartTimeStamp { /** * Executes the create request. - * + * * @return the created resource. */ TopLevelArmResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -216,7 +216,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -229,7 +229,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -242,7 +242,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -255,7 +255,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -268,7 +268,7 @@ interface WithAccuserName { interface WithStartTimeStamp { /** * Specifies the startTimeStamp property: The startTimeStamp property.. - * + * * @param startTimeStamp The startTimeStamp property. * @return the next definition stage. */ @@ -278,7 +278,7 @@ interface WithStartTimeStamp { /** * Begins update for the TopLevelArmResource resource. - * + * * @return the stage of resource update. */ TopLevelArmResource.Update update(); @@ -290,14 +290,14 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithUserName, Updat UpdateStages.WithAccuserName { /** * Executes the update request. - * + * * @return the updated resource. */ TopLevelArmResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -314,7 +314,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -327,7 +327,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -340,7 +340,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -353,7 +353,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -363,14 +363,14 @@ interface WithAccuserName { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ TopLevelArmResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -378,7 +378,7 @@ interface WithAccuserName { /** * The action operation. - * + * * @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. @@ -387,7 +387,7 @@ interface WithAccuserName { /** * The action operation. - * + * * @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. @@ -398,7 +398,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. @@ -409,7 +409,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java index f47c8896bcb..2573e18decf 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -15,7 +15,7 @@ public interface TopLevelArmResourceInterfaces { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -29,7 +29,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +52,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -64,7 +64,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource 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. @@ -75,7 +75,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource 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. @@ -87,7 +87,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -96,7 +96,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -107,7 +107,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +119,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -132,7 +132,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -146,7 +146,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +158,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -169,7 +169,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +181,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -191,7 +191,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,7 +202,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Begins definition for a new TopLevelArmResource resource. - * + * * @param name resource name. * @return the first stage of the new TopLevelArmResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json new file mode 100644 index 00000000000..c0ab62300be --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json @@ -0,0 +1 @@ +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Payload.Xml","crossLanguageVersion":"5b03b60108c5","crossLanguageDefinitions":{"payload.xml.ModelWithArrayOfModelValueAsyncClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueAsyncClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithAttributesValueAsyncClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueAsyncClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithDatetimeValueAsyncClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueAsyncClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDictionaryValueAsyncClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueAsyncClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueAsyncClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueAsyncClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEnumValueAsyncClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueAsyncClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceValueAsyncClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNestedModelValueAsyncClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueAsyncClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueAsyncClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueAsyncClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueAsyncClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueAsyncClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueAsyncClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithTextValueAsyncClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueAsyncClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.SimpleModelValueAsyncClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueAsyncClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueAsyncClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.XmlClientBuilder":"Payload.Xml","payload.xml.XmlErrorValueAsyncClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueAsyncClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueAsyncClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.models.Author":"Payload.Xml.Author","payload.xml.models.Book":"Payload.Xml.Book","payload.xml.models.ModelWithArrayOfModel":"Payload.Xml.ModelWithArrayOfModel","payload.xml.models.ModelWithAttributes":"Payload.Xml.ModelWithAttributes","payload.xml.models.ModelWithDatetime":"Payload.Xml.ModelWithDatetime","payload.xml.models.ModelWithDictionary":"Payload.Xml.ModelWithDictionary","payload.xml.models.ModelWithEmptyArray":"Payload.Xml.ModelWithEmptyArray","payload.xml.models.ModelWithEncodedNames":"Payload.Xml.ModelWithEncodedNames","payload.xml.models.ModelWithEnum":"Payload.Xml.ModelWithEnum","payload.xml.models.ModelWithNamespace":"Payload.Xml.ModelWithNamespace","payload.xml.models.ModelWithNamespaceOnProperties":"Payload.Xml.ModelWithNamespaceOnProperties","payload.xml.models.ModelWithNestedModel":"Payload.Xml.ModelWithNestedModel","payload.xml.models.ModelWithOptionalField":"Payload.Xml.ModelWithOptionalField","payload.xml.models.ModelWithRenamedArrays":"Payload.Xml.ModelWithRenamedArrays","payload.xml.models.ModelWithRenamedAttribute":"Payload.Xml.ModelWithRenamedAttribute","payload.xml.models.ModelWithRenamedFields":"Payload.Xml.ModelWithRenamedFields","payload.xml.models.ModelWithRenamedNestedModel":"Payload.Xml.ModelWithRenamedNestedModel","payload.xml.models.ModelWithRenamedProperty":"Payload.Xml.ModelWithRenamedProperty","payload.xml.models.ModelWithRenamedUnwrappedModelArray":"Payload.Xml.ModelWithRenamedUnwrappedModelArray","payload.xml.models.ModelWithRenamedWrappedAndItemModelArray":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArray","payload.xml.models.ModelWithRenamedWrappedModelArray":"Payload.Xml.ModelWithRenamedWrappedModelArray","payload.xml.models.ModelWithSimpleArrays":"Payload.Xml.ModelWithSimpleArrays","payload.xml.models.ModelWithText":"Payload.Xml.ModelWithText","payload.xml.models.ModelWithUnwrappedArray":"Payload.Xml.ModelWithUnwrappedArray","payload.xml.models.ModelWithUnwrappedModelArray":"Payload.Xml.ModelWithUnwrappedModelArray","payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNames","payload.xml.models.SimpleModel":"Payload.Xml.SimpleModel","payload.xml.models.Status":"Payload.Xml.Status"},"generatedFiles":["src/main/java/module-info.java","src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java","src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java","src/main/java/payload/xml/ModelWithAttributesValueClient.java","src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java","src/main/java/payload/xml/ModelWithDatetimeValueClient.java","src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java","src/main/java/payload/xml/ModelWithDictionaryValueClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java","src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java","src/main/java/payload/xml/ModelWithEnumValueClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java","src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceValueClient.java","src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithNestedModelValueClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java","src/main/java/payload/xml/ModelWithTextValueAsyncClient.java","src/main/java/payload/xml/ModelWithTextValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java","src/main/java/payload/xml/SimpleModelValueAsyncClient.java","src/main/java/payload/xml/SimpleModelValueClient.java","src/main/java/payload/xml/XmlClientBuilder.java","src/main/java/payload/xml/XmlErrorValueAsyncClient.java","src/main/java/payload/xml/XmlErrorValueClient.java","src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java","src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java","src/main/java/payload/xml/implementation/XmlClientImpl.java","src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java","src/main/java/payload/xml/implementation/package-info.java","src/main/java/payload/xml/models/Author.java","src/main/java/payload/xml/models/Book.java","src/main/java/payload/xml/models/ModelWithArrayOfModel.java","src/main/java/payload/xml/models/ModelWithAttributes.java","src/main/java/payload/xml/models/ModelWithDatetime.java","src/main/java/payload/xml/models/ModelWithDictionary.java","src/main/java/payload/xml/models/ModelWithEmptyArray.java","src/main/java/payload/xml/models/ModelWithEncodedNames.java","src/main/java/payload/xml/models/ModelWithEnum.java","src/main/java/payload/xml/models/ModelWithNamespace.java","src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java","src/main/java/payload/xml/models/ModelWithNestedModel.java","src/main/java/payload/xml/models/ModelWithOptionalField.java","src/main/java/payload/xml/models/ModelWithRenamedArrays.java","src/main/java/payload/xml/models/ModelWithRenamedAttribute.java","src/main/java/payload/xml/models/ModelWithRenamedFields.java","src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java","src/main/java/payload/xml/models/ModelWithRenamedProperty.java","src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java","src/main/java/payload/xml/models/ModelWithSimpleArrays.java","src/main/java/payload/xml/models/ModelWithText.java","src/main/java/payload/xml/models/ModelWithUnwrappedArray.java","src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java","src/main/java/payload/xml/models/SimpleModel.java","src/main/java/payload/xml/models/Status.java","src/main/java/payload/xml/models/package-info.java","src/main/java/payload/xml/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json index 5617f0fdbaa..beaa0178c93 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{"TspTest.MultipleClientsSameVersion":"2023-06-01"},"crossLanguagePackageId":"TspTest.MultipleClientsSameVersion","crossLanguageVersion":"310aa2ab63d8","crossLanguageDefinitions":{"tsptest.multipleclientssameversion.AlphaAsyncClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClientBuilder":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.BetaAsyncClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaAsyncClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaAsyncClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClientBuilder":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.models.Resource":"TspTest.MultipleClientsSameVersion.Resource"},"generatedFiles":["src/main/java/module-info.java","src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java","src/main/java/tsptest/multipleclientssameversion/models/Resource.java","src/main/java/tsptest/multipleclientssameversion/models/package-info.java","src/main/java/tsptest/multipleclientssameversion/package-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{"TspTest.MultipleClientsSameVersion":"2023-06-01"},"crossLanguagePackageId":"TspTest.MultipleClientsSameVersion","crossLanguageVersion":"451a8a0d4aa0","crossLanguageDefinitions":{"tsptest.multipleclientssameversion.AlphaAsyncClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClientBuilder":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.BetaAsyncClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaAsyncClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaAsyncClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClientBuilder":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.models.Resource":"TspTest.MultipleClientsSameVersion.Resource"},"generatedFiles":["src/main/java/module-info.java","src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java","src/main/java/tsptest/multipleclientssameversion/models/Resource.java","src/main/java/tsptest/multipleclientssameversion/models/package-info.java","src/main/java/tsptest/multipleclientssameversion/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties new file mode 100644 index 00000000000..ca812989b4f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.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/payload/xml/generated/XmlClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java new file mode 100644 index 00000000000..573d808ba9b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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.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 payload.xml.ModelWithArrayOfModelValueClient; +import payload.xml.ModelWithAttributesValueClient; +import payload.xml.ModelWithDatetimeValueClient; +import payload.xml.ModelWithDictionaryValueClient; +import payload.xml.ModelWithEmptyArrayValueClient; +import payload.xml.ModelWithEncodedNamesValueClient; +import payload.xml.ModelWithEnumValueClient; +import payload.xml.ModelWithNamespaceOnPropertiesValueClient; +import payload.xml.ModelWithNamespaceValueClient; +import payload.xml.ModelWithNestedModelValueClient; +import payload.xml.ModelWithOptionalFieldValueClient; +import payload.xml.ModelWithRenamedArraysValueClient; +import payload.xml.ModelWithRenamedAttributeValueClient; +import payload.xml.ModelWithRenamedFieldsValueClient; +import payload.xml.ModelWithRenamedNestedModelValueClient; +import payload.xml.ModelWithRenamedPropertyValueClient; +import payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient; +import payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient; +import payload.xml.ModelWithRenamedWrappedModelArrayValueClient; +import payload.xml.ModelWithSimpleArraysValueClient; +import payload.xml.ModelWithTextValueClient; +import payload.xml.ModelWithUnwrappedArrayValueClient; +import payload.xml.ModelWithUnwrappedModelArrayValueClient; +import payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient; +import payload.xml.SimpleModelValueClient; +import payload.xml.XmlClientBuilder; +import payload.xml.XmlErrorValueClient; + +class XmlClientTestBase extends TestProxyTestBase { + protected SimpleModelValueClient simpleModelValueClient; + + protected ModelWithRenamedPropertyValueClient modelWithRenamedPropertyValueClient; + + protected ModelWithRenamedFieldsValueClient modelWithRenamedFieldsValueClient; + + protected ModelWithNestedModelValueClient modelWithNestedModelValueClient; + + protected ModelWithRenamedNestedModelValueClient modelWithRenamedNestedModelValueClient; + + protected ModelWithSimpleArraysValueClient modelWithSimpleArraysValueClient; + + protected ModelWithUnwrappedArrayValueClient modelWithUnwrappedArrayValueClient; + + protected ModelWithRenamedArraysValueClient modelWithRenamedArraysValueClient; + + protected ModelWithWrappedPrimitiveCustomItemNamesValueClient modelWithWrappedPrimitiveCustomItemNamesValueClient; + + protected ModelWithArrayOfModelValueClient modelWithArrayOfModelValueClient; + + protected ModelWithUnwrappedModelArrayValueClient modelWithUnwrappedModelArrayValueClient; + + protected ModelWithRenamedWrappedModelArrayValueClient modelWithRenamedWrappedModelArrayValueClient; + + protected ModelWithRenamedUnwrappedModelArrayValueClient modelWithRenamedUnwrappedModelArrayValueClient; + + protected ModelWithRenamedWrappedAndItemModelArrayValueClient modelWithRenamedWrappedAndItemModelArrayValueClient; + + protected ModelWithAttributesValueClient modelWithAttributesValueClient; + + protected ModelWithRenamedAttributeValueClient modelWithRenamedAttributeValueClient; + + protected ModelWithNamespaceValueClient modelWithNamespaceValueClient; + + protected ModelWithNamespaceOnPropertiesValueClient modelWithNamespaceOnPropertiesValueClient; + + protected ModelWithTextValueClient modelWithTextValueClient; + + protected ModelWithOptionalFieldValueClient modelWithOptionalFieldValueClient; + + protected ModelWithEmptyArrayValueClient modelWithEmptyArrayValueClient; + + protected ModelWithDictionaryValueClient modelWithDictionaryValueClient; + + protected ModelWithEncodedNamesValueClient modelWithEncodedNamesValueClient; + + protected ModelWithEnumValueClient modelWithEnumValueClient; + + protected ModelWithDatetimeValueClient modelWithDatetimeValueClient; + + protected XmlErrorValueClient xmlErrorValueClient; + + @Override + protected void beforeTest() { + XmlClientBuilder simpleModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + simpleModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + simpleModelValueClient = simpleModelValueClientbuilder.buildSimpleModelValueClient(); + + XmlClientBuilder modelWithRenamedPropertyValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedPropertyValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedPropertyValueClient + = modelWithRenamedPropertyValueClientbuilder.buildModelWithRenamedPropertyValueClient(); + + XmlClientBuilder modelWithRenamedFieldsValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedFieldsValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedFieldsValueClient + = modelWithRenamedFieldsValueClientbuilder.buildModelWithRenamedFieldsValueClient(); + + XmlClientBuilder modelWithNestedModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNestedModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNestedModelValueClient = modelWithNestedModelValueClientbuilder.buildModelWithNestedModelValueClient(); + + XmlClientBuilder modelWithRenamedNestedModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedNestedModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedNestedModelValueClient + = modelWithRenamedNestedModelValueClientbuilder.buildModelWithRenamedNestedModelValueClient(); + + XmlClientBuilder modelWithSimpleArraysValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithSimpleArraysValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithSimpleArraysValueClient + = modelWithSimpleArraysValueClientbuilder.buildModelWithSimpleArraysValueClient(); + + XmlClientBuilder modelWithUnwrappedArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithUnwrappedArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithUnwrappedArrayValueClient + = modelWithUnwrappedArrayValueClientbuilder.buildModelWithUnwrappedArrayValueClient(); + + XmlClientBuilder modelWithRenamedArraysValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedArraysValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedArraysValueClient + = modelWithRenamedArraysValueClientbuilder.buildModelWithRenamedArraysValueClient(); + + XmlClientBuilder modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithWrappedPrimitiveCustomItemNamesValueClient = modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder + .buildModelWithWrappedPrimitiveCustomItemNamesValueClient(); + + XmlClientBuilder modelWithArrayOfModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithArrayOfModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithArrayOfModelValueClient + = modelWithArrayOfModelValueClientbuilder.buildModelWithArrayOfModelValueClient(); + + XmlClientBuilder modelWithUnwrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithUnwrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithUnwrappedModelArrayValueClient + = modelWithUnwrappedModelArrayValueClientbuilder.buildModelWithUnwrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedWrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedWrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedWrappedModelArrayValueClient + = modelWithRenamedWrappedModelArrayValueClientbuilder.buildModelWithRenamedWrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedUnwrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedUnwrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedUnwrappedModelArrayValueClient = modelWithRenamedUnwrappedModelArrayValueClientbuilder + .buildModelWithRenamedUnwrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedWrappedAndItemModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedWrappedAndItemModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedWrappedAndItemModelArrayValueClient = modelWithRenamedWrappedAndItemModelArrayValueClientbuilder + .buildModelWithRenamedWrappedAndItemModelArrayValueClient(); + + XmlClientBuilder modelWithAttributesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithAttributesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithAttributesValueClient = modelWithAttributesValueClientbuilder.buildModelWithAttributesValueClient(); + + XmlClientBuilder modelWithRenamedAttributeValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedAttributeValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedAttributeValueClient + = modelWithRenamedAttributeValueClientbuilder.buildModelWithRenamedAttributeValueClient(); + + XmlClientBuilder modelWithNamespaceValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNamespaceValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNamespaceValueClient = modelWithNamespaceValueClientbuilder.buildModelWithNamespaceValueClient(); + + XmlClientBuilder modelWithNamespaceOnPropertiesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNamespaceOnPropertiesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNamespaceOnPropertiesValueClient + = modelWithNamespaceOnPropertiesValueClientbuilder.buildModelWithNamespaceOnPropertiesValueClient(); + + XmlClientBuilder modelWithTextValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithTextValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithTextValueClient = modelWithTextValueClientbuilder.buildModelWithTextValueClient(); + + XmlClientBuilder modelWithOptionalFieldValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithOptionalFieldValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithOptionalFieldValueClient + = modelWithOptionalFieldValueClientbuilder.buildModelWithOptionalFieldValueClient(); + + XmlClientBuilder modelWithEmptyArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEmptyArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEmptyArrayValueClient = modelWithEmptyArrayValueClientbuilder.buildModelWithEmptyArrayValueClient(); + + XmlClientBuilder modelWithDictionaryValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithDictionaryValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithDictionaryValueClient = modelWithDictionaryValueClientbuilder.buildModelWithDictionaryValueClient(); + + XmlClientBuilder modelWithEncodedNamesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEncodedNamesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEncodedNamesValueClient + = modelWithEncodedNamesValueClientbuilder.buildModelWithEncodedNamesValueClient(); + + XmlClientBuilder modelWithEnumValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEnumValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEnumValueClient = modelWithEnumValueClientbuilder.buildModelWithEnumValueClient(); + + XmlClientBuilder modelWithDatetimeValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithDatetimeValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithDatetimeValueClient = modelWithDatetimeValueClientbuilder.buildModelWithDatetimeValueClient(); + + XmlClientBuilder xmlErrorValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + xmlErrorValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + xmlErrorValueClient = xmlErrorValueClientbuilder.buildXmlErrorValueClient(); + + } +} From a1fbd849efad8d5346c6fd869b744622428b21c5 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 11:38:46 +0800 Subject: [PATCH 03/12] test: port XML payload tests to http-client-generator-test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../src/test/java/payload/xml/XmlTests.java | 359 ++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java new file mode 100644 index 00000000000..685aa6f22f3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package payload.xml; + +import com.azure.core.exception.HttpResponseException; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import payload.xml.models.Author; +import payload.xml.models.Book; +import payload.xml.models.ModelWithArrayOfModel; +import payload.xml.models.ModelWithAttributes; +import payload.xml.models.ModelWithDatetime; +import payload.xml.models.ModelWithDictionary; +import payload.xml.models.ModelWithEmptyArray; +import payload.xml.models.ModelWithEncodedNames; +import payload.xml.models.ModelWithEnum; +import payload.xml.models.ModelWithNamespace; +import payload.xml.models.ModelWithNamespaceOnProperties; +import payload.xml.models.ModelWithNestedModel; +import payload.xml.models.ModelWithOptionalField; +import payload.xml.models.ModelWithRenamedArrays; +import payload.xml.models.ModelWithRenamedAttribute; +import payload.xml.models.ModelWithRenamedFields; +import payload.xml.models.ModelWithRenamedNestedModel; +import payload.xml.models.ModelWithRenamedProperty; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; +import payload.xml.models.ModelWithRenamedWrappedModelArray; +import payload.xml.models.ModelWithSimpleArrays; +import payload.xml.models.ModelWithText; +import payload.xml.models.ModelWithUnwrappedArray; +import payload.xml.models.ModelWithUnwrappedModelArray; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; +import payload.xml.models.SimpleModel; +import payload.xml.models.Status; + +public final class XmlTests { + + @Test + public void testSimpleModel() { + SimpleModelValueClient client = new XmlClientBuilder().buildSimpleModelValueClient(); + + client.put(new SimpleModel("foo", 123)); + + SimpleModel model = client.get(); + Assertions.assertEquals("foo", model.getName()); + Assertions.assertEquals(123, model.getAge()); + } + + @Test + public void testModelWithSimpleArrays() { + ModelWithSimpleArraysValueClient client = new XmlClientBuilder().buildModelWithSimpleArraysValueClient(); + + client.put(new ModelWithSimpleArrays(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithSimpleArrays model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithArrayOfModel() { + ModelWithArrayOfModelValueClient client = new XmlClientBuilder().buildModelWithArrayOfModelValueClient(); + + client.put(new ModelWithArrayOfModel(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithArrayOfModel model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithOptionalField() { + ModelWithOptionalFieldValueClient client = new XmlClientBuilder().buildModelWithOptionalFieldValueClient(); + + client.put(new ModelWithOptionalField("widget")); + + ModelWithOptionalField model = client.get(); + Assertions.assertEquals("widget", model.getItem()); + } + + @Test + public void testModelWithAttributes() { + ModelWithAttributesValueClient client = new XmlClientBuilder().buildModelWithAttributesValueClient(); + + client.put(new ModelWithAttributes(123, "foo", true)); + + ModelWithAttributes model = client.get(); + Assertions.assertEquals(123, model.getId1()); + Assertions.assertEquals("foo", model.getId2()); + Assertions.assertEquals(true, model.isEnabled()); + } + + @Test + public void testModelWithUnwrappedArray() { + ModelWithUnwrappedArrayValueClient client = new XmlClientBuilder().buildModelWithUnwrappedArrayValueClient(); + + client.put(new ModelWithUnwrappedArray(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithUnwrappedArray model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithRenamedArrays() { + ModelWithRenamedArraysValueClient client = new XmlClientBuilder().buildModelWithRenamedArraysValueClient(); + + client.put(new ModelWithRenamedArrays(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithRenamedArrays model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithRenamedFields() { + ModelWithRenamedFieldsValueClient client = new XmlClientBuilder().buildModelWithRenamedFieldsValueClient(); + + client.put(new ModelWithRenamedFields(new SimpleModel("foo", 123), new SimpleModel("bar", 456))); + + ModelWithRenamedFields model = client.get(); + Assertions.assertEquals("foo", model.getInputData().getName()); + Assertions.assertEquals(123, model.getInputData().getAge()); + Assertions.assertEquals("bar", model.getOutputData().getName()); + Assertions.assertEquals(456, model.getOutputData().getAge()); + } + + @Test + public void testModelWithEmptyArray() { + ModelWithEmptyArrayValueClient client = new XmlClientBuilder().buildModelWithEmptyArrayValueClient(); + + client.put(new ModelWithEmptyArray(Collections.emptyList())); + + ModelWithEmptyArray model = client.get(); + Assertions.assertTrue(model.getItems() == null || model.getItems().isEmpty()); + } + + @Test + public void testModelWithText() { + ModelWithTextValueClient client = new XmlClientBuilder().buildModelWithTextValueClient(); + + client.put(new ModelWithText("foo", "\n This is some text.\n")); + + ModelWithText model = client.get(); + Assertions.assertEquals("foo", model.getLanguage()); + Assertions.assertEquals("\n This is some text.\n", model.getContent()); + } + + @Test + public void testModelWithDictionary() { + ModelWithDictionaryValueClient client = new XmlClientBuilder().buildModelWithDictionaryValueClient(); + + client.put(new ModelWithDictionary(Map.of("Color", "blue", "Count", "123", "Enabled", "false"))); + + ModelWithDictionary model = client.get(); + Assertions.assertEquals("blue", model.getMetadata().get("Color")); + Assertions.assertEquals("123", model.getMetadata().get("Count")); + Assertions.assertEquals("false", model.getMetadata().get("Enabled")); + } + + @Test + public void testModelWithEncodedNames() { + ModelWithEncodedNamesValueClient client = new XmlClientBuilder().buildModelWithEncodedNamesValueClient(); + + client.put(new ModelWithEncodedNames(new SimpleModel("foo", 123), List.of("red", "green", "blue"))); + + ModelWithEncodedNames model = client.get(); + Assertions.assertEquals("foo", model.getModelData().getName()); + Assertions.assertEquals(123, model.getModelData().getAge()); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + } + + @Test + public void testModelWithEnum() { + ModelWithEnumValueClient client = new XmlClientBuilder().buildModelWithEnumValueClient(); + + client.put(new ModelWithEnum(Status.SUCCESS)); + + ModelWithEnum model = client.get(); + Assertions.assertEquals(Status.SUCCESS, model.getStatus()); + } + + @Test + public void testModelWithDatetime() { + ModelWithDatetimeValueClient client = new XmlClientBuilder().buildModelWithDatetimeValueClient(); + + OffsetDateTime rfc3339 = OffsetDateTime.of(2022, 8, 26, 18, 38, 0, 0, ZoneOffset.UTC); + OffsetDateTime rfc7231 = OffsetDateTime.of(2022, 8, 26, 14, 38, 0, 0, ZoneOffset.UTC); + + client.put(new ModelWithDatetime(rfc3339, rfc7231)); + + ModelWithDatetime model = client.get(); + Assertions.assertEquals(rfc3339, model.getRfc3339()); + Assertions.assertEquals(rfc7231, model.getRfc7231()); + } + + @Test + public void testXmlErrorValue() { + XmlErrorValueClient client = new XmlClientBuilder().buildXmlErrorValueClient(); + + HttpResponseException exception = Assertions.assertThrows(HttpResponseException.class, client::get); + Assertions.assertEquals(400, exception.getResponse().getStatusCode()); + } + + @Test + public void testModelWithRenamedProperty() { + ModelWithRenamedPropertyValueClient client = new XmlClientBuilder().buildModelWithRenamedPropertyValueClient(); + + client.put(new ModelWithRenamedProperty("foo", "bar")); + + ModelWithRenamedProperty model = client.get(); + Assertions.assertEquals("foo", model.getTitle()); + Assertions.assertEquals("bar", model.getAuthor()); + } + + @Test + public void testModelWithNestedModel() { + ModelWithNestedModelValueClient client = new XmlClientBuilder().buildModelWithNestedModelValueClient(); + + client.put(new ModelWithNestedModel(new SimpleModel("foo", 123))); + + ModelWithNestedModel model = client.get(); + Assertions.assertEquals("foo", model.getNested().getName()); + Assertions.assertEquals(123, model.getNested().getAge()); + } + + @Test + public void testModelWithRenamedNestedModel() { + ModelWithRenamedNestedModelValueClient client + = new XmlClientBuilder().buildModelWithRenamedNestedModelValueClient(); + + client.put(new ModelWithRenamedNestedModel(new Author("foo"))); + + ModelWithRenamedNestedModel model = client.get(); + Assertions.assertEquals("foo", model.getAuthor().getName()); + } + + @Test + public void testModelWithWrappedPrimitiveCustomItemNames() { + ModelWithWrappedPrimitiveCustomItemNamesValueClient client + = new XmlClientBuilder().buildModelWithWrappedPrimitiveCustomItemNamesValueClient(); + + client.put(new ModelWithWrappedPrimitiveCustomItemNames(List.of("fiction", "classic"))); + + ModelWithWrappedPrimitiveCustomItemNames model = client.get(); + Assertions.assertEquals(List.of("fiction", "classic"), model.getTags()); + } + + @Test + public void testModelWithUnwrappedModelArray() { + ModelWithUnwrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithUnwrappedModelArrayValueClient(); + + client.put(new ModelWithUnwrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithUnwrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedWrappedModelArray() { + ModelWithRenamedWrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedWrappedModelArrayValueClient(); + + client.put( + new ModelWithRenamedWrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithRenamedWrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedUnwrappedModelArray() { + ModelWithRenamedUnwrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedUnwrappedModelArrayValueClient(); + + client.put( + new ModelWithRenamedUnwrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithRenamedUnwrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedWrappedAndItemModelArray() { + ModelWithRenamedWrappedAndItemModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedWrappedAndItemModelArrayValueClient(); + + client.put(new ModelWithRenamedWrappedAndItemModelArray( + List.of(new Book("The Great Gatsby"), new Book("Les Miserables")))); + + ModelWithRenamedWrappedAndItemModelArray model = client.get(); + Assertions.assertEquals(2, model.getBooks().size()); + Assertions.assertEquals("The Great Gatsby", model.getBooks().get(0).getTitle()); + Assertions.assertEquals("Les Miserables", model.getBooks().get(1).getTitle()); + } + + @Test + public void testModelWithRenamedAttribute() { + ModelWithRenamedAttributeValueClient client + = new XmlClientBuilder().buildModelWithRenamedAttributeValueClient(); + + client.put(new ModelWithRenamedAttribute(123, "The Great Gatsby", "F. Scott Fitzgerald")); + + ModelWithRenamedAttribute model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + Assertions.assertEquals("F. Scott Fitzgerald", model.getAuthor()); + } + + @Disabled("namespace mismatch") + @Test + public void testModelWithNamespace() { + ModelWithNamespaceValueClient client = new XmlClientBuilder().buildModelWithNamespaceValueClient(); + + client.put(new ModelWithNamespace(123, "The Great Gatsby")); + + ModelWithNamespace model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + } + + @Disabled("namespace mismatch") + @Test + public void testModelWithNamespaceOnProperties() { + ModelWithNamespaceOnPropertiesValueClient client + = new XmlClientBuilder().buildModelWithNamespaceOnPropertiesValueClient(); + + client.put(new ModelWithNamespaceOnProperties(123, "The Great Gatsby", "F. Scott Fitzgerald")); + + ModelWithNamespaceOnProperties model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + Assertions.assertEquals("F. Scott Fitzgerald", model.getAuthor()); + } +} From b2d24cbb070e37d171d3eaeee299780d05230db0 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 11:56:11 +0800 Subject: [PATCH 04/12] test: use azure-xml ObjectSerializer for XML payload clients Add XmlSerializer/XmlSerializerProviders in the implementation package and route the toObject/fromObject convenience methods through the XML serializer overload so XML clients serialize XML instead of JSON. Add jackson-dataformat-xml for error-body decoding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../http-client-generator-test/pom.xml | 5 ++ ...ModelWithArrayOfModelValueAsyncClient.java | 8 +- .../xml/ModelWithArrayOfModelValueClient.java | 8 +- .../ModelWithAttributesValueAsyncClient.java | 8 +- .../xml/ModelWithAttributesValueClient.java | 8 +- .../ModelWithDatetimeValueAsyncClient.java | 8 +- .../xml/ModelWithDatetimeValueClient.java | 8 +- .../ModelWithDictionaryValueAsyncClient.java | 8 +- .../xml/ModelWithDictionaryValueClient.java | 8 +- .../ModelWithEmptyArrayValueAsyncClient.java | 8 +- .../xml/ModelWithEmptyArrayValueClient.java | 8 +- ...ModelWithEncodedNamesValueAsyncClient.java | 8 +- .../xml/ModelWithEncodedNamesValueClient.java | 8 +- .../xml/ModelWithEnumValueAsyncClient.java | 8 +- .../payload/xml/ModelWithEnumValueClient.java | 8 +- ...NamespaceOnPropertiesValueAsyncClient.java | 8 +- ...lWithNamespaceOnPropertiesValueClient.java | 8 +- .../ModelWithNamespaceValueAsyncClient.java | 8 +- .../xml/ModelWithNamespaceValueClient.java | 8 +- .../ModelWithNestedModelValueAsyncClient.java | 8 +- .../xml/ModelWithNestedModelValueClient.java | 8 +- ...odelWithOptionalFieldValueAsyncClient.java | 8 +- .../ModelWithOptionalFieldValueClient.java | 8 +- ...odelWithRenamedArraysValueAsyncClient.java | 8 +- .../ModelWithRenamedArraysValueClient.java | 8 +- ...lWithRenamedAttributeValueAsyncClient.java | 8 +- .../ModelWithRenamedAttributeValueClient.java | 8 +- ...odelWithRenamedFieldsValueAsyncClient.java | 8 +- .../ModelWithRenamedFieldsValueClient.java | 8 +- ...ithRenamedNestedModelValueAsyncClient.java | 8 +- ...odelWithRenamedNestedModelValueClient.java | 8 +- ...elWithRenamedPropertyValueAsyncClient.java | 8 +- .../ModelWithRenamedPropertyValueClient.java | 8 +- ...edUnwrappedModelArrayValueAsyncClient.java | 9 ++- ...RenamedUnwrappedModelArrayValueClient.java | 9 ++- ...ppedAndItemModelArrayValueAsyncClient.java | 9 ++- ...edWrappedAndItemModelArrayValueClient.java | 9 ++- ...amedWrappedModelArrayValueAsyncClient.java | 9 ++- ...thRenamedWrappedModelArrayValueClient.java | 8 +- ...ModelWithSimpleArraysValueAsyncClient.java | 8 +- .../xml/ModelWithSimpleArraysValueClient.java | 8 +- .../xml/ModelWithTextValueAsyncClient.java | 8 +- .../payload/xml/ModelWithTextValueClient.java | 8 +- ...delWithUnwrappedArrayValueAsyncClient.java | 8 +- .../ModelWithUnwrappedArrayValueClient.java | 8 +- ...thUnwrappedModelArrayValueAsyncClient.java | 8 +- ...delWithUnwrappedModelArrayValueClient.java | 8 +- ...mitiveCustomItemNamesValueAsyncClient.java | 9 ++- ...edPrimitiveCustomItemNamesValueClient.java | 9 ++- .../xml/SimpleModelValueAsyncClient.java | 8 +- .../payload/xml/SimpleModelValueClient.java | 9 ++- .../payload/xml/XmlErrorValueAsyncClient.java | 6 +- .../java/payload/xml/XmlErrorValueClient.java | 6 +- .../xml/implementation/XmlSerializer.java | 75 +++++++++++++++++++ .../XmlSerializerProviders.java | 26 +++++++ 55 files changed, 424 insertions(+), 102 deletions(-) create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java diff --git a/packages/http-client-java/generator/http-client-generator-test/pom.xml b/packages/http-client-java/generator/http-client-generator-test/pom.xml index 7f514ce2cd3..a67b1f61bc1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/pom.xml +++ b/packages/http-client-java/generator/http-client-generator-test/pom.xml @@ -35,6 +35,11 @@ azure-xml 1.2.1 + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.18.7 + com.azure azure-core-test diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java index c9f27edb74b..e428e285350 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithArrayOfModel; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithArrayOfModelValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithArrayOfModelValuesImpl serviceClient; @@ -115,7 +119,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithArrayOfModel.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithArrayOfModel.class, SERIALIZER)); } /** @@ -135,6 +139,6 @@ public Mono get() { public Mono put(ModelWithArrayOfModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java index 2eade41e31d..3b458071b18 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithArrayOfModel; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithArrayOfModelValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithArrayOfModelValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithArrayOfModel get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithArrayOfModel.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithArrayOfModel.class, SERIALIZER); } /** @@ -131,6 +135,6 @@ public ModelWithArrayOfModel get() { public void put(ModelWithArrayOfModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java index 9f1cc6db82b..ee214c10656 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithAttributes; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithAttributesValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithAttributesValuesImpl serviceClient; @@ -110,7 +114,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithAttributes.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithAttributes.class, SERIALIZER)); } /** @@ -130,6 +134,6 @@ public Mono get() { public Mono put(ModelWithAttributes input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java index 72eb3700211..786518f5790 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithAttributes; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithAttributesValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithAttributesValuesImpl serviceClient; @@ -106,7 +110,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithAttributes get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithAttributes.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithAttributes.class, SERIALIZER); } /** @@ -125,6 +129,6 @@ public ModelWithAttributes get() { public void put(ModelWithAttributes input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java index e4d8ae2dc68..bf2892a3643 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithDatetime; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithDatetimeValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithDatetimeValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDatetime.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDatetime.class, SERIALIZER)); } /** @@ -128,6 +132,6 @@ public Mono get() { public Mono put(ModelWithDatetime input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java index 3e7e8567a2b..5a5f03c3413 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithDatetime; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithDatetimeValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithDatetimeValuesImpl serviceClient; @@ -104,7 +108,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithDatetime get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithDatetime.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDatetime.class, SERIALIZER); } /** @@ -123,6 +127,6 @@ public ModelWithDatetime get() { public void put(ModelWithDatetime input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java index 90f66724e53..39cf72761b2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithDictionary; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithDictionaryValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithDictionaryValuesImpl serviceClient; @@ -110,7 +114,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDictionary.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDictionary.class, SERIALIZER)); } /** @@ -130,6 +134,6 @@ public Mono get() { public Mono put(ModelWithDictionary input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java index 3b3e0d9d3f6..700d66b0113 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithDictionary; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithDictionaryValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithDictionaryValuesImpl serviceClient; @@ -106,7 +110,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithDictionary get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithDictionary.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDictionary.class, SERIALIZER); } /** @@ -125,6 +129,6 @@ public ModelWithDictionary get() { public void put(ModelWithDictionary input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java index 09f040a126d..de60f7e796f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEmptyArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEmptyArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEmptyArrayValuesImpl serviceClient; @@ -117,7 +121,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEmptyArray.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEmptyArray.class, SERIALIZER)); } /** @@ -137,6 +141,6 @@ public Mono get() { public Mono put(ModelWithEmptyArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java index a34f5ce93ce..ab783c564e8 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEmptyArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEmptyArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEmptyArrayValuesImpl serviceClient; @@ -113,7 +117,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithEmptyArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithEmptyArray.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEmptyArray.class, SERIALIZER); } /** @@ -132,6 +136,6 @@ public ModelWithEmptyArray get() { public void put(ModelWithEmptyArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java index feb90f3117c..4ec54e21a36 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEncodedNames; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEncodedNamesValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEncodedNamesValuesImpl serviceClient; @@ -119,7 +123,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEncodedNames.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEncodedNames.class, SERIALIZER)); } /** @@ -139,6 +143,6 @@ public Mono get() { public Mono put(ModelWithEncodedNames input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java index 8a1bab4804f..b11eb188dcc 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEncodedNames; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEncodedNamesValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEncodedNamesValuesImpl serviceClient; @@ -114,7 +118,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithEncodedNames get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithEncodedNames.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEncodedNames.class, SERIALIZER); } /** @@ -133,6 +137,6 @@ public ModelWithEncodedNames get() { public void put(ModelWithEncodedNames input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java index 6e6818526e5..2c83b4c25fd 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEnum; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEnumValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEnumValuesImpl serviceClient; @@ -106,7 +110,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEnum.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEnum.class, SERIALIZER)); } /** @@ -126,6 +130,6 @@ public Mono get() { public Mono put(ModelWithEnum input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java index f5206f2a10e..c93cfa21efa 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithEnum; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEnumValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithEnumValuesImpl serviceClient; @@ -102,7 +106,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithEnum get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithEnum.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEnum.class, SERIALIZER); } /** @@ -121,6 +125,6 @@ public ModelWithEnum get() { public void put(ModelWithEnum input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java index c8f0ebbfb2a..8f702d1769d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNamespaceOnProperties; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNamespaceOnPropertiesValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; @@ -111,7 +115,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespaceOnProperties.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespaceOnProperties.class, SERIALIZER)); } /** @@ -131,6 +135,6 @@ public Mono get() { public Mono put(ModelWithNamespaceOnProperties input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java index 5c28fc8a042..257b787e866 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNamespaceOnProperties; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNamespaceOnPropertiesValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; @@ -107,7 +111,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithNamespaceOnProperties get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespaceOnProperties.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespaceOnProperties.class, SERIALIZER); } /** @@ -126,6 +130,6 @@ public ModelWithNamespaceOnProperties get() { public void put(ModelWithNamespaceOnProperties input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java index d4e3b6dbb8a..dd446a3a579 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNamespace; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNamespaceValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNamespaceValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespace.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespace.class, SERIALIZER)); } /** @@ -128,6 +132,6 @@ public Mono get() { public Mono put(ModelWithNamespace input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java index 74ede515d78..37635c65724 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNamespace; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNamespaceValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNamespaceValuesImpl serviceClient; @@ -104,7 +108,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithNamespace get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespace.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespace.class, SERIALIZER); } /** @@ -123,6 +127,6 @@ public ModelWithNamespace get() { public void put(ModelWithNamespace input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java index 61bb169d759..39c89bb8524 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNestedModel; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNestedModelValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNestedModelValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNestedModel.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNestedModel.class, SERIALIZER)); } /** @@ -132,6 +136,6 @@ public Mono get() { public Mono put(ModelWithNestedModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java index f28dab71b61..3d1746604bb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithNestedModel; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNestedModelValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithNestedModelValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithNestedModel get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithNestedModel.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNestedModel.class, SERIALIZER); } /** @@ -127,6 +131,6 @@ public ModelWithNestedModel get() { public void put(ModelWithNestedModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java index 534f9c0391d..04eea8dd024 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithOptionalField; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithOptionalFieldValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithOptionalFieldValuesImpl serviceClient; @@ -107,7 +111,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithOptionalField.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithOptionalField.class, SERIALIZER)); } /** @@ -127,6 +131,6 @@ public Mono get() { public Mono put(ModelWithOptionalField input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java index 046f1460a19..ce645dbb701 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithOptionalField; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithOptionalFieldValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithOptionalFieldValuesImpl serviceClient; @@ -104,7 +108,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithOptionalField get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithOptionalField.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithOptionalField.class, SERIALIZER); } /** @@ -123,6 +127,6 @@ public ModelWithOptionalField get() { public void put(ModelWithOptionalField input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java index bb75ac7a6fa..adce71fdeb1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedArrays; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedArraysValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedArraysValuesImpl serviceClient; @@ -117,7 +121,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedArrays.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedArrays.class, SERIALIZER)); } /** @@ -137,6 +141,6 @@ public Mono get() { public Mono put(ModelWithRenamedArrays input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java index a6792ff674b..f199ea9af3c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedArrays; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedArraysValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedArraysValuesImpl serviceClient; @@ -114,7 +118,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedArrays get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedArrays.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedArrays.class, SERIALIZER); } /** @@ -133,6 +137,6 @@ public ModelWithRenamedArrays get() { public void put(ModelWithRenamedArrays input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java index 751785ec4fe..27d983a99b1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedAttribute; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedAttributeValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedAttributeValuesImpl serviceClient; @@ -110,7 +114,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedAttribute.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedAttribute.class, SERIALIZER)); } /** @@ -130,6 +134,6 @@ public Mono get() { public Mono put(ModelWithRenamedAttribute input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java index e0b403376ae..f2496a04dc0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedAttribute; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedAttributeValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedAttributeValuesImpl serviceClient; @@ -106,7 +110,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedAttribute get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedAttribute.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedAttribute.class, SERIALIZER); } /** @@ -125,6 +129,6 @@ public ModelWithRenamedAttribute get() { public void put(ModelWithRenamedAttribute input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java index 3c68ba49052..2957a0c7444 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedFields; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedFieldsValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedFieldsValuesImpl serviceClient; @@ -115,7 +119,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedFields.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedFields.class, SERIALIZER)); } /** @@ -135,6 +139,6 @@ public Mono get() { public Mono put(ModelWithRenamedFields input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java index 930cefda41b..eff1a9d1852 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedFields; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedFieldsValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedFieldsValuesImpl serviceClient; @@ -111,7 +115,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedFields get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedFields.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedFields.class, SERIALIZER); } /** @@ -130,6 +134,6 @@ public ModelWithRenamedFields get() { public void put(ModelWithRenamedFields input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java index 8f9a8eb1e5c..e0948eed059 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedNestedModel; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedNestedModelValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedNestedModelValuesImpl serviceClient; @@ -110,7 +114,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedNestedModel.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedNestedModel.class, SERIALIZER)); } /** @@ -130,6 +134,6 @@ public Mono get() { public Mono put(ModelWithRenamedNestedModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java index a47d917046f..deb91878a23 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedNestedModel; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedNestedModelValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedNestedModelValuesImpl serviceClient; @@ -106,7 +110,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedNestedModel get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedNestedModel.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedNestedModel.class, SERIALIZER); } /** @@ -125,6 +129,6 @@ public ModelWithRenamedNestedModel get() { public void put(ModelWithRenamedNestedModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java index fd0ebcb1119..ea89a207bfc 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedProperty; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedPropertyValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedPropertyValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedProperty.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedProperty.class, SERIALIZER)); } /** @@ -128,6 +132,6 @@ public Mono get() { public Mono put(ModelWithRenamedProperty input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java index f6a0db83fd6..56d5a463082 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedProperty; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedPropertyValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedPropertyValuesImpl serviceClient; @@ -104,7 +108,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedProperty get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedProperty.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedProperty.class, SERIALIZER); } /** @@ -123,6 +127,6 @@ public ModelWithRenamedProperty get() { public void put(ModelWithRenamedProperty input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java index 394e7ab7cc8..b1645bca29b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedUnwrappedModelArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedUnwrappedModelArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; @@ -117,7 +121,8 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedUnwrappedModelArray.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedUnwrappedModelArray.class, + SERIALIZER)); } /** @@ -137,6 +142,6 @@ public Mono get() { public Mono put(ModelWithRenamedUnwrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java index 5cba045b671..502b96b34cd 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedUnwrappedModelArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedUnwrappedModelArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; @@ -112,7 +116,8 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedUnwrappedModelArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedUnwrappedModelArray.class); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithRenamedUnwrappedModelArray.class, SERIALIZER); } /** @@ -131,6 +136,6 @@ public ModelWithRenamedUnwrappedModelArray get() { public void put(ModelWithRenamedUnwrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java index 7e8c8740f1d..1353f9bc90d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; @@ -116,7 +120,8 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedAndItemModelArray.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedAndItemModelArray.class, + SERIALIZER)); } /** @@ -136,6 +141,6 @@ public Mono get() { public Mono put(ModelWithRenamedWrappedAndItemModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java index a779f7a2d69..c5819adfdcc 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedWrappedAndItemModelArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; @@ -111,7 +115,8 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedWrappedAndItemModelArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedAndItemModelArray.class); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithRenamedWrappedAndItemModelArray.class, SERIALIZER); } /** @@ -130,6 +135,6 @@ public ModelWithRenamedWrappedAndItemModelArray get() { public void put(ModelWithRenamedWrappedAndItemModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java index 57cf41a65dc..6c5d3c73d7f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedWrappedModelArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedWrappedModelArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; @@ -117,7 +121,8 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedModelArray.class)); + .map( + protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedModelArray.class, SERIALIZER)); } /** @@ -137,6 +142,6 @@ public Mono get() { public Mono put(ModelWithRenamedWrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java index 0599e763abb..1818d52bcec 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithRenamedWrappedModelArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedWrappedModelArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithRenamedWrappedModelArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedModelArray.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedModelArray.class, SERIALIZER); } /** @@ -131,6 +135,6 @@ public ModelWithRenamedWrappedModelArray get() { public void put(ModelWithRenamedWrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java index 1d033fb0668..beff67be963 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithSimpleArrays; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithSimpleArraysValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithSimpleArraysValuesImpl serviceClient; @@ -116,7 +120,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithSimpleArrays.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithSimpleArrays.class, SERIALIZER)); } /** @@ -136,6 +140,6 @@ public Mono get() { public Mono put(ModelWithSimpleArrays input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java index c0a80f42612..e733242417b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithSimpleArrays; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithSimpleArraysValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithSimpleArraysValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithSimpleArrays get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithSimpleArrays.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithSimpleArrays.class, SERIALIZER); } /** @@ -131,6 +135,6 @@ public ModelWithSimpleArrays get() { public void put(ModelWithSimpleArrays input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java index c170627e776..f1c733ec2ef 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithText; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithTextValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithTextValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithText.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithText.class, SERIALIZER)); } /** @@ -128,6 +132,6 @@ public Mono get() { public Mono put(ModelWithText input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java index ed7cf02a66a..91466cc8f02 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithText; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithTextValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithTextValuesImpl serviceClient; @@ -104,7 +108,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithText get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithText.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithText.class, SERIALIZER); } /** @@ -123,6 +127,6 @@ public ModelWithText get() { public void put(ModelWithText input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java index 184c10eb2e8..b6063a40881 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithUnwrappedArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithUnwrappedArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithUnwrappedArrayValuesImpl serviceClient; @@ -117,7 +121,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedArray.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedArray.class, SERIALIZER)); } /** @@ -137,6 +141,6 @@ public Mono get() { public Mono put(ModelWithUnwrappedArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java index a8c5c6bff5c..60471d1e32c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithUnwrappedArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithUnwrappedArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithUnwrappedArrayValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithUnwrappedArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedArray.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedArray.class, SERIALIZER); } /** @@ -131,6 +135,6 @@ public ModelWithUnwrappedArray get() { public void put(ModelWithUnwrappedArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java index 0d931bee331..ddd3e8cff1d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithUnwrappedModelArray; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithUnwrappedModelArrayValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; @@ -116,7 +120,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedModelArray.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedModelArray.class, SERIALIZER)); } /** @@ -136,6 +140,6 @@ public Mono get() { public Mono put(ModelWithUnwrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java index ee44d1a3569..7e6043453b3 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithUnwrappedModelArray; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithUnwrappedModelArrayValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; @@ -112,7 +116,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithUnwrappedModelArray get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedModelArray.class); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedModelArray.class, SERIALIZER); } /** @@ -131,6 +135,6 @@ public ModelWithUnwrappedModelArray get() { public void put(ModelWithUnwrappedModelArray input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java index 5a99b4ed6f5..8d955d98a87 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; @@ -112,7 +116,8 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ModelWithWrappedPrimitiveCustomItemNames.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithWrappedPrimitiveCustomItemNames.class, + SERIALIZER)); } /** @@ -132,6 +137,6 @@ public Mono get() { public Mono put(ModelWithWrappedPrimitiveCustomItemNames input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java index bad23899728..af7d2e6c52b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithWrappedPrimitiveCustomItemNamesValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; @@ -107,7 +111,8 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public ModelWithWrappedPrimitiveCustomItemNames get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(ModelWithWrappedPrimitiveCustomItemNames.class); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithWrappedPrimitiveCustomItemNames.class, SERIALIZER); } /** @@ -126,6 +131,6 @@ public ModelWithWrappedPrimitiveCustomItemNames get() { public void put(ModelWithWrappedPrimitiveCustomItemNames input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java index 3fc5c90057c..2d02ec5c1a2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.SimpleModel; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class SimpleModelValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final SimpleModelValuesImpl serviceClient; @@ -108,7 +112,7 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class)); + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class, SERIALIZER)); } /** @@ -128,6 +132,6 @@ public Mono get() { public Mono put(SimpleModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java index 00f5c8a5c4d..0bf8ac990b0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.SimpleModel; /** @@ -23,6 +25,9 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class SimpleModelValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final SimpleModelValuesImpl serviceClient; @@ -104,7 +109,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp public SimpleModel get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class, SERIALIZER); } /** @@ -123,6 +128,6 @@ public SimpleModel get() { public void put(SimpleModel input) { // Generated convenience method for putWithResponse RequestOptions requestOptions = new RequestOptions(); - putWithResponse(BinaryData.fromObject(input), requestOptions).getValue(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java index 106d45740f2..4e4d961af28 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java @@ -16,7 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; import payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.SimpleModel; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class XmlErrorValueAsyncClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final XmlErrorValuesImpl serviceClient; @@ -81,6 +85,6 @@ public Mono get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class)); + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class, SERIALIZER)); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java index 199e73344de..b764678a5da 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java @@ -15,7 +15,9 @@ 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.serializer.ObjectSerializer; import payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; import payload.xml.models.SimpleModel; /** @@ -23,6 +25,8 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class XmlErrorValueClient { + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + @Generated private final XmlErrorValuesImpl serviceClient; @@ -77,6 +81,6 @@ public Response getWithResponse(RequestOptions requestOptions) { public SimpleModel get() { // Generated convenience method for getWithResponse RequestOptions requestOptions = new RequestOptions(); - return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class, SERIALIZER); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java new file mode 100644 index 00000000000..05999bd5473 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package payload.xml.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.ConcurrentHashMap; +import javax.xml.stream.XMLStreamException; +import reactor.core.publisher.Mono; + +/** + * An {@link ObjectSerializer} implementation that serializes and deserializes {@link XmlSerializable} types using + * {@code azure-xml}. Deserialization relies on the generated static {@code fromXml(XmlReader)} factory method on the + * target type. + */ +public final class XmlSerializer implements ObjectSerializer { + + private static final ConcurrentHashMap, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = (Class) typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException("Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java new file mode 100644 index 00000000000..a9361cbfb12 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package payload.xml.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} From 520eda45ba30e066fc4d4a704f296a51e8b451ba Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 12:21:21 +0800 Subject: [PATCH 05/12] feat(http-client-java): generate XmlSerializer helper classes for XML models Emit XmlSerializer and XmlSerializerProviders implementation classes from the generator when any generating model is used in XML (azure-v1 flavor). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../generator/core/util/ClientModelUtil.java | 3 + .../src/main/resources/XmlSerializer.java | 74 +++++++++++++++++++ .../resources/XmlSerializerProviders.java | 23 ++++++ .../xml/implementation/XmlSerializer.java | 3 + .../XmlSerializerProviders.java | 3 + .../http/client/generator/TypeSpecPlugin.java | 10 +++ 6 files changed, 116 insertions(+) create mode 100644 packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializer.java create mode 100644 packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java index 80cd040e55b..8489f847137 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java @@ -57,6 +57,9 @@ public class ClientModelUtil { public static final String MULTI_PART_FORM_DATA_HELPER_CLASS_NAME = "MultipartFormDataHelper"; public static final String GENERIC_MULTI_PART_FORM_DATA_HELPER_CLASS_NAME = "GenericMultipartFormDataHelper"; + public static final String XML_SERIALIZER_CLASS_NAME = "XmlSerializer"; + public static final String XML_SERIALIZER_PROVIDERS_CLASS_NAME = "XmlSerializerProviders"; + private static final Pattern SPLIT_FLATTEN_PROPERTY_PATTERN = Pattern.compile("((?, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = (Class) typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException( + "Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java b/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java new file mode 100644 index 00000000000..4fedd5fcffa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java @@ -0,0 +1,23 @@ +import com.azure.core.util.serializer.ObjectSerializer; + +// DO NOT modify this helper class + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java index 05999bd5473..95475498fb6 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package payload.xml.implementation; @@ -18,6 +19,8 @@ import javax.xml.stream.XMLStreamException; import reactor.core.publisher.Mono; +// DO NOT modify this helper class + /** * An {@link ObjectSerializer} implementation that serializes and deserializes {@link XmlSerializable} types using * {@code azure-xml}. Deserialization relies on the generated static {@code fromXml(XmlReader)} factory method on the diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java index a9361cbfb12..555862b3797 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package payload.xml.implementation; import com.azure.core.util.serializer.ObjectSerializer; +// DO NOT modify this helper class + /** * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. diff --git a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java index 218d6f8853b..93728dc59be 100644 --- a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java +++ b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java @@ -129,6 +129,16 @@ protected void writeHelperClasses(Client client, CodeModel codeModel, JavaPackag } } + // XmlSerializer + final boolean generateXmlSerializer = JavaSettings.getInstance().isAzureV1() + && client.getModels().stream().filter(ModelUtil::isGeneratingModel).anyMatch(ClientModel::isUsedInXml); + if (generateXmlSerializer) { + javaPackage.addJavaFromResources(settings.getPackage(settings.getImplementationSubpackage()), + ClientModelUtil.XML_SERIALIZER_CLASS_NAME); + javaPackage.addJavaFromResources(settings.getPackage(settings.getImplementationSubpackage()), + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + // OperationLocationPollingStrategy if (ClientModelUtil.requireOperationLocationPollingStrategy(codeModel)) { if (JavaSettings.getInstance().isAzureV2()) { From d323d3263aeeceda19c7e7a874a80a8a08fdb265 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 12:46:51 +0800 Subject: [PATCH 06/12] feat(http-client-java): use XML serializer overload in generated convenience methods Convenience method templates now declare a static XML ObjectSerializer and use the toObject/fromObject(serializer) overloads when the request/response content type is XML (azure-core v1 flavor). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../ConvenienceAsyncMethodTemplate.java | 20 +++--- .../ConvenienceMethodTemplateBase.java | 66 +++++++++++++++++-- .../ConvenienceSyncMethodTemplate.java | 23 +++---- .../template/ServiceAsyncClientTemplate.java | 14 ++++ .../template/ServiceSyncClientTemplate.java | 12 ++++ ...ModelWithArrayOfModelValueAsyncClient.java | 1 + .../xml/ModelWithArrayOfModelValueClient.java | 1 + .../ModelWithAttributesValueAsyncClient.java | 1 + .../xml/ModelWithAttributesValueClient.java | 1 + .../ModelWithDatetimeValueAsyncClient.java | 1 + .../xml/ModelWithDatetimeValueClient.java | 1 + .../ModelWithDictionaryValueAsyncClient.java | 1 + .../xml/ModelWithDictionaryValueClient.java | 1 + .../ModelWithEmptyArrayValueAsyncClient.java | 1 + .../xml/ModelWithEmptyArrayValueClient.java | 1 + ...ModelWithEncodedNamesValueAsyncClient.java | 1 + .../xml/ModelWithEncodedNamesValueClient.java | 1 + .../xml/ModelWithEnumValueAsyncClient.java | 1 + .../payload/xml/ModelWithEnumValueClient.java | 1 + ...NamespaceOnPropertiesValueAsyncClient.java | 1 + ...lWithNamespaceOnPropertiesValueClient.java | 1 + .../ModelWithNamespaceValueAsyncClient.java | 1 + .../xml/ModelWithNamespaceValueClient.java | 1 + .../ModelWithNestedModelValueAsyncClient.java | 1 + .../xml/ModelWithNestedModelValueClient.java | 1 + ...odelWithOptionalFieldValueAsyncClient.java | 1 + .../ModelWithOptionalFieldValueClient.java | 1 + ...odelWithRenamedArraysValueAsyncClient.java | 1 + .../ModelWithRenamedArraysValueClient.java | 1 + ...lWithRenamedAttributeValueAsyncClient.java | 1 + .../ModelWithRenamedAttributeValueClient.java | 1 + ...odelWithRenamedFieldsValueAsyncClient.java | 1 + .../ModelWithRenamedFieldsValueClient.java | 1 + ...ithRenamedNestedModelValueAsyncClient.java | 1 + ...odelWithRenamedNestedModelValueClient.java | 1 + ...elWithRenamedPropertyValueAsyncClient.java | 1 + .../ModelWithRenamedPropertyValueClient.java | 1 + ...edUnwrappedModelArrayValueAsyncClient.java | 1 + ...RenamedUnwrappedModelArrayValueClient.java | 1 + ...ppedAndItemModelArrayValueAsyncClient.java | 1 + ...edWrappedAndItemModelArrayValueClient.java | 1 + ...amedWrappedModelArrayValueAsyncClient.java | 1 + ...thRenamedWrappedModelArrayValueClient.java | 1 + ...ModelWithSimpleArraysValueAsyncClient.java | 1 + .../xml/ModelWithSimpleArraysValueClient.java | 1 + .../xml/ModelWithTextValueAsyncClient.java | 1 + .../payload/xml/ModelWithTextValueClient.java | 1 + ...delWithUnwrappedArrayValueAsyncClient.java | 1 + .../ModelWithUnwrappedArrayValueClient.java | 1 + ...thUnwrappedModelArrayValueAsyncClient.java | 1 + ...delWithUnwrappedModelArrayValueClient.java | 1 + ...mitiveCustomItemNamesValueAsyncClient.java | 1 + ...edPrimitiveCustomItemNamesValueClient.java | 1 + .../xml/SimpleModelValueAsyncClient.java | 1 + .../payload/xml/XmlErrorValueAsyncClient.java | 1 + .../java/payload/xml/XmlErrorValueClient.java | 1 + 56 files changed, 162 insertions(+), 24 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java index c2e26fa9886..d570ae7e08e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java @@ -146,7 +146,7 @@ private String expressionConvertFromBinaryData(IType responseBodyType, IType raw private String expressionMapFromBinaryData(IType responseBodyType, IType rawType, Set mediaTypes, Set typeReferenceStaticClasses) { SupportedMimeType mimeType = SupportedMimeType.getResponseKnownMimeType(mediaTypes); - // TODO (weidxu): support XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); switch (mimeType) { case TEXT: String baseHandling = "protocolMethodData.toString()"; @@ -161,16 +161,17 @@ private String expressionMapFromBinaryData(IType responseBodyType, IType rawType return null; default: - // JSON etc. + // JSON, XML etc. if (responseBodyType instanceof EnumType) { // enum - return String.format("protocolMethodData -> %1$s.from%2$s(protocolMethodData.toObject(%2$s.class))", - responseBodyType, ((EnumType) responseBodyType).getElementType()); + return String.format( + "protocolMethodData -> %1$s.from%2$s(protocolMethodData.toObject(%2$s.class%3$s))", + responseBodyType, ((EnumType) responseBodyType).getElementType(), serializerArgument); } else if (responseBodyType instanceof GenericType) { // generic, e.g. list, map typeReferenceStaticClasses.add((GenericType) responseBodyType); - return String.format("protocolMethodData -> protocolMethodData.toObject(%1$s)", - TemplateUtil.getTypeReferenceCreation(responseBodyType)); + return String.format("protocolMethodData -> protocolMethodData.toObject(%1$s%2$s)", + TemplateUtil.getTypeReferenceCreation(responseBodyType), serializerArgument); } else if (responseBodyType == ClassType.BINARY_DATA) { // BinaryData, no need to do the map in expressionConvertFromBinaryData return null; @@ -178,14 +179,15 @@ private String expressionMapFromBinaryData(IType responseBodyType, IType rawType // byte[] if (rawType == ClassType.BASE_64_URL) { return "protocolMethodData -> protocolMethodData.toObject(" + ClassType.BASE_64_URL.getName() - + ".class).decodedBytes()"; + + ".class" + serializerArgument + ").decodedBytes()"; } else { - return "protocolMethodData -> protocolMethodData.toObject(byte[].class)"; + return "protocolMethodData -> protocolMethodData.toObject(byte[].class" + serializerArgument + + ")"; } } else { // default, treat as class return "protocolMethodData -> protocolMethodData.toObject(" + responseBodyType.asNullable() - + ".class)"; + + ".class" + serializerArgument + ")"; } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java index 6ec3aa6f12b..3e24d654c4e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java @@ -62,9 +62,65 @@ abstract class ConvenienceMethodTemplateBase { + // Name of the static ObjectSerializer member used for XML serialization on the convenience client. + static final String XML_SERIALIZER_MEMBER_NAME = "SERIALIZER"; + protected ConvenienceMethodTemplateBase() { } + /** + * Whether the XML {@link com.azure.core.util.serializer.ObjectSerializer} overload should be used for the given + * MIME type. XML serialization via an explicit serializer is only required for the azure-core (v1) flavor. + * + * @param mimeType the MIME type. + * @return whether to use the XML serializer overload of {@code toObject}/{@code fromObject}. + */ + static boolean useXmlObjectSerializer(SupportedMimeType mimeType) { + return mimeType == SupportedMimeType.XML && JavaSettings.getInstance().isAzureV1(); + } + + /** + * The additional argument (e.g. {@code ", SERIALIZER"}) to append to {@code toObject}/{@code fromObject} calls when + * the XML serializer overload should be used, or an empty string otherwise. + * + * @param mimeType the MIME type. + * @return the serializer argument, possibly empty. + */ + static String xmlSerializerArgument(SupportedMimeType mimeType) { + return useXmlObjectSerializer(mimeType) ? ", " + XML_SERIALIZER_MEMBER_NAME : ""; + } + + /** + * Whether any of the convenience methods requires XML serialization (request or response). Used to decide whether + * the convenience client needs a static XML serializer member. Only applicable to the azure-core (v1) flavor. + * + * @param convenienceMethods the convenience methods on the client. + * @return whether a static XML serializer member is required. + */ + public boolean useXmlSerializerMember(Collection convenienceMethods) { + if (!JavaSettings.getInstance().isAzureV1() || convenienceMethods == null) { + return false; + } + for (ConvenienceMethod convenienceMethod : convenienceMethods) { + if (!isMethodIncluded(convenienceMethod)) { + continue; + } + String requestContentType = convenienceMethod.getProtocolMethod().getProxyMethod().getRequestContentType(); + if (requestContentType != null + && SupportedMimeType.getResponseKnownMimeType(List.of(requestContentType)) == SupportedMimeType.XML) { + return true; + } + Set responseContentTypes + = convenienceMethod.getProtocolMethod().getProxyMethod().getResponseContentTypes(); + if (responseContentTypes != null + && !responseContentTypes.isEmpty() + && SupportedMimeType.getResponseKnownMimeType(responseContentTypes) == SupportedMimeType.XML) { + return true; + } + } + return false; + } + public void write(ConvenienceMethod convenienceMethodObj, JavaClass classBlock, Set typeReferenceStaticClasses) { if (!isMethodIncluded(convenienceMethodObj)) { @@ -569,17 +625,19 @@ private static String expressionConvertToBinaryData(String name, IType type, Str return name; default: - // JSON etc. + // JSON, XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); if (type == ClassType.BINARY_DATA) { return name; } else { if (type == ClassType.BASE_64_URL) { - return "BinaryData.fromObject(" + ClassType.BASE_64_URL.getName() + ".encode(" + name + "))"; + return "BinaryData.fromObject(" + ClassType.BASE_64_URL.getName() + ".encode(" + name + ")" + + serializerArgument + ")"; } else if (type instanceof EnumType) { return "BinaryData.fromObject(" + name + " == null ? null : " + name + "." - + ((EnumType) type).getToMethodName() + "())"; + + ((EnumType) type).getToMethodName() + "()" + serializerArgument + ")"; } else { - return "BinaryData.fromObject(" + name + ")"; + return "BinaryData.fromObject(" + name + serializerArgument + ")"; } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java index a164dbb9ed4..31077ede545 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java @@ -205,7 +205,7 @@ private boolean isResponseBase(IType type) { private String expressionConvertFromBinaryData(IType responseBodyType, IType rawType, String invocationExpression, Set mediaTypes, Set typeReferenceStaticClasses) { SupportedMimeType mimeType = SupportedMimeType.getResponseKnownMimeType(mediaTypes); - // TODO (weidxu): support XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); switch (mimeType) { case TEXT: String basicText = invocationExpression + ".toString()"; @@ -219,32 +219,33 @@ private String expressionConvertFromBinaryData(IType responseBodyType, IType raw return invocationExpression; default: - // JSON etc. + // JSON, XML etc. if (responseBodyType instanceof EnumType) { // enum IType elementType = ((EnumType) responseBodyType).getElementType(); - return String.format("%1$s.from%2$s(%3$s.toObject(%2$s.class))", responseBodyType, elementType, - invocationExpression); + return String.format("%1$s.from%2$s(%3$s.toObject(%2$s.class%4$s))", responseBodyType, elementType, + invocationExpression, serializerArgument); } else if (responseBodyType instanceof GenericType) { // generic, e.g. List, Map typeReferenceStaticClasses.add((GenericType) responseBodyType); - return String.format("%2$s.toObject(%1$s)", TemplateUtil.getTypeReferenceCreation(responseBodyType), - invocationExpression); + return String.format("%2$s.toObject(%1$s%3$s)", + TemplateUtil.getTypeReferenceCreation(responseBodyType), invocationExpression, + serializerArgument); } else if (responseBodyType == ClassType.BINARY_DATA) { // BinaryData return invocationExpression; } else if (responseBodyType == ArrayType.BYTE_ARRAY) { // byte[] if (rawType == ClassType.BASE_64_URL) { - return invocationExpression + ".toObject(" + ClassType.BASE_64_URL.getName() - + ".class).decodedBytes()"; + return invocationExpression + ".toObject(" + ClassType.BASE_64_URL.getName() + ".class" + + serializerArgument + ").decodedBytes()"; } else { - return invocationExpression + ".toObject(byte[].class)"; + return invocationExpression + ".toObject(byte[].class" + serializerArgument + ")"; } } else { // default, treat as class - return String.format("%2$s.toObject(%1$s.class)", responseBodyType.asNullable(), - invocationExpression); + return String.format("%2$s.toObject(%1$s.class%3$s)", responseBodyType.asNullable(), + invocationExpression, serializerArgument); } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java index 8d1faf6a3a9..73b969778e3 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java @@ -80,6 +80,14 @@ public final void write(AsyncSyncClient asyncClient, JavaFile javaFile) { Templates.getConvenienceAsyncMethodTemplate().addImports(imports, asyncClient.getConvenienceMethods()); + final boolean useXmlSerializer + = Templates.getConvenienceAsyncMethodTemplate().useXmlSerializerMember(asyncClient.getConvenienceMethods()); + if (useXmlSerializer) { + imports.add("com.azure.core.util.serializer.ObjectSerializer"); + imports.add(settings.getPackage(settings.getImplementationSubpackage()) + "." + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + javaFile.declareImport(imports); javaFile.javadocComment(comment -> comment.description(String .format("Initializes a new instance of the asynchronous %1$s type.", serviceClient.getInterfaceName()))); @@ -90,6 +98,12 @@ public final void write(AsyncSyncClient asyncClient, JavaFile javaFile) { } javaFile.publicFinalClass(asyncClassName, classBlock -> { // Add service client member variable + if (useXmlSerializer) { + addGeneratedAnnotation(classBlock); + classBlock.privateStaticFinalVariable( + "ObjectSerializer " + ConvenienceMethodTemplateBase.XML_SERIALIZER_MEMBER_NAME + " = " + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME + ".createInstance()"); + } addGeneratedAnnotation(classBlock); if (wrapServiceClient) { classBlock.privateFinalMemberVariable(serviceClient.getClassName(), "serviceClient"); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java index 8e58d6a261a..e9b16f4cf3e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java @@ -73,6 +73,12 @@ public final void write(AsyncSyncClient syncClient, JavaFile javaFile) { Templates.getConvenienceSyncMethodTemplate().addImports(imports, syncClient.getConvenienceMethods()); + if (Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods())) { + imports.add("com.azure.core.util.serializer.ObjectSerializer"); + imports.add(settings.getPackage(settings.getImplementationSubpackage()) + "." + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + if (!JavaSettings.getInstance().isAzureV1()) { ClassType.INSTRUMENTATION.addImportsTo(imports, false); ClassType.SDK_INSTRUMENTATION_OPTIONS.addImportsTo(imports, false); @@ -107,6 +113,12 @@ protected void writeClass(AsyncSyncClient syncClient, JavaClass classBlock, Java final boolean wrapServiceClient = methodGroupClient == null; // Add service client member + if (Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods())) { + addGeneratedAnnotation(classBlock); + classBlock.privateStaticFinalVariable( + "ObjectSerializer " + ConvenienceMethodTemplateBase.XML_SERIALIZER_MEMBER_NAME + " = " + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME + ".createInstance()"); + } addGeneratedAnnotation(classBlock); if (wrapServiceClient) { classBlock.privateFinalMemberVariable(serviceClient.getClassName(), "serviceClient"); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java index e428e285350..81c19204a4e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithArrayOfModelValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java index 3b458071b18..0ea9f55070e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithArrayOfModelValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java index ee214c10656..e2ba4a411e0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithAttributesValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java index 786518f5790..d471399405a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithAttributesValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java index bf2892a3643..18cc35250d0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithDatetimeValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java index 5a5f03c3413..2d87e4dacb9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithDatetimeValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java index 39cf72761b2..195d04bd7d0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithDictionaryValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java index 700d66b0113..d480bdb1d18 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithDictionaryValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java index de60f7e796f..17ec0f852f9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEmptyArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java index ab783c564e8..347ef35cc6c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEmptyArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java index 4ec54e21a36..cddbd682bc4 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEncodedNamesValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java index b11eb188dcc..24bcb3d6adb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEncodedNamesValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java index 2c83b4c25fd..6f7b59ebc2d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithEnumValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java index c93cfa21efa..fba645a3581 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithEnumValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java index 8f702d1769d..224f322ada6 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNamespaceOnPropertiesValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java index 257b787e866..5ec708f8491 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNamespaceOnPropertiesValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java index dd446a3a579..539f07ce235 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNamespaceValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java index 37635c65724..24913a0382b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNamespaceValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java index 39c89bb8524..cabf1c167d5 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithNestedModelValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java index 3d1746604bb..cb3c68d8e97 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithNestedModelValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java index 04eea8dd024..895cc738a15 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithOptionalFieldValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java index ce645dbb701..399cd80a8f1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithOptionalFieldValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java index adce71fdeb1..a369272fe63 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedArraysValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java index f199ea9af3c..816375d2b45 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedArraysValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java index 27d983a99b1..148ca7cdc9d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedAttributeValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java index f2496a04dc0..31ac02f7584 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedAttributeValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java index 2957a0c7444..a62463ba044 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedFieldsValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java index eff1a9d1852..5111e8e5759 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedFieldsValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java index e0948eed059..b9d8a681d6d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedNestedModelValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java index deb91878a23..7a0e81c321f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedNestedModelValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java index ea89a207bfc..944e79cebe1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedPropertyValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java index 56d5a463082..86377cddb30 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedPropertyValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java index b1645bca29b..a67671537a7 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedUnwrappedModelArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java index 502b96b34cd..e6002cb5e46 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedUnwrappedModelArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java index 1353f9bc90d..e7782e87f9e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java index c5819adfdcc..6afada2ae3d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedWrappedAndItemModelArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java index 6c5d3c73d7f..383c6f1e94a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithRenamedWrappedModelArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java index 1818d52bcec..5044de3bc79 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithRenamedWrappedModelArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java index beff67be963..dae44cabd0a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithSimpleArraysValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java index e733242417b..9bcebe26a83 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithSimpleArraysValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java index f1c733ec2ef..8598be080ab 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithTextValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java index 91466cc8f02..e375ebf9c12 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithTextValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java index b6063a40881..6bab0a31b58 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithUnwrappedArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java index 60471d1e32c..80ee58a2c52 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithUnwrappedArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java index ddd3e8cff1d..fcf1648ed9e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithUnwrappedModelArrayValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java index 7e6043453b3..e03eec89b3f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithUnwrappedModelArrayValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java index 8d955d98a87..5c128642f06 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java index af7d2e6c52b..b0dbd590854 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class ModelWithWrappedPrimitiveCustomItemNamesValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java index 2d02ec5c1a2..9decc6bca75 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class SimpleModelValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java index 4e4d961af28..49ac7ed4ee6 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java @@ -27,6 +27,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class, isAsync = true) public final class XmlErrorValueAsyncClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java index b764678a5da..426c157daaa 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java @@ -25,6 +25,7 @@ */ @ServiceClient(builder = XmlClientBuilder.class) public final class XmlErrorValueClient { + @Generated private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); @Generated From 6d303159fb0d5e2b79f83c221f1075f2e9e2930e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 12:47:37 +0800 Subject: [PATCH 07/12] chore: add changelog entry for XML serialization support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md diff --git a/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md b/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md new file mode 100644 index 00000000000..084614f6742 --- /dev/null +++ b/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-client-java" +--- + +Support XML serialization for models: generate XmlSerializer helper classes and use the XML ObjectSerializer overload of toObject/fromObject in convenience methods for XML request/response bodies. \ No newline at end of file From 2590cb40d7aca10aff46ef0c1d4753502b342e84 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 13:20:25 +0800 Subject: [PATCH 08/12] docs: document emitter/generator e2e code-gen workflow for http-client-java Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../http-client-java.instructions.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/instructions/http-client-java.instructions.md b/.github/instructions/http-client-java.instructions.md index 1a99d2ff6a7..ec90c59b79b 100644 --- a/.github/instructions/http-client-java.instructions.md +++ b/.github/instructions/http-client-java.instructions.md @@ -56,3 +56,37 @@ Typical task: `add e2e test case for , scenario is `. # Add feature or fix bug - Run `npm run format` and commit the formatted code before finalizing. Do not include any other changes in the commit. +- Add a changelog entry: `pnpm change add @typespec/http-client-java --kind= --message=""` (use `feature` for new features, `fix` for bug fixes). Commit the new md file in the ".chronus" folder of the repository root. + +# Modify the code generator (emitter + generator e2e loop) + +Use this workflow when a change requires modifying how client code is generated (not just adding tests). + +The code generator has two connected parts, linked by a `code-model.yaml`: + +- `emitter/` — TypeScript. Consumes the TypeSpec compiler output and produces `code-model.yaml`. +- `generator/` — Java. Consumes `code-model.yaml` and emits the Java client source. + +After a compile, inspect `tsp-output/**/code-model.yaml` in the test module to see what the emitter passed to the generator. + +## Edit → update emitter → test loop + +1. Make the emitter (TypeScript) and/or generator (Java) changes. +2. Ensure the generator compiles: `mvn clean install --define spotless:skip -DskipTests --no-transfer-progress -T 1C -f ./generator/pom.xml` (from `/packages/http-client-java`). +3. Ensure the emitter builds: `npm run build:emitter`. +4. Format Java with `mvn spotless:apply --no-transfer-progress -T 1C --activate-profiles test -f ./generator/pom.xml` and TypeScript via `npm run format`. +5. Run `pwsh Setup.ps1` in `generator/http-client-generator-test`. This packs the emitter (bundling the freshly built generator jar) and installs it into the test module. Re-run it after every generator/emitter change you want reflected in generation. +6. Regenerate by compiling a spec. Do NOT hardcode the TypeSpec file name — it varies per feature, and sometimes you must author a new `/main.tsp` first. The test module's `tspconfig.yaml` already configures the emitter and its output dir, so a plain compile is enough; output goes to `tsp-output/`: + `npx tsp compile ` + (Optionally add `--option "@typespec/http-client-java.emitter-output-dir=$PWD/tsp-output/"` to isolate output into a subfolder for an easier diff.) +7. Verify the generated code under `tsp-output/**/src` is as expected. When the spec corresponds to sources tracked in `src/main/java`, compare against them and, if correct, copy the generated files into `src` (replacing existing files) but EXCLUDE `module-info.java`. Some specs do not map to `src` — in that case just verify the output, without comparing or copying. +8. When the spec maps to `src` and you copied the generated code in, run the tests (`mvn test`, or a targeted `"-Dtest=."`). Restart the Spector server if needed (`npm run spector-stop` then `npm run spector-start`). If the spec does not map to `src`, verifying the generated output (step 7) is sufficient. + +## Emitting static helper classes from resource templates + +Some helpers are shipped verbatim as resource templates rather than built up in code: + +- `generator/http-client-generator/src/main/java/.../TypeSpecPlugin.java` — `writeHelperClasses(...)` emits per-client helper classes into the implementation subpackage via `JavaPackage.addJavaFromResources(packageName, resourceName[, fileName])`. +- Resource templates live under `generator/http-client-generator-core/src/main/resources/*.java` and must START with `import` statements — do NOT include a `package` line or the license header. The file factory injects the license header, the `package` statement, and reorders imports. The class name must match the resource/file name. +- Class-name constants live in `generator/http-client-generator-core/src/main/java/.../util/ClientModelUtil.java`. + From 52f65c4d0f35d81878251cf3c292bff36d85de40 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 13:23:40 +0800 Subject: [PATCH 09/12] docs: use mvn --define long-form flags to satisfy spellcheck Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .github/instructions/http-client-java.instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/instructions/http-client-java.instructions.md b/.github/instructions/http-client-java.instructions.md index ec90c59b79b..8bde5eff8a8 100644 --- a/.github/instructions/http-client-java.instructions.md +++ b/.github/instructions/http-client-java.instructions.md @@ -72,7 +72,7 @@ After a compile, inspect `tsp-output/**/code-model.yaml` in the test module to s ## Edit → update emitter → test loop 1. Make the emitter (TypeScript) and/or generator (Java) changes. -2. Ensure the generator compiles: `mvn clean install --define spotless:skip -DskipTests --no-transfer-progress -T 1C -f ./generator/pom.xml` (from `/packages/http-client-java`). +2. Ensure the generator compiles: `mvn clean install --define spotless:skip --define skipTests --no-transfer-progress -T 1C -f ./generator/pom.xml` (from `/packages/http-client-java`). 3. Ensure the emitter builds: `npm run build:emitter`. 4. Format Java with `mvn spotless:apply --no-transfer-progress -T 1C --activate-profiles test -f ./generator/pom.xml` and TypeScript via `npm run format`. 5. Run `pwsh Setup.ps1` in `generator/http-client-generator-test`. This packs the emitter (bundling the freshly built generator jar) and installs it into the test module. Re-run it after every generator/emitter change you want reflected in generation. @@ -80,7 +80,7 @@ After a compile, inspect `tsp-output/**/code-model.yaml` in the test module to s `npx tsp compile ` (Optionally add `--option "@typespec/http-client-java.emitter-output-dir=$PWD/tsp-output/"` to isolate output into a subfolder for an easier diff.) 7. Verify the generated code under `tsp-output/**/src` is as expected. When the spec corresponds to sources tracked in `src/main/java`, compare against them and, if correct, copy the generated files into `src` (replacing existing files) but EXCLUDE `module-info.java`. Some specs do not map to `src` — in that case just verify the output, without comparing or copying. -8. When the spec maps to `src` and you copied the generated code in, run the tests (`mvn test`, or a targeted `"-Dtest=."`). Restart the Spector server if needed (`npm run spector-stop` then `npm run spector-start`). If the spec does not map to `src`, verifying the generated output (step 7) is sufficient. +8. When the spec maps to `src` and you copied the generated code in, run the tests (`mvn test`, or a targeted `--define "test=."`). Restart the Spector server if needed (`npm run spector-stop` then `npm run spector-start`). If the spec does not map to `src`, verifying the generated output (step 7) is sufficient. ## Emitting static helper classes from resource templates From ac56a3702f8eb5cd20db77e0f81014a633ff57ec Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 13:28:55 +0800 Subject: [PATCH 10/12] format --- .github/instructions/http-client-java.instructions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/instructions/http-client-java.instructions.md b/.github/instructions/http-client-java.instructions.md index 8bde5eff8a8..5dd01219f75 100644 --- a/.github/instructions/http-client-java.instructions.md +++ b/.github/instructions/http-client-java.instructions.md @@ -89,4 +89,3 @@ Some helpers are shipped verbatim as resource templates rather than built up in - `generator/http-client-generator/src/main/java/.../TypeSpecPlugin.java` — `writeHelperClasses(...)` emits per-client helper classes into the implementation subpackage via `JavaPackage.addJavaFromResources(packageName, resourceName[, fileName])`. - Resource templates live under `generator/http-client-generator-core/src/main/resources/*.java` and must START with `import` statements — do NOT include a `package` line or the license header. The file factory injects the license header, the `package` statement, and reorders imports. The class name must match the resource/file name. - Class-name constants live in `generator/http-client-generator-core/src/main/java/.../util/ClientModelUtil.java`. - From 733e44401471b7d46214e1b6645799aa6d46110d Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 13:49:25 +0800 Subject: [PATCH 11/12] Address review feedback: consistent XML serializer check in sync client template Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../core/template/ConvenienceMethodTemplateBase.java | 1 + .../core/template/ServiceSyncClientTemplate.java | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java index 3e24d654c4e..4190388e18a 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java @@ -105,6 +105,7 @@ public boolean useXmlSerializerMember(Collection convenienceM if (!isMethodIncluded(convenienceMethod)) { continue; } + // getResponseKnownMimeType simply parses a MIME string, so it is reused here for the request content type. String requestContentType = convenienceMethod.getProtocolMethod().getProxyMethod().getRequestContentType(); if (requestContentType != null && SupportedMimeType.getResponseKnownMimeType(List.of(requestContentType)) == SupportedMimeType.XML) { diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java index e9b16f4cf3e..4ed313de35e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java @@ -73,7 +73,7 @@ public final void write(AsyncSyncClient syncClient, JavaFile javaFile) { Templates.getConvenienceSyncMethodTemplate().addImports(imports, syncClient.getConvenienceMethods()); - if (Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods())) { + if (useXmlSerializerMember(syncClient)) { imports.add("com.azure.core.util.serializer.ObjectSerializer"); imports.add(settings.getPackage(settings.getImplementationSubpackage()) + "." + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); @@ -113,7 +113,7 @@ protected void writeClass(AsyncSyncClient syncClient, JavaClass classBlock, Java final boolean wrapServiceClient = methodGroupClient == null; // Add service client member - if (Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods())) { + if (useXmlSerializerMember(syncClient)) { addGeneratedAnnotation(classBlock); classBlock.privateStaticFinalVariable( "ObjectSerializer " + ConvenienceMethodTemplateBase.XML_SERIALIZER_MEMBER_NAME + " = " @@ -218,6 +218,10 @@ protected void addGeneratedAnnotation(JavaContext classBlock) { classBlock.annotation(Annotation.GENERATED.getName()); } + private static boolean useXmlSerializerMember(AsyncSyncClient syncClient) { + return Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods()); + } + private void writeConvenienceMethods(List convenienceMethods, JavaClass classBlock) { Set typeReferenceStaticClasses = new LinkedHashSet<>(); From edd58f1c246ed1bf3a3ad0e487897e105d1f27c7 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 14:43:35 +0800 Subject: [PATCH 12/12] Update payload-xml metadata to include generated XmlSerializer helper files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a10e9989-905e-4380-a221-01c04f4da1f7 --- .../src/main/resources/META-INF/payload-xml_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json index c0ab62300be..1dba4b1f82c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Payload.Xml","crossLanguageVersion":"5b03b60108c5","crossLanguageDefinitions":{"payload.xml.ModelWithArrayOfModelValueAsyncClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueAsyncClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithAttributesValueAsyncClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueAsyncClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithDatetimeValueAsyncClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueAsyncClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDictionaryValueAsyncClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueAsyncClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueAsyncClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueAsyncClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEnumValueAsyncClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueAsyncClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceValueAsyncClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNestedModelValueAsyncClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueAsyncClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueAsyncClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueAsyncClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueAsyncClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueAsyncClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueAsyncClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithTextValueAsyncClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueAsyncClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.SimpleModelValueAsyncClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueAsyncClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueAsyncClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.XmlClientBuilder":"Payload.Xml","payload.xml.XmlErrorValueAsyncClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueAsyncClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueAsyncClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.models.Author":"Payload.Xml.Author","payload.xml.models.Book":"Payload.Xml.Book","payload.xml.models.ModelWithArrayOfModel":"Payload.Xml.ModelWithArrayOfModel","payload.xml.models.ModelWithAttributes":"Payload.Xml.ModelWithAttributes","payload.xml.models.ModelWithDatetime":"Payload.Xml.ModelWithDatetime","payload.xml.models.ModelWithDictionary":"Payload.Xml.ModelWithDictionary","payload.xml.models.ModelWithEmptyArray":"Payload.Xml.ModelWithEmptyArray","payload.xml.models.ModelWithEncodedNames":"Payload.Xml.ModelWithEncodedNames","payload.xml.models.ModelWithEnum":"Payload.Xml.ModelWithEnum","payload.xml.models.ModelWithNamespace":"Payload.Xml.ModelWithNamespace","payload.xml.models.ModelWithNamespaceOnProperties":"Payload.Xml.ModelWithNamespaceOnProperties","payload.xml.models.ModelWithNestedModel":"Payload.Xml.ModelWithNestedModel","payload.xml.models.ModelWithOptionalField":"Payload.Xml.ModelWithOptionalField","payload.xml.models.ModelWithRenamedArrays":"Payload.Xml.ModelWithRenamedArrays","payload.xml.models.ModelWithRenamedAttribute":"Payload.Xml.ModelWithRenamedAttribute","payload.xml.models.ModelWithRenamedFields":"Payload.Xml.ModelWithRenamedFields","payload.xml.models.ModelWithRenamedNestedModel":"Payload.Xml.ModelWithRenamedNestedModel","payload.xml.models.ModelWithRenamedProperty":"Payload.Xml.ModelWithRenamedProperty","payload.xml.models.ModelWithRenamedUnwrappedModelArray":"Payload.Xml.ModelWithRenamedUnwrappedModelArray","payload.xml.models.ModelWithRenamedWrappedAndItemModelArray":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArray","payload.xml.models.ModelWithRenamedWrappedModelArray":"Payload.Xml.ModelWithRenamedWrappedModelArray","payload.xml.models.ModelWithSimpleArrays":"Payload.Xml.ModelWithSimpleArrays","payload.xml.models.ModelWithText":"Payload.Xml.ModelWithText","payload.xml.models.ModelWithUnwrappedArray":"Payload.Xml.ModelWithUnwrappedArray","payload.xml.models.ModelWithUnwrappedModelArray":"Payload.Xml.ModelWithUnwrappedModelArray","payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNames","payload.xml.models.SimpleModel":"Payload.Xml.SimpleModel","payload.xml.models.Status":"Payload.Xml.Status"},"generatedFiles":["src/main/java/module-info.java","src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java","src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java","src/main/java/payload/xml/ModelWithAttributesValueClient.java","src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java","src/main/java/payload/xml/ModelWithDatetimeValueClient.java","src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java","src/main/java/payload/xml/ModelWithDictionaryValueClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java","src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java","src/main/java/payload/xml/ModelWithEnumValueClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java","src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceValueClient.java","src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithNestedModelValueClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java","src/main/java/payload/xml/ModelWithTextValueAsyncClient.java","src/main/java/payload/xml/ModelWithTextValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java","src/main/java/payload/xml/SimpleModelValueAsyncClient.java","src/main/java/payload/xml/SimpleModelValueClient.java","src/main/java/payload/xml/XmlClientBuilder.java","src/main/java/payload/xml/XmlErrorValueAsyncClient.java","src/main/java/payload/xml/XmlErrorValueClient.java","src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java","src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java","src/main/java/payload/xml/implementation/XmlClientImpl.java","src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java","src/main/java/payload/xml/implementation/package-info.java","src/main/java/payload/xml/models/Author.java","src/main/java/payload/xml/models/Book.java","src/main/java/payload/xml/models/ModelWithArrayOfModel.java","src/main/java/payload/xml/models/ModelWithAttributes.java","src/main/java/payload/xml/models/ModelWithDatetime.java","src/main/java/payload/xml/models/ModelWithDictionary.java","src/main/java/payload/xml/models/ModelWithEmptyArray.java","src/main/java/payload/xml/models/ModelWithEncodedNames.java","src/main/java/payload/xml/models/ModelWithEnum.java","src/main/java/payload/xml/models/ModelWithNamespace.java","src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java","src/main/java/payload/xml/models/ModelWithNestedModel.java","src/main/java/payload/xml/models/ModelWithOptionalField.java","src/main/java/payload/xml/models/ModelWithRenamedArrays.java","src/main/java/payload/xml/models/ModelWithRenamedAttribute.java","src/main/java/payload/xml/models/ModelWithRenamedFields.java","src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java","src/main/java/payload/xml/models/ModelWithRenamedProperty.java","src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java","src/main/java/payload/xml/models/ModelWithSimpleArrays.java","src/main/java/payload/xml/models/ModelWithText.java","src/main/java/payload/xml/models/ModelWithUnwrappedArray.java","src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java","src/main/java/payload/xml/models/SimpleModel.java","src/main/java/payload/xml/models/Status.java","src/main/java/payload/xml/models/package-info.java","src/main/java/payload/xml/package-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Payload.Xml","crossLanguageVersion":"5b03b60108c5","crossLanguageDefinitions":{"payload.xml.ModelWithArrayOfModelValueAsyncClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueAsyncClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithAttributesValueAsyncClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueAsyncClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithDatetimeValueAsyncClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueAsyncClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDictionaryValueAsyncClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueAsyncClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueAsyncClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueAsyncClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEnumValueAsyncClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueAsyncClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceValueAsyncClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNestedModelValueAsyncClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueAsyncClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueAsyncClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueAsyncClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueAsyncClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueAsyncClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueAsyncClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithTextValueAsyncClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueAsyncClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.SimpleModelValueAsyncClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueAsyncClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueAsyncClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.XmlClientBuilder":"Payload.Xml","payload.xml.XmlErrorValueAsyncClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueAsyncClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueAsyncClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.models.Author":"Payload.Xml.Author","payload.xml.models.Book":"Payload.Xml.Book","payload.xml.models.ModelWithArrayOfModel":"Payload.Xml.ModelWithArrayOfModel","payload.xml.models.ModelWithAttributes":"Payload.Xml.ModelWithAttributes","payload.xml.models.ModelWithDatetime":"Payload.Xml.ModelWithDatetime","payload.xml.models.ModelWithDictionary":"Payload.Xml.ModelWithDictionary","payload.xml.models.ModelWithEmptyArray":"Payload.Xml.ModelWithEmptyArray","payload.xml.models.ModelWithEncodedNames":"Payload.Xml.ModelWithEncodedNames","payload.xml.models.ModelWithEnum":"Payload.Xml.ModelWithEnum","payload.xml.models.ModelWithNamespace":"Payload.Xml.ModelWithNamespace","payload.xml.models.ModelWithNamespaceOnProperties":"Payload.Xml.ModelWithNamespaceOnProperties","payload.xml.models.ModelWithNestedModel":"Payload.Xml.ModelWithNestedModel","payload.xml.models.ModelWithOptionalField":"Payload.Xml.ModelWithOptionalField","payload.xml.models.ModelWithRenamedArrays":"Payload.Xml.ModelWithRenamedArrays","payload.xml.models.ModelWithRenamedAttribute":"Payload.Xml.ModelWithRenamedAttribute","payload.xml.models.ModelWithRenamedFields":"Payload.Xml.ModelWithRenamedFields","payload.xml.models.ModelWithRenamedNestedModel":"Payload.Xml.ModelWithRenamedNestedModel","payload.xml.models.ModelWithRenamedProperty":"Payload.Xml.ModelWithRenamedProperty","payload.xml.models.ModelWithRenamedUnwrappedModelArray":"Payload.Xml.ModelWithRenamedUnwrappedModelArray","payload.xml.models.ModelWithRenamedWrappedAndItemModelArray":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArray","payload.xml.models.ModelWithRenamedWrappedModelArray":"Payload.Xml.ModelWithRenamedWrappedModelArray","payload.xml.models.ModelWithSimpleArrays":"Payload.Xml.ModelWithSimpleArrays","payload.xml.models.ModelWithText":"Payload.Xml.ModelWithText","payload.xml.models.ModelWithUnwrappedArray":"Payload.Xml.ModelWithUnwrappedArray","payload.xml.models.ModelWithUnwrappedModelArray":"Payload.Xml.ModelWithUnwrappedModelArray","payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNames","payload.xml.models.SimpleModel":"Payload.Xml.SimpleModel","payload.xml.models.Status":"Payload.Xml.Status"},"generatedFiles":["src/main/java/module-info.java","src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java","src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java","src/main/java/payload/xml/ModelWithAttributesValueClient.java","src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java","src/main/java/payload/xml/ModelWithDatetimeValueClient.java","src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java","src/main/java/payload/xml/ModelWithDictionaryValueClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java","src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java","src/main/java/payload/xml/ModelWithEnumValueClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java","src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceValueClient.java","src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithNestedModelValueClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java","src/main/java/payload/xml/ModelWithTextValueAsyncClient.java","src/main/java/payload/xml/ModelWithTextValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java","src/main/java/payload/xml/SimpleModelValueAsyncClient.java","src/main/java/payload/xml/SimpleModelValueClient.java","src/main/java/payload/xml/XmlClientBuilder.java","src/main/java/payload/xml/XmlErrorValueAsyncClient.java","src/main/java/payload/xml/XmlErrorValueClient.java","src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java","src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java","src/main/java/payload/xml/implementation/XmlClientImpl.java","src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java","src/main/java/payload/xml/implementation/XmlSerializer.java","src/main/java/payload/xml/implementation/XmlSerializerProviders.java","src/main/java/payload/xml/implementation/package-info.java","src/main/java/payload/xml/models/Author.java","src/main/java/payload/xml/models/Book.java","src/main/java/payload/xml/models/ModelWithArrayOfModel.java","src/main/java/payload/xml/models/ModelWithAttributes.java","src/main/java/payload/xml/models/ModelWithDatetime.java","src/main/java/payload/xml/models/ModelWithDictionary.java","src/main/java/payload/xml/models/ModelWithEmptyArray.java","src/main/java/payload/xml/models/ModelWithEncodedNames.java","src/main/java/payload/xml/models/ModelWithEnum.java","src/main/java/payload/xml/models/ModelWithNamespace.java","src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java","src/main/java/payload/xml/models/ModelWithNestedModel.java","src/main/java/payload/xml/models/ModelWithOptionalField.java","src/main/java/payload/xml/models/ModelWithRenamedArrays.java","src/main/java/payload/xml/models/ModelWithRenamedAttribute.java","src/main/java/payload/xml/models/ModelWithRenamedFields.java","src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java","src/main/java/payload/xml/models/ModelWithRenamedProperty.java","src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java","src/main/java/payload/xml/models/ModelWithSimpleArrays.java","src/main/java/payload/xml/models/ModelWithText.java","src/main/java/payload/xml/models/ModelWithUnwrappedArray.java","src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java","src/main/java/payload/xml/models/SimpleModel.java","src/main/java/payload/xml/models/Status.java","src/main/java/payload/xml/models/package-info.java","src/main/java/payload/xml/package-info.java"]} \ No newline at end of file