diff --git a/generate.bat b/generate.bat index afcc5f484f..6e99793210 100755 --- a/generate.bat +++ b/generate.bat @@ -1,6 +1,7 @@ set VANILLA_ARGUMENTS=--version=3.1.3 --java --use=. --output-folder=vanilla-tests --sync-methods=all --client-side-validations --add-context-parameter --required-parameter-client-methods set AZURE_ARGUMENTS=--version=3.1.3 --java --use=. --output-folder=azure-tests --sync-methods=all --client-side-validations --add-context-parameter --required-parameter-client-methods set ARM_ARGUMENTS=--version=3.1.3 --java --use=. --output-folder=azure-tests --azure-arm --fluent=lite --regenerate-pom=false +set PROTOCOL_ARGUMENTS=--version=3.1.3 --java --use=./ --output-folder=protocol-tests --sync-methods=all --generate-client-as-impl --add-context-parameter --context-client-method-parameter --generate-sync-async-clients --low-level-client call autorest %VANILLA_ARGUMENTS% --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/additionalProperties.json --namespace=fixtures.additionalproperties call autorest %VANILLA_ARGUMENTS% --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-array.json --namespace=fixtures.bodyarray @@ -51,6 +52,8 @@ rem call autorest %ARM_ARGUMENTS% --input-file=https://raw.githubusercontent.com rem call autorest %ARM_ARGUMENTS% --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/lro-parameterized-endpoints.json --namespace=fixtures.lroparameterizedendpoints rem del azure-tests\src\main\java\module-info.java +call autorest $PROTOCOL_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-string.json --namespace=fixtures.bodystring + call autorest --use:. customization-tests/swagger call autorest --use:. docs/samples/specification/azure_key_credential/readme.md diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ClientMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ClientMapper.java index 383cce8e74..9107f54354 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ClientMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ClientMapper.java @@ -302,7 +302,6 @@ private static ModuleInfo moduleInfo() { List requireModules = moduleInfo.getRequireModules(); requireModules.add(new ModuleInfo.RequireModule("com.azure.core", true)); - requireModules.add(new ModuleInfo.RequireModule("com.azure.core.experimental", true)); List exportModules = moduleInfo.getExportModules(); exportModules.add(new ModuleInfo.ExportModule(settings.getPackage())); diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java index 40eeecce05..1f9f4f9ce5 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java @@ -126,7 +126,8 @@ public List map(Operation operation) { List codeModelParameters; if (settings.isLowLevelClient()) { - codeModelParameters = request.getParameters().stream().filter(Value::isRequired).collect(Collectors.toList()); + codeModelParameters = request.getParameters().stream().filter(p -> + p.isRequired() && !(p.getSchema().getType() == Schema.AllSchemaTypes.GROUP)).collect(Collectors.toList()); } else { codeModelParameters = request.getParameters().stream().filter(p -> !p.isFlattened()).collect(Collectors.toList()); } diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ProxyMethodMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ProxyMethodMapper.java index 9e063ab043..52fad71d5e 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ProxyMethodMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ProxyMethodMapper.java @@ -157,21 +157,23 @@ public Map map(Operation operation) { } } // RequestOptions - ProxyMethodParameter requestOptions = new ProxyMethodParameter.Builder() - .description("The options to configure the HTTP request before HTTP client sends it") - .wireType(ClassType.RequestOptions) - .clientType(ClassType.RequestOptions) - .name("requestOptions") - .requestParameterLocation(RequestParameterLocation.None) - .requestParameterName("requestOptions") - .alreadyEncoded(true) - .isConstant(false) - .isRequired(false) - .isNullable(false) - .fromClient(false) - .parameterReference("requestOptions") - .build(); - parameters.add(requestOptions); + if (settings.isLowLevelClient()) { + ProxyMethodParameter requestOptions = new ProxyMethodParameter.Builder() + .description("The options to configure the HTTP request before HTTP client sends it") + .wireType(ClassType.RequestOptions) + .clientType(ClassType.RequestOptions) + .name("requestOptions") + .requestParameterLocation(RequestParameterLocation.None) + .requestParameterName("requestOptions") + .alreadyEncoded(true) + .isConstant(false) + .isRequired(false) + .isNullable(false) + .fromClient(false) + .parameterReference("requestOptions") + .build(); + parameters.add(requestOptions); + } if (settings.getAddContextParameter()) { ClassType contextClassType = getContextClass(); diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ProxyParameterMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ProxyParameterMapper.java index b4e14c5e4b..6b1cbd6947 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ProxyParameterMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ProxyParameterMapper.java @@ -43,20 +43,27 @@ public ProxyMethodParameter map(Parameter parameter) { } builder.headerCollectionPrefix(headerCollectionPrefix); + RequestParameterLocation parameterRequestLocation = parameter.getProtocol().getHttp().getIn(); + builder.requestParameterLocation(parameterRequestLocation); + + boolean parameterIsServiceClientProperty = parameter.getImplementation() == Parameter.ImplementationLocation.CLIENT; + builder.fromClient(parameterIsServiceClientProperty); + Schema ParameterJvWireType = parameter.getSchema(); IType wireType = Mappers.getSchemaMapper().map(ParameterJvWireType); if (parameter.isNullable() || !parameter.isRequired()) { wireType = wireType.asNullable(); } IType clientType = wireType.getClientType(); + if (settings.isLowLevelClient() && !(clientType instanceof PrimitiveType)) { + if (parameterRequestLocation == RequestParameterLocation.Body /*&& parameterRequestLocation != RequestParameterLocation.FormData*/) { + clientType = ClassType.BinaryData; + } else { + clientType = ClassType.String; + } + } builder.clientType(clientType); - RequestParameterLocation parameterRequestLocation = parameter.getProtocol().getHttp().getIn(); - builder.requestParameterLocation(parameterRequestLocation); - - boolean parameterIsServiceClientProperty = parameter.getImplementation() == Parameter.ImplementationLocation.CLIENT; - builder.fromClient(parameterIsServiceClientProperty); - if (wireType instanceof ListType && settings.shouldGenerateXmlSerialization() && parameterRequestLocation == RequestParameterLocation.Body){ String parameterTypePackage = settings.getPackage(settings.getImplementationSubpackage()); String parameterTypeName = CodeNamer diff --git a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClassType.java b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClassType.java index 27b42eabb9..23aa1f88ef 100644 --- a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClassType.java +++ b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ClassType.java @@ -73,7 +73,7 @@ public class ClassType implements IType { public static final ClassType AndroidRetryPolicy = new ClassType.Builder().packageName("com.azure.android.core.http.policy").name("RetryPolicy").build(); public static final ClassType JsonPatchDocument = new ClassType.Builder().knownClass(com.azure.core.models.JsonPatchDocument.class).build(); - public static final ClassType BinaryData = new ClassType.Builder().knownClass(com.azure.core.util.BinaryData.class).build(); + public static final ClassType BinaryData = new ClassType.Builder().knownClass(com.azure.core.util.BinaryData.class).defaultValueExpressionConverter((String defaultValueExpression) -> java.lang.String.format("BinaryData.fromObject(\"%s\")", defaultValueExpression)).build(); public static final ClassType RequestOptions = new Builder().packageName("com.azure.core.http").name("RequestOptions").build(); diff --git a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethodParameter.java b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethodParameter.java index ad16015898..ca547a1f1d 100644 --- a/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethodParameter.java +++ b/javagen/src/main/java/com/azure/autorest/model/clientmodel/ProxyMethodParameter.java @@ -188,8 +188,7 @@ public final String convertFromClientType(String source, String target) { //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public string ConvertFromClientType(string source, string target, bool alwaysNull = false, bool alwaysNonNull = false) public final String convertFromClientType(String source, String target, boolean alwaysNull, boolean alwaysNonNull) { - IType clientType = getWireType().getClientType(); - if (clientType == getWireType()) { + if (getClientType() == getWireType()) { return String.format("%1$s %2$s = %3$s;", getWireType(), target, source); } if (alwaysNull) { diff --git a/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java b/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java index a62d59d42e..d9b6407738 100644 --- a/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java +++ b/javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java @@ -8,12 +8,18 @@ import com.azure.autorest.extension.base.plugin.JavaSettings; import com.azure.autorest.model.clientmodel.ArrayType; import com.azure.autorest.model.clientmodel.ClassType; +import com.azure.autorest.model.clientmodel.ClientEnumValue; import com.azure.autorest.model.clientmodel.ClientMethod; import com.azure.autorest.model.clientmodel.ClientMethodParameter; import com.azure.autorest.model.clientmodel.ClientMethodType; +import com.azure.autorest.model.clientmodel.ClientModel; +import com.azure.autorest.model.clientmodel.ClientModelProperty; +import com.azure.autorest.model.clientmodel.ClientModels; +import com.azure.autorest.model.clientmodel.EnumType; import com.azure.autorest.model.clientmodel.GenericType; import com.azure.autorest.model.clientmodel.IType; import com.azure.autorest.model.clientmodel.ListType; +import com.azure.autorest.model.clientmodel.MapType; import com.azure.autorest.model.clientmodel.MethodTransformationDetail; import com.azure.autorest.model.clientmodel.ParameterMapping; import com.azure.autorest.model.clientmodel.PrimitiveType; @@ -30,10 +36,13 @@ import com.azure.core.util.CoreUtils; import io.netty.handler.codec.http.HttpResponseStatus; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -556,7 +565,13 @@ protected void generateSyncMethod(ClientMethod clientMethod, JavaType typeBlock, */ public static void generateJavadoc(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, boolean useFullClassName) { // interface need a fully-qualified exception class name, since exception is usually only included in ProxyMethod - typeBlock.javadocComment(comment -> generateJavadoc(clientMethod, comment, restAPIMethod, useFullClassName)); + typeBlock.javadocComment(comment -> { + if (JavaSettings.getInstance().isLowLevelClient()) { + generateProtocolMethodJavadoc(clientMethod, comment); + } else { + generateJavadoc(clientMethod, comment, restAPIMethod, useFullClassName); + } + }); } /** @@ -601,6 +616,149 @@ protected static String parameterDescriptionOrDefault(ClientMethodParameter para return paramJavadoc; } + private static void generateProtocolMethodJavadoc(ClientMethod clientMethod, JavaJavadocComment commentBlock) { + commentBlock.description(clientMethod.getDescription()); + + List optionalQueryParameters = clientMethod.getProxyMethod().getParameters() + .stream().filter(p -> RequestParameterLocation.Query.equals(p.getRequestParameterLocation()) && !p.getIsRequired()) + .collect(Collectors.toList()); + if (!optionalQueryParameters.isEmpty()) { + optionalParametersJavadoc("Optional Query Parameters", optionalQueryParameters, commentBlock); + } + + List optionalHeaderParameters = clientMethod.getProxyMethod().getParameters() + .stream().filter(p -> RequestParameterLocation.Header.equals(p.getRequestParameterLocation()) && !p.getIsRequired()) + .collect(Collectors.toList()); + if (!optionalHeaderParameters.isEmpty()) { + optionalParametersJavadoc("Optional Header Parameters", optionalHeaderParameters, commentBlock); + } + + Set typesInJavadoc = new HashSet<>(); + clientMethod.getMethodInputParameters() + .stream().filter(p -> RequestParameterLocation.Body.equals(p.getLocation())) + .map(ClientMethodParameter::getClientType) + .findFirst() + .ifPresent(iType -> requestBodySchemaJavadoc(iType, commentBlock, typesInJavadoc)); + + IType responseBodyType = clientMethod.getProxyMethod().getResponseBodyType(); + if (responseBodyType != null && !responseBodyType.equals(PrimitiveType.Void)) { + responseBodySchemaJavadoc(responseBodyType, commentBlock, typesInJavadoc); + } + + clientMethod.getProxyMethod().getParameters() + .stream().filter(p -> p.getIsRequired() && !p.getFromClient() && !p.getIsConstant() + && p.getRequestParameterLocation() != RequestParameterLocation.Body) + .forEach(parameter -> + commentBlock.param(parameter.getName(), parameterDescriptionOrDefault(parameter))); + + commentBlock.methodReturns("a DynamicRequest where customizations can be made before sent to the service"); + } + + private static void optionalParametersJavadoc(String title, List parameters, JavaJavadocComment commentBlock) { + commentBlock.line(String.format("

%s

", title)); + commentBlock.line(""); + commentBlock.line(String.format(" ", title)); + commentBlock.line(" "); + for (ProxyMethodParameter parameter : parameters) { + commentBlock.line(String.format(" ", + parameter.getName(), CodeNamer.escapeXmlComment(parameter.getClientType().toString()), parameterDescriptionOrDefault(parameter))); + } + commentBlock.line("
%s
NameTypeDescription
%s%s%s
"); + } + + private static void requestBodySchemaJavadoc(IType requestBodyType, JavaJavadocComment commentBlock, Set typesInJavadoc) { + if (requestBodyType == null) { + return; + } + commentBlock.line("

Request Body Schema

"); + commentBlock.line("
{@code");
+        bodySchemaJavadoc(requestBodyType, commentBlock, "", null, typesInJavadoc);
+        commentBlock.line("}
"); + } + + private static void responseBodySchemaJavadoc(IType responseBodyType, JavaJavadocComment commentBlock, Set typesInJavadoc) { + if (responseBodyType == null) { + return; + } + commentBlock.line("

Response Body Schema

"); + commentBlock.line("
{@code");
+        bodySchemaJavadoc(responseBodyType, commentBlock, "", null, typesInJavadoc);
+        commentBlock.line("}
"); + } + + private static void bodySchemaJavadoc(IType type, JavaJavadocComment commentBlock, String indent, String name, Set typesInJavadoc) { + String nextIndent = indent + " "; + if (type instanceof ClassType + && ((ClassType) type).getPackage().startsWith(JavaSettings.getInstance().getPackage()) + && !typesInJavadoc.contains(type)) { + typesInJavadoc.add(type); + ClientModel model = ClientModels.Instance.getModel(((ClassType) type).getName()); + if (name != null) { + commentBlock.line(indent + name + ": {"); + } else { + commentBlock.line(indent + "{"); + } + List properties = new ArrayList<>(); + traverseProperties(model, properties); + for (ClientModelProperty property : properties) { + bodySchemaJavadoc(property.getClientType(), commentBlock, nextIndent, property.getName(), typesInJavadoc); + } + commentBlock.line(indent + "}"); + } else if (typesInJavadoc.contains(type)) { + if (name != null) { + commentBlock.line(indent + name + ": (recursive schema, see " + name + " above)"); + } else { + commentBlock.line(indent + "(recursive schema, see above)"); + } + } else if (type instanceof ListType) { + if (name != null) { + commentBlock.line(indent + name + ": ["); + } else { + commentBlock.line(indent + "["); + } + bodySchemaJavadoc(((ListType) type).getElementType(), commentBlock, nextIndent, null, typesInJavadoc); + commentBlock.line(indent + "]"); + } else if (type instanceof EnumType) { + String values = ((EnumType) type).getValues().stream() + .map(ClientEnumValue::getValue) + .collect(Collectors.joining("/")); + if (name != null) { + commentBlock.line(indent + name + ": String(" + values + ")"); + } else { + commentBlock.line(indent + "String(" + values + ")"); + } + } else if (type instanceof MapType) { + if (name != null) { + commentBlock.line(indent + name + ": {"); + } else { + commentBlock.line(indent + "{"); + } + bodySchemaJavadoc(((MapType) type).getValueType(), commentBlock, nextIndent, "String", typesInJavadoc); + commentBlock.line(indent + "}"); + } else { + if (name != null) { + commentBlock.line(indent + name + ": " + type.toString()); + } else { + commentBlock.line(indent + type.toString()); + } + } + } + + private static void traverseProperties(ClientModel model, List properties) { + if (model.getParentModelName() != null) { + traverseProperties(ClientModels.Instance.getModel(model.getParentModelName()), properties); + } + properties.addAll(model.getProperties()); + } + + private static String parameterDescriptionOrDefault(ProxyMethodParameter parameter) { + String paramJavadoc = parameter.getDescription(); + if (CoreUtils.isNullOrEmpty(paramJavadoc)) { + paramJavadoc = String.format("The %1$s parameter", parameter.getName()); + } + return CodeNamer.escapeXmlComment(paramJavadoc); + } + protected void generatePagedAsyncSinglePage(ClientMethod clientMethod, JavaType typeBlock, ProxyMethod restAPIMethod, JavaSettings settings) { typeBlock.annotation("ServiceMethod(returns = ReturnType.SINGLE)"); diff --git a/javagen/src/main/java/com/azure/autorest/template/protocol/ProtocolMethodBaseTemplate.java b/javagen/src/main/java/com/azure/autorest/template/protocol/ProtocolMethodBaseTemplate.java index e480b65293..64e20c4327 100644 --- a/javagen/src/main/java/com/azure/autorest/template/protocol/ProtocolMethodBaseTemplate.java +++ b/javagen/src/main/java/com/azure/autorest/template/protocol/ProtocolMethodBaseTemplate.java @@ -43,155 +43,9 @@ public abstract class ProtocolMethodBaseTemplate implements IJavaTemplate generateJavadoc(clientMethod, comment)); - } - - /** - * Generate javadoc for client method. - * - * @param clientMethod client method - * @param commentBlock comment block - */ - public static void generateJavadoc(ClientMethod clientMethod, JavaJavadocComment commentBlock) { - commentBlock.description(clientMethod.getDescription()); - - List optionalQueryParameters = clientMethod.getProxyMethod().getParameters() - .stream().filter(p -> RequestParameterLocation.Query.equals(p.getRequestParameterLocation()) && !p.getIsRequired()) - .collect(Collectors.toList()); - if (!optionalQueryParameters.isEmpty()) { - optionalParametersJavadoc("Optional Query Parameters", optionalQueryParameters, commentBlock); - } - - List optionalHeaderParameters = clientMethod.getProxyMethod().getParameters() - .stream().filter(p -> RequestParameterLocation.Header.equals(p.getRequestParameterLocation()) && !p.getIsRequired()) - .collect(Collectors.toList()); - if (!optionalHeaderParameters.isEmpty()) { - optionalParametersJavadoc("Optional Header Parameters", optionalHeaderParameters, commentBlock); - } - - Set typesInJavadoc = new HashSet<>(); - clientMethod.getMethodInputParameters() - .stream().filter(p -> RequestParameterLocation.Body.equals(p.getLocation())) - .map(ClientMethodParameter::getClientType) - .findFirst() - .ifPresent(iType -> requestBodySchemaJavadoc(iType, commentBlock, typesInJavadoc)); - - IType responseBodyType = clientMethod.getProxyMethod().getResponseBodyType(); - if (responseBodyType != null && !responseBodyType.equals(PrimitiveType.Void)) { - responseBodySchemaJavadoc(responseBodyType, commentBlock, typesInJavadoc); - } - - clientMethod.getProxyMethod().getParameters() - .stream().filter(p -> p.getIsRequired() && !p.getFromClient() && !p.getIsConstant() - && p.getRequestParameterLocation() != RequestParameterLocation.Body) - .forEach(parameter -> - commentBlock.param(parameter.getName(), parameterDescriptionOrDefault(parameter))); + typeBlock.javadocComment(comment -> { - commentBlock.methodReturns("a DynamicRequest where customizations can be made before sent to the service"); + }); } - private static void optionalParametersJavadoc(String title, List parameters, JavaJavadocComment commentBlock) { - commentBlock.line(String.format("

%s

", title)); - commentBlock.line(""); - commentBlock.line(String.format(" ", title)); - commentBlock.line(" "); - for (ProxyMethodParameter parameter : parameters) { - commentBlock.line(String.format(" ", - parameter.getName(), CodeNamer.escapeXmlComment(parameter.getClientType().toString()), parameterDescriptionOrDefault(parameter))); - } - commentBlock.line("
%s
NameTypeDescription
%s%s%s
"); - } - - private static void requestBodySchemaJavadoc(IType requestBodyType, JavaJavadocComment commentBlock, Set typesInJavadoc) { - if (requestBodyType == null) { - return; - } - commentBlock.line("

Request Body Schema

"); - commentBlock.line("
{@code");
-        bodySchemaJavadoc(requestBodyType, commentBlock, "", null, typesInJavadoc);
-        commentBlock.line("}
"); - } - - private static void responseBodySchemaJavadoc(IType responseBodyType, JavaJavadocComment commentBlock, Set typesInJavadoc) { - if (responseBodyType == null) { - return; - } - commentBlock.line("

Response Body Schema

"); - commentBlock.line("
{@code");
-        bodySchemaJavadoc(responseBodyType, commentBlock, "", null, typesInJavadoc);
-        commentBlock.line("}
"); - } - - private static void bodySchemaJavadoc(IType type, JavaJavadocComment commentBlock, String indent, String name, Set typesInJavadoc) { - String nextIndent = indent + " "; - if (type instanceof ClassType - && ((ClassType) type).getPackage().startsWith(JavaSettings.getInstance().getPackage()) - && !typesInJavadoc.contains(type)) { - typesInJavadoc.add(type); - ClientModel model = ClientModels.Instance.getModel(((ClassType) type).getName()); - if (name != null) { - commentBlock.line(indent + name + ": {"); - } else { - commentBlock.line(indent + "{"); - } - List properties = new ArrayList<>(); - traverseProperties(model, properties); - for (ClientModelProperty property : properties) { - bodySchemaJavadoc(property.getClientType(), commentBlock, nextIndent, property.getName(), typesInJavadoc); - } - commentBlock.line(indent + "}"); - } else if (typesInJavadoc.contains(type)) { - if (name != null) { - commentBlock.line(indent + name + ": (recursive schema, see " + name + " above)"); - } else { - commentBlock.line(indent + "(recursive schema, see above)"); - } - } else if (type instanceof ListType) { - if (name != null) { - commentBlock.line(indent + name + ": ["); - } else { - commentBlock.line(indent + "["); - } - bodySchemaJavadoc(((ListType) type).getElementType(), commentBlock, nextIndent, null, typesInJavadoc); - commentBlock.line(indent + "]"); - } else if (type instanceof EnumType) { - String values = ((EnumType) type).getValues().stream() - .map(ClientEnumValue::getValue) - .collect(Collectors.joining("/")); - if (name != null) { - commentBlock.line(indent + name + ": String(" + values + ")"); - } else { - commentBlock.line(indent + "String(" + values + ")"); - } - } else if (type instanceof MapType) { - if (name != null) { - commentBlock.line(indent + name + ": {"); - } else { - commentBlock.line(indent + "{"); - } - bodySchemaJavadoc(((MapType) type).getValueType(), commentBlock, nextIndent, "String", typesInJavadoc); - commentBlock.line(indent + "}"); - } else { - if (name != null) { - commentBlock.line(indent + name + ": " + type.toString()); - } else { - commentBlock.line(indent + type.toString()); - } - } - } - - private static void traverseProperties(ClientModel model, List properties) { - if (model.getParentModelName() != null) { - traverseProperties(ClientModels.Instance.getModel(model.getParentModelName()), properties); - } - properties.addAll(model.getProperties()); - } - - private static String parameterDescriptionOrDefault(ProxyMethodParameter parameter) { - String paramJavadoc = parameter.getDescription(); - if (CoreUtils.isNullOrEmpty(paramJavadoc)) { - paramJavadoc = String.format("The %1$s parameter", parameter.getName()); - } - return CodeNamer.escapeXmlComment(paramJavadoc); - } } diff --git a/protocol-tests/pom.xml b/protocol-tests/pom.xml index 74643d80e5..92008fce08 100644 --- a/protocol-tests/pom.xml +++ b/protocol-tests/pom.xml @@ -49,6 +49,18 @@ 4.13.1 test + + javax.json + javax.json-api + 1.1.4 + test + + + org.glassfish + javax.json + 1.1.4 + test + diff --git a/protocol-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java b/protocol-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java index 0a3207e41a..99f5d9bebe 100644 --- a/protocol-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java +++ b/protocol-tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; @@ -92,11 +91,13 @@ Mono> putReferencedConstant( /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotExpandableWithResponseAsync(RequestOptions requestOptions) { @@ -108,12 +109,13 @@ public Mono> getNotExpandableWithResponseAsync(RequestOptions r /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotExpandableWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -124,11 +126,13 @@ public Mono> getNotExpandableWithResponseAsync(RequestOptions r /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNotExpandableAsync(RequestOptions requestOptions) { @@ -146,12 +150,13 @@ public Mono getNotExpandableAsync(RequestOptions requestOptions) { /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNotExpandableAsync(RequestOptions requestOptions, Context context) { @@ -169,11 +174,13 @@ public Mono getNotExpandableAsync(RequestOptions requestOptions, Context /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public String getNotExpandable(RequestOptions requestOptions) { @@ -183,12 +190,13 @@ public String getNotExpandable(RequestOptions requestOptions) { /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNotExpandableWithResponse(RequestOptions requestOptions, Context context) { @@ -198,52 +206,51 @@ public Response getNotExpandableWithResponse(RequestOptions requestOptio /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNotExpandableWithResponseAsync( BinaryData stringBody, RequestOptions requestOptions) { final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; return FluxUtil.withContext( context -> - service.putNotExpandable( - this.client.getHost(), stringBodyConverted, accept, requestOptions, context)); + service.putNotExpandable(this.client.getHost(), stringBody, accept, requestOptions, context)); } /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNotExpandableWithResponseAsync( BinaryData stringBody, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; - return service.putNotExpandable(this.client.getHost(), stringBodyConverted, accept, requestOptions, context); + return service.putNotExpandable(this.client.getHost(), stringBody, accept, requestOptions, context); } /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putNotExpandableAsync(BinaryData stringBody, RequestOptions requestOptions) { @@ -254,13 +261,13 @@ public Mono putNotExpandableAsync(BinaryData stringBody, RequestOptions re /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putNotExpandableAsync(BinaryData stringBody, RequestOptions requestOptions, Context context) { @@ -271,11 +278,13 @@ public Mono putNotExpandableAsync(BinaryData stringBody, RequestOptions re /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putNotExpandable(BinaryData stringBody, RequestOptions requestOptions) { @@ -285,13 +294,13 @@ public void putNotExpandable(BinaryData stringBody, RequestOptions requestOption /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNotExpandableWithResponse( @@ -302,11 +311,13 @@ public Response putNotExpandableWithResponse( /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedWithResponseAsync(RequestOptions requestOptions) { @@ -318,12 +329,13 @@ public Mono> getReferencedWithResponseAsync(RequestOptions requ /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -334,11 +346,13 @@ public Mono> getReferencedWithResponseAsync(RequestOptions requ /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getReferencedAsync(RequestOptions requestOptions) { @@ -356,12 +370,13 @@ public Mono getReferencedAsync(RequestOptions requestOptions) { /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getReferencedAsync(RequestOptions requestOptions, Context context) { @@ -379,11 +394,13 @@ public Mono getReferencedAsync(RequestOptions requestOptions, Context co /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public String getReferenced(RequestOptions requestOptions) { @@ -393,12 +410,13 @@ public String getReferenced(RequestOptions requestOptions) { /** * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + *

Response Body Schema + * + *

{@code
+     * String
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getReferencedWithResponse(RequestOptions requestOptions, Context context) { @@ -408,52 +426,51 @@ public Response getReferencedWithResponse(RequestOptions requestOptions, /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedWithResponseAsync( BinaryData enumStringBody, RequestOptions requestOptions) { final String accept = "application/json"; - BinaryData enumStringBodyConverted = enumStringBody; return FluxUtil.withContext( context -> - service.putReferenced( - this.client.getHost(), enumStringBodyConverted, accept, requestOptions, context)); + service.putReferenced(this.client.getHost(), enumStringBody, accept, requestOptions, context)); } /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedWithResponseAsync( BinaryData enumStringBody, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - BinaryData enumStringBodyConverted = enumStringBody; - return service.putReferenced(this.client.getHost(), enumStringBodyConverted, accept, requestOptions, context); + return service.putReferenced(this.client.getHost(), enumStringBody, accept, requestOptions, context); } /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putReferencedAsync(BinaryData enumStringBody, RequestOptions requestOptions) { @@ -464,13 +481,13 @@ public Mono putReferencedAsync(BinaryData enumStringBody, RequestOptions r /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putReferencedAsync(BinaryData enumStringBody, RequestOptions requestOptions, Context context) { @@ -481,11 +498,13 @@ public Mono putReferencedAsync(BinaryData enumStringBody, RequestOptions r /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putReferenced(BinaryData enumStringBody, RequestOptions requestOptions) { @@ -495,13 +514,13 @@ public void putReferenced(BinaryData enumStringBody, RequestOptions requestOptio /** * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putReferencedWithResponse( @@ -512,11 +531,13 @@ public Response putReferencedWithResponse( /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedConstantWithResponseAsync(RequestOptions requestOptions) { @@ -528,12 +549,13 @@ public Mono> getReferencedConstantWithResponseAsync(Request /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getReferencedConstantWithResponseAsync( @@ -545,11 +567,13 @@ public Mono> getReferencedConstantWithResponseAsync( /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getReferencedConstantAsync(RequestOptions requestOptions) { @@ -567,12 +591,13 @@ public Mono getReferencedConstantAsync(RequestOptions requestOptions /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getReferencedConstantAsync(RequestOptions requestOptions, Context context) { @@ -590,11 +615,13 @@ public Mono getReferencedConstantAsync(RequestOptions requestOptions /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getReferencedConstant(RequestOptions requestOptions) { @@ -604,12 +631,13 @@ public BinaryData getReferencedConstant(RequestOptions requestOptions) { /** * Get value 'green-color' from the constant. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value 'green-color' from the constant. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getReferencedConstantWithResponse(RequestOptions requestOptions, Context context) { @@ -619,53 +647,52 @@ public Response getReferencedConstantWithResponse(RequestOptions req /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedConstantWithResponseAsync( BinaryData enumStringBody, RequestOptions requestOptions) { final String accept = "application/json"; - BinaryData enumStringBodyConverted = enumStringBody; return FluxUtil.withContext( context -> service.putReferencedConstant( - this.client.getHost(), enumStringBodyConverted, accept, requestOptions, context)); + this.client.getHost(), enumStringBody, accept, requestOptions, context)); } /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReferencedConstantWithResponseAsync( BinaryData enumStringBody, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - BinaryData enumStringBodyConverted = enumStringBody; - return service.putReferencedConstant( - this.client.getHost(), enumStringBodyConverted, accept, requestOptions, context); + return service.putReferencedConstant(this.client.getHost(), enumStringBody, accept, requestOptions, context); } /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putReferencedConstantAsync(BinaryData enumStringBody, RequestOptions requestOptions) { @@ -676,13 +703,13 @@ public Mono putReferencedConstantAsync(BinaryData enumStringBody, RequestO /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putReferencedConstantAsync( @@ -694,11 +721,13 @@ public Mono putReferencedConstantAsync( /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putReferencedConstant(BinaryData enumStringBody, RequestOptions requestOptions) { @@ -708,13 +737,13 @@ public void putReferencedConstant(BinaryData enumStringBody, RequestOptions requ /** * Sends value 'green-color' from a constant. * - * @param enumStringBody enum string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putReferencedConstantWithResponse( diff --git a/protocol-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java b/protocol-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java index fca2bc9c18..eb326053fc 100644 --- a/protocol-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java +++ b/protocol-tests/src/main/java/fixtures/bodystring/implementation/StringOperationsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; @@ -144,11 +143,13 @@ Mono> getNullBase64UrlEncoded( /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -159,12 +160,13 @@ public Mono> getNullWithResponseAsync(RequestOptions reques /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -175,11 +177,13 @@ public Mono> getNullWithResponseAsync(RequestOptions reques /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNullAsync(RequestOptions requestOptions) { @@ -197,12 +201,13 @@ public Mono getNullAsync(RequestOptions requestOptions) { /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNullAsync(RequestOptions requestOptions, Context context) { @@ -220,11 +225,13 @@ public Mono getNullAsync(RequestOptions requestOptions, Context cont /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getNull(RequestOptions requestOptions) { @@ -234,12 +241,13 @@ public BinaryData getNull(RequestOptions requestOptions) { /** * Get null string value value. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null string value value. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions, Context context) { @@ -249,11 +257,7 @@ public Response getNullWithResponse(RequestOptions requestOptions, C /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNullWithResponseAsync(RequestOptions requestOptions) { @@ -264,12 +268,7 @@ public Mono> putNullWithResponseAsync(RequestOptions requestOptio /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNullWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -280,11 +279,7 @@ public Mono> putNullWithResponseAsync(RequestOptions requestOptio /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putNullAsync(RequestOptions requestOptions) { @@ -294,12 +289,7 @@ public Mono putNullAsync(RequestOptions requestOptions) { /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putNullAsync(RequestOptions requestOptions, Context context) { @@ -309,10 +299,7 @@ public Mono putNullAsync(RequestOptions requestOptions, Context context) { /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putNull(RequestOptions requestOptions) { @@ -322,12 +309,7 @@ public void putNull(RequestOptions requestOptions) { /** * Set string value null. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNullWithResponse(RequestOptions requestOptions, Context context) { @@ -337,11 +319,13 @@ public Response putNullWithResponse(RequestOptions requestOptions, Context /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync(RequestOptions requestOptions) { @@ -353,12 +337,13 @@ public Mono> getEmptyWithResponseAsync(RequestOptions reque /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -369,11 +354,13 @@ public Mono> getEmptyWithResponseAsync(RequestOptions reque /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getEmptyAsync(RequestOptions requestOptions) { @@ -391,12 +378,13 @@ public Mono getEmptyAsync(RequestOptions requestOptions) { /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getEmptyAsync(RequestOptions requestOptions, Context context) { @@ -414,11 +402,13 @@ public Mono getEmptyAsync(RequestOptions requestOptions, Context con /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getEmpty(RequestOptions requestOptions) { @@ -428,12 +418,13 @@ public BinaryData getEmpty(RequestOptions requestOptions) { /** * Get empty string value value ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return empty string value value ''. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getEmptyWithResponse(RequestOptions requestOptions, Context context) { @@ -443,48 +434,32 @@ public Response getEmptyWithResponse(RequestOptions requestOptions, /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(RequestOptions requestOptions) { - final String stringBody = ""; + final BinaryData stringBody = BinaryData.fromObject(""); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; return FluxUtil.withContext( - context -> - service.putEmpty(this.client.getHost(), stringBodyConverted, accept, requestOptions, context)); + context -> service.putEmpty(this.client.getHost(), stringBody, accept, requestOptions, context)); } /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(RequestOptions requestOptions, Context context) { - final String stringBody = ""; + final BinaryData stringBody = BinaryData.fromObject(""); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; - return service.putEmpty(this.client.getHost(), stringBodyConverted, accept, requestOptions, context); + return service.putEmpty(this.client.getHost(), stringBody, accept, requestOptions, context); } /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putEmptyAsync(RequestOptions requestOptions) { @@ -494,12 +469,7 @@ public Mono putEmptyAsync(RequestOptions requestOptions) { /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putEmptyAsync(RequestOptions requestOptions, Context context) { @@ -509,10 +479,7 @@ public Mono putEmptyAsync(RequestOptions requestOptions, Context context) /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putEmpty(RequestOptions requestOptions) { @@ -522,12 +489,7 @@ public void putEmpty(RequestOptions requestOptions) { /** * Set string value empty ''. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putEmptyWithResponse(RequestOptions requestOptions, Context context) { @@ -537,11 +499,13 @@ public Response putEmptyWithResponse(RequestOptions requestOptions, Contex /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMbcsWithResponseAsync(RequestOptions requestOptions) { @@ -552,12 +516,13 @@ public Mono> getMbcsWithResponseAsync(RequestOptions reques /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMbcsWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -568,11 +533,13 @@ public Mono> getMbcsWithResponseAsync(RequestOptions reques /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getMbcsAsync(RequestOptions requestOptions) { @@ -590,12 +557,13 @@ public Mono getMbcsAsync(RequestOptions requestOptions) { /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getMbcsAsync(RequestOptions requestOptions, Context context) { @@ -613,11 +581,13 @@ public Mono getMbcsAsync(RequestOptions requestOptions, Context cont /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getMbcs(RequestOptions requestOptions) { @@ -627,12 +597,13 @@ public BinaryData getMbcs(RequestOptions requestOptions) { /** * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getMbcsWithResponse(RequestOptions requestOptions, Context context) { @@ -642,48 +613,34 @@ public Response getMbcsWithResponse(RequestOptions requestOptions, C /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMbcsWithResponseAsync(RequestOptions requestOptions) { - final String stringBody = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"; + final BinaryData stringBody = + BinaryData.fromObject("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; return FluxUtil.withContext( - context -> - service.putMbcs(this.client.getHost(), stringBodyConverted, accept, requestOptions, context)); + context -> service.putMbcs(this.client.getHost(), stringBody, accept, requestOptions, context)); } /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putMbcsWithResponseAsync(RequestOptions requestOptions, Context context) { - final String stringBody = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"; + final BinaryData stringBody = + BinaryData.fromObject("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; - return service.putMbcs(this.client.getHost(), stringBodyConverted, accept, requestOptions, context); + return service.putMbcs(this.client.getHost(), stringBody, accept, requestOptions, context); } /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putMbcsAsync(RequestOptions requestOptions) { @@ -693,12 +650,7 @@ public Mono putMbcsAsync(RequestOptions requestOptions) { /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putMbcsAsync(RequestOptions requestOptions, Context context) { @@ -708,10 +660,7 @@ public Mono putMbcsAsync(RequestOptions requestOptions, Context context) { /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putMbcs(RequestOptions requestOptions) { @@ -721,12 +670,7 @@ public void putMbcs(RequestOptions requestOptions) { /** * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putMbcsWithResponse(RequestOptions requestOptions, Context context) { @@ -737,12 +681,13 @@ public Response putMbcsWithResponse(RequestOptions requestOptions, Context * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWhitespaceWithResponseAsync(RequestOptions requestOptions) { @@ -755,13 +700,13 @@ public Mono> getWhitespaceWithResponseAsync(RequestOptions * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWhitespaceWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -773,12 +718,13 @@ public Mono> getWhitespaceWithResponseAsync(RequestOptions * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getWhitespaceAsync(RequestOptions requestOptions) { @@ -797,13 +743,13 @@ public Mono getWhitespaceAsync(RequestOptions requestOptions) { * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getWhitespaceAsync(RequestOptions requestOptions, Context context) { @@ -822,12 +768,13 @@ public Mono getWhitespaceAsync(RequestOptions requestOptions, Contex * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getWhitespace(RequestOptions requestOptions) { @@ -838,13 +785,13 @@ public BinaryData getWhitespace(RequestOptions requestOptions) { * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value with leading and trailing whitespace '<tab><space><space>Now is the time - * for all good men to come to the aid of their country<tab><space><space>'. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWhitespaceWithResponse(RequestOptions requestOptions, Context context) { @@ -855,51 +802,36 @@ public Response getWhitespaceWithResponse(RequestOptions requestOpti * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWhitespaceWithResponseAsync(RequestOptions requestOptions) { - final String stringBody = " Now is the time for all good men to come to the aid of their country "; + final BinaryData stringBody = + BinaryData.fromObject(" Now is the time for all good men to come to the aid of their country "); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; return FluxUtil.withContext( - context -> - service.putWhitespace( - this.client.getHost(), stringBodyConverted, accept, requestOptions, context)); + context -> service.putWhitespace(this.client.getHost(), stringBody, accept, requestOptions, context)); } /** * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWhitespaceWithResponseAsync(RequestOptions requestOptions, Context context) { - final String stringBody = " Now is the time for all good men to come to the aid of their country "; + final BinaryData stringBody = + BinaryData.fromObject(" Now is the time for all good men to come to the aid of their country "); final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; - return service.putWhitespace(this.client.getHost(), stringBodyConverted, accept, requestOptions, context); + return service.putWhitespace(this.client.getHost(), stringBody, accept, requestOptions, context); } /** * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putWhitespaceAsync(RequestOptions requestOptions) { @@ -910,12 +842,7 @@ public Mono putWhitespaceAsync(RequestOptions requestOptions) { * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putWhitespaceAsync(RequestOptions requestOptions, Context context) { @@ -926,10 +853,7 @@ public Mono putWhitespaceAsync(RequestOptions requestOptions, Context cont * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putWhitespace(RequestOptions requestOptions) { @@ -940,12 +864,7 @@ public void putWhitespace(RequestOptions requestOptions) { * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for * all good men to come to the aid of their country<tab><space><space>'. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWhitespaceWithResponse(RequestOptions requestOptions, Context context) { @@ -955,11 +874,13 @@ public Response putWhitespaceWithResponse(RequestOptions requestOptions, C /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync(RequestOptions requestOptions) { @@ -971,12 +892,13 @@ public Mono> getNotProvidedWithResponseAsync(RequestOptions /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNotProvidedWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -987,11 +909,13 @@ public Mono> getNotProvidedWithResponseAsync(RequestOptions /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNotProvidedAsync(RequestOptions requestOptions) { @@ -1009,12 +933,13 @@ public Mono getNotProvidedAsync(RequestOptions requestOptions) { /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNotProvidedAsync(RequestOptions requestOptions, Context context) { @@ -1032,11 +957,13 @@ public Mono getNotProvidedAsync(RequestOptions requestOptions, Conte /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getNotProvided(RequestOptions requestOptions) { @@ -1046,12 +973,13 @@ public BinaryData getNotProvided(RequestOptions requestOptions) { /** * Get String value when no string value is sent in response payload. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value when no string value is sent in response payload. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNotProvidedWithResponse(RequestOptions requestOptions, Context context) { @@ -1061,11 +989,13 @@ public Response getNotProvidedWithResponse(RequestOptions requestOpt /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64EncodedWithResponseAsync(RequestOptions requestOptions) { @@ -1077,12 +1007,13 @@ public Mono> getBase64EncodedWithResponseAsync(RequestOptions r /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64EncodedWithResponseAsync(RequestOptions requestOptions, Context context) { @@ -1093,11 +1024,13 @@ public Mono> getBase64EncodedWithResponseAsync(RequestOptions r /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBase64EncodedAsync(RequestOptions requestOptions) { @@ -1115,12 +1048,13 @@ public Mono getBase64EncodedAsync(RequestOptions requestOptions) { /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBase64EncodedAsync(RequestOptions requestOptions, Context context) { @@ -1138,11 +1072,13 @@ public Mono getBase64EncodedAsync(RequestOptions requestOptions, Context /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public byte[] getBase64Encoded(RequestOptions requestOptions) { @@ -1152,12 +1088,13 @@ public byte[] getBase64Encoded(RequestOptions requestOptions) { /** * Get value that is base64 encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64 encoded. + *

Response Body Schema + * + *

{@code
+     * byte[]
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getBase64EncodedWithResponse(RequestOptions requestOptions, Context context) { @@ -1167,11 +1104,13 @@ public Response getBase64EncodedWithResponse(RequestOptions requestOptio /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64UrlEncodedWithResponseAsync(RequestOptions requestOptions) { @@ -1183,12 +1122,13 @@ public Mono> getBase64UrlEncodedWithResponseAsync(RequestOp /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBase64UrlEncodedWithResponseAsync( @@ -1200,11 +1140,13 @@ public Mono> getBase64UrlEncodedWithResponseAsync( /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBase64UrlEncodedAsync(RequestOptions requestOptions) { @@ -1222,12 +1164,13 @@ public Mono getBase64UrlEncodedAsync(RequestOptions requestOptions) /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBase64UrlEncodedAsync(RequestOptions requestOptions, Context context) { @@ -1245,11 +1188,13 @@ public Mono getBase64UrlEncodedAsync(RequestOptions requestOptions, /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getBase64UrlEncoded(RequestOptions requestOptions) { @@ -1259,12 +1204,13 @@ public BinaryData getBase64UrlEncoded(RequestOptions requestOptions) { /** * Get value that is base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return value that is base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getBase64UrlEncodedWithResponse(RequestOptions requestOptions, Context context) { @@ -1274,52 +1220,52 @@ public Response getBase64UrlEncodedWithResponse(RequestOptions reque /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBase64UrlEncodedWithResponseAsync( BinaryData stringBody, RequestOptions requestOptions) { final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; return FluxUtil.withContext( context -> service.putBase64UrlEncoded( - this.client.getHost(), stringBodyConverted, accept, requestOptions, context)); + this.client.getHost(), stringBody, accept, requestOptions, context)); } /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putBase64UrlEncodedWithResponseAsync( BinaryData stringBody, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - BinaryData stringBodyConverted = stringBody; - return service.putBase64UrlEncoded(this.client.getHost(), stringBodyConverted, accept, requestOptions, context); + return service.putBase64UrlEncoded(this.client.getHost(), stringBody, accept, requestOptions, context); } /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putBase64UrlEncodedAsync(BinaryData stringBody, RequestOptions requestOptions) { @@ -1330,13 +1276,13 @@ public Mono putBase64UrlEncodedAsync(BinaryData stringBody, RequestOptions /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putBase64UrlEncodedAsync(BinaryData stringBody, RequestOptions requestOptions, Context context) { @@ -1347,11 +1293,13 @@ public Mono putBase64UrlEncodedAsync(BinaryData stringBody, RequestOptions /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public void putBase64UrlEncoded(BinaryData stringBody, RequestOptions requestOptions) { @@ -1361,13 +1309,13 @@ public void putBase64UrlEncoded(BinaryData stringBody, RequestOptions requestOpt /** * Put value that is base64url encoded. * - * @param stringBody string body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException 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. + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putBase64UrlEncodedWithResponse( @@ -1378,11 +1326,13 @@ public Response putBase64UrlEncodedWithResponse( /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullBase64UrlEncodedWithResponseAsync(RequestOptions requestOptions) { @@ -1394,12 +1344,13 @@ public Mono> getNullBase64UrlEncodedWithResponseAsync(Reque /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullBase64UrlEncodedWithResponseAsync( @@ -1411,11 +1362,13 @@ public Mono> getNullBase64UrlEncodedWithResponseAsync( /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNullBase64UrlEncodedAsync(RequestOptions requestOptions) { @@ -1433,12 +1386,13 @@ public Mono getNullBase64UrlEncodedAsync(RequestOptions requestOptio /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNullBase64UrlEncodedAsync(RequestOptions requestOptions, Context context) { @@ -1456,11 +1410,13 @@ public Mono getNullBase64UrlEncodedAsync(RequestOptions requestOptio /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData getNullBase64UrlEncoded(RequestOptions requestOptions) { @@ -1470,12 +1426,13 @@ public BinaryData getNullBase64UrlEncoded(RequestOptions requestOptions) { /** * Get null value that is expected to be base64url encoded. * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return null value that is expected to be base64url encoded. + *

Response Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + * @return a DynamicRequest where customizations can be made before sent to the service. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullBase64UrlEncodedWithResponse(RequestOptions requestOptions, Context context) { diff --git a/protocol-tests/src/main/java/module-info.java b/protocol-tests/src/main/java/module-info.java index 0c94833a6a..f8ca70f8ef 100644 --- a/protocol-tests/src/main/java/module-info.java +++ b/protocol-tests/src/main/java/module-info.java @@ -1,6 +1,5 @@ module fixtures.bodystring { requires transitive com.azure.core; - requires transitive com.azure.core.experimental; exports fixtures.bodystring; } diff --git a/protocol-tests/src/test/java/fixtures/bodystring/EnumOperationsTests.java b/protocol-tests/src/test/java/fixtures/bodystring/EnumOperationsTests.java new file mode 100644 index 0000000000..0dde4042d7 --- /dev/null +++ b/protocol-tests/src/test/java/fixtures/bodystring/EnumOperationsTests.java @@ -0,0 +1,60 @@ +package fixtures.bodystring; + +import com.azure.core.util.BinaryData; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonReader; +import java.io.StringReader; +import java.util.concurrent.CountDownLatch; + +public class EnumOperationsTests { + private static EnumClient client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATServiceBuilder().buildEnumClient(); + } + + @Test + public void getNotExpandable() throws Exception { + String result = client.getNotExpandable(null); + Assert.assertEquals("red color", result); + } + + @Test + public void putNotExpandable() throws Exception { + client.putNotExpandable(BinaryData.fromObject("red color"), null); + } + + @Test + public void getReferenced() throws Exception { + String actual = client.getReferenced(null); + Assert.assertEquals("red color", actual); + } + + @Test + public void putReferenced() throws Exception { + client.putReferenced(BinaryData.fromObject("red color"), null); + } + + @Test + public void getReferencedConstant() throws Exception { + String res = client.getReferencedConstant(null).toString(); + JsonReader jsonReader = Json.createReader(new StringReader(res)); + JsonObject result = jsonReader.readObject(); + Assert.assertFalse(result.containsKey("ColorConstant")); + } + + @Test + public void putReferencedConstant() throws Exception { + JsonObject farm = Json.createObjectBuilder() + .add("ColorConstant", "green-color") + .build(); + client.putReferencedConstant(BinaryData.fromString(farm.toString()), null); + } +} diff --git a/protocol-tests/src/test/java/fixtures/bodystring/StringOperationsTests.java b/protocol-tests/src/test/java/fixtures/bodystring/StringOperationsTests.java new file mode 100644 index 0000000000..b2c8dd436a --- /dev/null +++ b/protocol-tests/src/test/java/fixtures/bodystring/StringOperationsTests.java @@ -0,0 +1,131 @@ +package fixtures.bodystring; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.util.Base64Util; +import com.azure.core.util.BinaryData; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class StringOperationsTests { + private static StringOperationClient client; + private static StringOperationAsyncClient asyncClient; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATServiceBuilder().buildStringOperationClient(); + asyncClient = new AutoRestSwaggerBATServiceBuilder().buildStringOperationAsyncClient(); + } + + @Test + public void getNull() throws Exception { + String result = client.getNull(null).toObject(String.class); + Assert.assertEquals(null, result); + } + + @Test + public void putNull() throws Exception { + try { + client.putNull(null); + } catch (Exception ex) { + Assert.assertEquals(IllegalArgumentException.class, ex.getClass()); + assertTrue(ex.getMessage().contains("Argument for @BodyParam parameter must be non-null")); + } + } + + @Test + public void getEmpty() throws Exception { + String result = client.getEmpty(null).toObject(String.class); + Assert.assertEquals("", result); + } + + @Test + public void putEmpty() throws Exception { + asyncClient.putEmptyWithResponse(null).subscribe(v -> {}, t -> fail(t.getMessage()), + () -> lock.countDown()); + assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void getMbcs() throws Exception { + String result = client.getMbcs(null).toObject(String.class); + String expected = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑ\uE7C7ɡ〇〾⿻⺁\uE843䜣\uE864€"; + Assert.assertEquals(expected, result); + } + + @Test + public void putMbcs() throws Exception { + client.putMbcs(null); + } + + @Test + public void getWhitespace() throws Exception { + String result = client.getWhitespace(null).toObject(String.class); + Assert.assertEquals(" Now is the time for all good men to come to the aid of their country ", result); + } + + @Test + public void putWhitespace() throws Exception { + client.putWhitespace(null); + } + + @Test + public void getNotProvided() throws Exception { + try { + client.getNotProvided(null); + } catch (Exception ex) { + Assert.assertEquals(HttpResponseException.class, ex.getClass()); + assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getBase64Encoded() throws Exception { + byte[] result = client.getBase64Encoded(null); + Assert.assertEquals("a string that gets encoded with base64", + new String(Base64.getDecoder().decode(unquote(new String(result, StandardCharsets.UTF_8))), StandardCharsets.UTF_8)); + } + + // copied from azure-core + private static String unquote(String string) { + if (string != null && !string.isEmpty()) { + final char firstCharacter = string.charAt(0); + if (firstCharacter == '\"' || firstCharacter == '\'') { + final int base64UrlStringLength = string.length(); + final char lastCharacter = string.charAt(base64UrlStringLength - 1); + if (lastCharacter == firstCharacter) { + string = string.substring(1, base64UrlStringLength - 1); + } + } + } + return string; + } + + @Test + public void getBase64UrlEncoded() throws Exception { + String result = client.getBase64UrlEncoded(null).toObject(String.class); + Assert.assertEquals("a string that gets encoded with base64url", + new String(Base64Util.decodeURL(result.getBytes(StandardCharsets.UTF_8)))); + } + + @Test + public void getNullBase64UrlEncoded() throws Exception { + byte[] result = client.getNullBase64UrlEncoded(null).toBytes(); + Assert.assertEquals(0, result.length); + } + + @Test + public void putBase64UrlEncoded() throws Exception { + client.putBase64UrlEncoded(BinaryData.fromObject(new String(Base64Util.encodeURLWithoutPadding( + "a string that gets encoded with base64url".getBytes(StandardCharsets.UTF_8)))), null); + } +}