diff --git a/AutoRest.sln b/AutoRest.sln
index a3b6f48ed2caa..f6f9818f25228 100644
--- a/AutoRest.sln
+++ b/AutoRest.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
-VisualStudioVersion = 14.0.25123.0
+VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRest.Core", "AutoRest\AutoRest.Core\AutoRest.Core.csproj", "{C876085F-9DC3-41F0-B7B4-17022CD84684}"
EndProject
@@ -120,6 +120,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRest.Generator.AzureRes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRest.Generator.AzureResourceSchema.Tests", "AutoRest\Generators\AzureResourceSchema\AzureResourceSchema.Tests\AutoRest.Generator.AzureResourceSchema.Tests.csproj", "{1C3B4A33-E045-4C8F-9202-1B651A686567}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRest.Generator.Azure.Java.Fluent", "AutoRest\Generators\Java\Azure.Java.Fluent\AutoRest.Generator.Azure.Java.Fluent.csproj", "{D35E97FD-E360-4DAA-96D0-DA45F32150B9}"
+EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CSharp.Tests", "AutoRest\Generators\CSharp\CSharp.Tests\CSharp.Tests.xproj", "{784D4B45-F12A-4B8F-A86C-35A080814A19}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Azure.CSharp.Tests", "AutoRest\Generators\CSharp\Azure.CSharp.Tests\Azure.CSharp.Tests.xproj", "{43DFEF27-2FD7-4827-A669-DFD2DD1CBBCC}"
@@ -496,6 +498,16 @@ Global
{1C3B4A33-E045-4C8F-9202-1B651A686567}.Portable-Release|Any CPU.Build.0 = Release|Any CPU
{1C3B4A33-E045-4C8F-9202-1B651A686567}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C3B4A33-E045-4C8F-9202-1B651A686567}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Net45-Debug|Any CPU.ActiveCfg = Net45-Debug|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Net45-Debug|Any CPU.Build.0 = Net45-Debug|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Net45-Release|Any CPU.ActiveCfg = Net45-Release|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Net45-Release|Any CPU.Build.0 = Net45-Release|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Portable-Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Portable-Debug|Any CPU.Build.0 = Portable-Debug|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Portable-Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Portable-Release|Any CPU.Build.0 = Portable-Release|Any CPU
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9}.Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
{784D4B45-F12A-4B8F-A86C-35A080814A19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{784D4B45-F12A-4B8F-A86C-35A080814A19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{784D4B45-F12A-4B8F-A86C-35A080814A19}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -574,6 +586,7 @@ Global
{B6A1FC1E-0779-4900-84EE-262DD0E53FF4} = {EF9E346D-70C6-45F5-8FF9-9B734F4A1298}
{654344A5-0556-49C7-BFB3-59676D7440D3} = {B6A1FC1E-0779-4900-84EE-262DD0E53FF4}
{1C3B4A33-E045-4C8F-9202-1B651A686567} = {B6A1FC1E-0779-4900-84EE-262DD0E53FF4}
+ {D35E97FD-E360-4DAA-96D0-DA45F32150B9} = {A9C01442-1E93-4C2D-9182-B61C9F53C3FF}
{784D4B45-F12A-4B8F-A86C-35A080814A19} = {03E75B1D-A443-4A12-B31F-860DB2B45140}
{43DFEF27-2FD7-4827-A669-DFD2DD1CBBCC} = {03E75B1D-A443-4A12-B31F-860DB2B45140}
{8192BAA3-C606-4D44-B0D7-46BE7AFA4096} = {03E75B1D-A443-4A12-B31F-860DB2B45140}
diff --git a/AutoRest/AutoRest.Core/CodeNamer.cs b/AutoRest/AutoRest.Core/CodeNamer.cs
index 6c1421c3d6964..6182518a4f7e4 100644
--- a/AutoRest/AutoRest.Core/CodeNamer.cs
+++ b/AutoRest/AutoRest.Core/CodeNamer.cs
@@ -114,7 +114,7 @@ public virtual void NormalizeClientModel(ServiceClient client)
throw new ArgumentNullException("client");
}
- client.Name = GetTypeName(client.Name);
+ client.Name = GetClientName(client.Name);
client.Namespace = GetNamespaceName(client.Namespace);
NormalizeClientProperties(client);
@@ -392,6 +392,15 @@ public virtual string GetMethodGroupName(string name)
return PascalCase(RemoveInvalidCharacters(GetEscapedReservedName(name, "Model")));
}
+ public virtual string GetClientName(string name)
+ {
+ if (string.IsNullOrWhiteSpace(name))
+ {
+ return name;
+ }
+ return PascalCase(RemoveInvalidCharacters(GetEscapedReservedName(name, "Model")));
+ }
+
///
/// Formats a string for naming a local variable using Camel case by default.
///
@@ -680,7 +689,7 @@ protected virtual void ResolveMethodGroupNameCollision(ServiceClient serviceClie
}
}
- private static string ResolveNameConflict(
+ protected static string ResolveNameConflict(
Dictionary exclusionDictionary,
string typeName,
string type,
diff --git a/AutoRest/AutoRest.Core/GlobalSuppressions.cs b/AutoRest/AutoRest.Core/GlobalSuppressions.cs
index df197f6d5a762..b9a12a5b4423b 100644
--- a/AutoRest/AutoRest.Core/GlobalSuppressions.cs
+++ b/AutoRest/AutoRest.Core/GlobalSuppressions.cs
@@ -60,3 +60,4 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "Microsoft.Rest.Generator.ClientModel.ServiceClient.#Methods")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "Microsoft.Rest.Generator.ClientModel.ServiceClient.#Properties")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "Microsoft.Rest.Generator.ClientModel.ParameterTransformation.#ParameterMappings")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "Microsoft.Rest.Generator.CodeNamer.#ResolveNameConflict(System.Collections.Generic.Dictionary`2,System.String,System.String,System.String)")]
diff --git a/AutoRest/AutoRest.Core/Settings.cs b/AutoRest/AutoRest.Core/Settings.cs
index 81ea5ca05c3df..5731df02869ef 100644
--- a/AutoRest/AutoRest.Core/Settings.cs
+++ b/AutoRest/AutoRest.Core/Settings.cs
@@ -161,7 +161,7 @@ public string Header
}
else if (value == "MICROSOFT_MIT_NO_CODEGEN")
{
- _header = MicrosoftMitLicenseHeader;
+ _header = MicrosoftMitLicenseHeader + Environment.NewLine + "Code generated by Microsoft (R) AutoRest Code Generator.";
}
else if (value == "NONE")
{
diff --git a/AutoRest/AutoRest/AutoRest.json b/AutoRest/AutoRest/AutoRest.json
index f368702db7a63..6ea68906d5894 100644
--- a/AutoRest/AutoRest/AutoRest.json
+++ b/AutoRest/AutoRest/AutoRest.json
@@ -24,6 +24,9 @@
"Azure.Java": {
"type": "AzureJavaCodeGenerator, AutoRest.Generator.Azure.Java"
},
+ "Azure.Java.Fluent": {
+ "type": "AzureJavaFluentCodeGenerator, AutoRest.Generator.Azure.Java.Fluent"
+ },
"Python": {
"type": "PythonCodeGenerator, AutoRest.Generator.Python"
},
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/build.gradle b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/build.gradle
new file mode 100644
index 0000000000000..436e0f2ff050f
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/build.gradle
@@ -0,0 +1,99 @@
+apply plugin: 'java'
+apply plugin: 'checkstyle'
+
+group = 'com.microsoft.azure'
+version = '1.0.0-SNAPSHOT'
+
+tasks.withType(JavaCompile) {
+ options.encoding = "UTF-8"
+}
+
+repositories {
+ mavenCentral()
+ maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
+}
+
+checkstyle {
+ toolVersion = "6.9"
+ configFile = new File("$rootDir/Tools/checkstyle/checkstyle.xml")
+ configProperties = [samedir: "$rootDir/Tools/checkstyle"]
+ reportsDir = new File("$rootDir/Tools/checkstyle/reports")
+}
+
+dependencies {
+ compile 'commons-codec:commons-codec:1.10'
+ compile 'com.microsoft.azure:azure-client-runtime:1.0.0-SNAPSHOT'
+ compile 'joda-time:joda-time:2.8.2'
+ compile 'javax.validation:validation-api:1.1.0.Final'
+ testCompile 'junit:junit:4.12'
+ testCompile 'junit:junit-dep:4.11'
+ testCompile 'commons-io:commons-io:2.4'
+}
+
+test {
+ testLogging {
+ events "passed", "skipped", "failed", "standardError"
+ }
+}
+
+javadoc {
+ options.encoding = 'UTF-8'
+}
+
+test {
+ reports.getHtml()
+ reports.html.destination = file("${projectDir}/../../../../TestResults/JavaAzureFluentCodeGen")
+}
+
+task buildRuntime(type: Exec) {
+ workingDir "${projectDir}/../../../../ClientRuntimes/Java"
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ commandLine 'cmd', '/c', 'gradle', 'uploadArchives'
+ } else {
+ commandLine 'gradle', 'uploadArchives'
+ }
+}
+
+task npmrestore(type: Exec) {
+ workingDir "${projectDir}/../../../TestServer/server"
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ commandLine 'cmd', '/c', 'npm', 'install'
+ } else {
+ commandLine 'npm', 'install'
+ }
+}
+
+task installforever(type: Exec, dependsOn: 'npmrestore') {
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ commandLine 'cmd', '/c', 'npm', 'install', '-g', 'forever'
+ } else {
+ commandLine 'npm', 'install', '-g', 'forever'
+ }
+}
+
+task runserver(type: Exec, dependsOn: 'installforever') {
+ workingDir "${projectDir}/../../../TestServer/server"
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ commandLine 'cmd', '/c', 'forever', 'start', 'startup/www.js'
+ } else {
+ commandLine 'forever', 'start', 'startup/www.js'
+ }
+}
+
+task testcoverage(type: JavaExec, dependsOn: 'runserver') {
+ main = 'fixtures.azurereport.CoverageReporter'
+ classpath = sourceSets.test.runtimeClasspath
+}
+
+task stopserver(type: Exec, dependsOn: 'testcoverage') {
+ workingDir "${projectDir}/../../../TestServer/server"
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ commandLine 'cmd', '/c', 'forever', 'stop', 'startup/www.js'
+ } else {
+ commandLine 'forever', 'stop', 'startup/www.js'
+ }
+}
+
+tasks.compileJava.dependsOn 'clean'
+tasks.test.dependsOn 'runserver'
+tasks.test.finalizedBy 'stopserver'
\ No newline at end of file
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/Error.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/Error.java
new file mode 100644
index 0000000000000..29cdf0fda1c94
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/Error.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping;
+
+
+/**
+ * The Error model.
+ */
+public class Error {
+ /**
+ * The status property.
+ */
+ private Integer status;
+
+ /**
+ * The message property.
+ */
+ private String message;
+
+ /**
+ * Get the status value.
+ *
+ * @return the status value
+ */
+ public Integer status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status value.
+ *
+ * @param status the status value to set
+ * @return the Error object itself.
+ */
+ public Error withStatus(Integer status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the message value.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message value.
+ *
+ * @param message the message value to set
+ * @return the Error object itself.
+ */
+ public Error withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/ErrorException.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/ErrorException.java
new file mode 100644
index 0000000000000..848bf2e0b782b
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/ErrorException.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping;
+
+import com.microsoft.rest.RestException;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with Error information.
+ */
+public class ErrorException extends RestException {
+ /**
+ * Information about the associated HTTP response.
+ */
+ private Response response;
+ /**
+ * The actual response body.
+ */
+ private Error body;
+ /**
+ * Initializes a new instance of the ErrorException class.
+ */
+ public ErrorException() { }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param message The exception message.
+ */
+ public ErrorException(final String message) {
+ super(message);
+ }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param message the exception message
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorException(final Throwable cause) {
+ super(cause);
+ }
+ /**
+ * Gets information about the associated HTTP response.
+ *
+ * @return the HTTP response
+ */
+ public Response getResponse() {
+ return response;
+ }
+ /**
+ * Gets the HTTP response body.
+ *
+ * @return the response body
+ */
+ public Error getBody() {
+ return body;
+ }
+ /**
+ * Sets the HTTP response.
+ *
+ * @param response the HTTP response
+ */
+ public void setResponse(Response response) {
+ this.response = response;
+ }
+ /**
+ * Sets the HTTP response body.
+ *
+ * @param body the response body
+ */
+ public void setBody(Error body) {
+ this.body = body;
+ }
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java
new file mode 100644
index 0000000000000..cb9559c86857e
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java
@@ -0,0 +1,166 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import com.microsoft.azure.AzureClient;
+import com.microsoft.azure.AzureServiceClient;
+import com.microsoft.azure.RestClient;
+import com.microsoft.rest.credentials.ServiceClientCredentials;
+
+/**
+ * Initializes a new instance of the AutoRestParameterGroupingTestServiceImpl class.
+ */
+public final class AutoRestParameterGroupingTestServiceImpl extends AzureServiceClient {
+ /** the {@link AzureClient} used for long running operations. */
+ private AzureClient azureClient;
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ public AzureClient getAzureClient() {
+ return this.azureClient;
+ }
+
+ /** Gets or sets the preferred language for the response. */
+ private String acceptLanguage;
+
+ /**
+ * Gets Gets or sets the preferred language for the response.
+ *
+ * @return the acceptLanguage value.
+ */
+ public String acceptLanguage() {
+ return this.acceptLanguage;
+ }
+
+ /**
+ * Sets Gets or sets the preferred language for the response.
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ public AutoRestParameterGroupingTestServiceImpl withAcceptLanguage(String acceptLanguage) {
+ this.acceptLanguage = acceptLanguage;
+ return this;
+ }
+
+ /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
+ private int longRunningOperationRetryTimeout;
+
+ /**
+ * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ public int longRunningOperationRetryTimeout() {
+ return this.longRunningOperationRetryTimeout;
+ }
+
+ /**
+ * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ public AutoRestParameterGroupingTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
+ this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
+ return this;
+ }
+
+ /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
+ private boolean generateClientRequestId;
+
+ /**
+ * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @return the generateClientRequestId value.
+ */
+ public boolean generateClientRequestId() {
+ return this.generateClientRequestId;
+ }
+
+ /**
+ * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ public AutoRestParameterGroupingTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) {
+ this.generateClientRequestId = generateClientRequestId;
+ return this;
+ }
+
+ /**
+ * The ParameterGroupingsInner object to access its operations.
+ */
+ private ParameterGroupingsInner parameterGroupings;
+
+ /**
+ * Gets the ParameterGroupingsInner object to access its operations.
+ * @return the ParameterGroupingsInner object.
+ */
+ public ParameterGroupingsInner parameterGroupings() {
+ return this.parameterGroupings;
+ }
+
+ /**
+ * Initializes an instance of AutoRestParameterGroupingTestService client.
+ *
+ * @param credentials the management credentials for Azure
+ */
+ public AutoRestParameterGroupingTestServiceImpl(ServiceClientCredentials credentials) {
+ this("https://localhost", credentials);
+ }
+
+ /**
+ * Initializes an instance of AutoRestParameterGroupingTestService client.
+ *
+ * @param baseUrl the base URL of the host
+ * @param credentials the management credentials for Azure
+ */
+ public AutoRestParameterGroupingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) {
+ this(new RestClient.Builder()
+ .withBaseUrl(baseUrl)
+ .withCredentials(credentials)
+ .build());
+ }
+
+ /**
+ * Initializes an instance of AutoRestParameterGroupingTestService client.
+ *
+ * @param restClient the REST client to connect to Azure.
+ */
+ public AutoRestParameterGroupingTestServiceImpl(RestClient restClient) {
+ super(restClient);
+ initialize();
+ }
+
+ protected void initialize() {
+ this.acceptLanguage = "en-US";
+ this.longRunningOperationRetryTimeout = 30;
+ this.generateClientRequestId = true;
+ this.parameterGroupings = new ParameterGroupingsInner(restClient().retrofit(), this);
+ this.azureClient = new AzureClient(this);
+ }
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ @Override
+ public String userAgent() {
+ return String.format("Azure-SDK-For-Java/%s (%s)",
+ getClass().getPackage().getImplementationVersion(),
+ "AutoRestParameterGroupingTestService, 1.0.0");
+ }
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java
new file mode 100644
index 0000000000000..47e3dbc35e8b6
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Additional parameters for a set of operations, such as:
+ * parameterGrouping_postMultiParamGroups,
+ * parameterGrouping_postSharedParameterGroupObject.
+ */
+public class FirstParameterGroupInner {
+ /**
+ * The headerOne property.
+ */
+ @JsonProperty(value = "")
+ private String headerOne;
+
+ /**
+ * Query parameter with default.
+ */
+ @JsonProperty(value = "")
+ private Integer queryOne;
+
+ /**
+ * Get the headerOne value.
+ *
+ * @return the headerOne value
+ */
+ public String headerOne() {
+ return this.headerOne;
+ }
+
+ /**
+ * Set the headerOne value.
+ *
+ * @param headerOne the headerOne value to set
+ * @return the FirstParameterGroupInner object itself.
+ */
+ public FirstParameterGroupInner withHeaderOne(String headerOne) {
+ this.headerOne = headerOne;
+ return this;
+ }
+
+ /**
+ * Get the queryOne value.
+ *
+ * @return the queryOne value
+ */
+ public Integer queryOne() {
+ return this.queryOne;
+ }
+
+ /**
+ * Set the queryOne value.
+ *
+ * @param queryOne the queryOne value to set
+ * @return the FirstParameterGroupInner object itself.
+ */
+ public FirstParameterGroupInner withQueryOne(Integer queryOne) {
+ this.queryOne = queryOne;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java
new file mode 100644
index 0000000000000..cc3cbe9cceefb
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Additional parameters for the parameterGrouping_postMultiParamGroups
+ * operation.
+ */
+public class ParameterGroupingPostMultiParamGroupsSecondParamGroupInner {
+ /**
+ * The headerTwo property.
+ */
+ @JsonProperty(value = "")
+ private String headerTwo;
+
+ /**
+ * Query parameter with default.
+ */
+ @JsonProperty(value = "")
+ private Integer queryTwo;
+
+ /**
+ * Get the headerTwo value.
+ *
+ * @return the headerTwo value
+ */
+ public String headerTwo() {
+ return this.headerTwo;
+ }
+
+ /**
+ * Set the headerTwo value.
+ *
+ * @param headerTwo the headerTwo value to set
+ * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroupInner object itself.
+ */
+ public ParameterGroupingPostMultiParamGroupsSecondParamGroupInner withHeaderTwo(String headerTwo) {
+ this.headerTwo = headerTwo;
+ return this;
+ }
+
+ /**
+ * Get the queryTwo value.
+ *
+ * @return the queryTwo value
+ */
+ public Integer queryTwo() {
+ return this.queryTwo;
+ }
+
+ /**
+ * Set the queryTwo value.
+ *
+ * @param queryTwo the queryTwo value to set
+ * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroupInner object itself.
+ */
+ public ParameterGroupingPostMultiParamGroupsSecondParamGroupInner withQueryTwo(Integer queryTwo) {
+ this.queryTwo = queryTwo;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java
new file mode 100644
index 0000000000000..1c05150738afe
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Additional parameters for the parameterGrouping_postOptional operation.
+ */
+public class ParameterGroupingPostOptionalParametersInner {
+ /**
+ * The customHeader property.
+ */
+ @JsonProperty(value = "")
+ private String customHeader;
+
+ /**
+ * Query parameter with default.
+ */
+ @JsonProperty(value = "")
+ private Integer query;
+
+ /**
+ * Get the customHeader value.
+ *
+ * @return the customHeader value
+ */
+ public String customHeader() {
+ return this.customHeader;
+ }
+
+ /**
+ * Set the customHeader value.
+ *
+ * @param customHeader the customHeader value to set
+ * @return the ParameterGroupingPostOptionalParametersInner object itself.
+ */
+ public ParameterGroupingPostOptionalParametersInner withCustomHeader(String customHeader) {
+ this.customHeader = customHeader;
+ return this;
+ }
+
+ /**
+ * Get the query value.
+ *
+ * @return the query value
+ */
+ public Integer query() {
+ return this.query;
+ }
+
+ /**
+ * Set the query value.
+ *
+ * @param query the query value to set
+ * @return the ParameterGroupingPostOptionalParametersInner object itself.
+ */
+ public ParameterGroupingPostOptionalParametersInner withQuery(Integer query) {
+ this.query = query;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java
new file mode 100644
index 0000000000000..59adb759da10a
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java
@@ -0,0 +1,123 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Additional parameters for the parameterGrouping_postRequired operation.
+ */
+public class ParameterGroupingPostRequiredParametersInner {
+ /**
+ * The body property.
+ */
+ @JsonProperty(value = "", required = true)
+ private int body;
+
+ /**
+ * The customHeader property.
+ */
+ @JsonProperty(value = "")
+ private String customHeader;
+
+ /**
+ * Query parameter with default.
+ */
+ @JsonProperty(value = "")
+ private Integer query;
+
+ /**
+ * Path parameter.
+ */
+ @JsonProperty(value = "", required = true)
+ private String path;
+
+ /**
+ * Get the body value.
+ *
+ * @return the body value
+ */
+ public int body() {
+ return this.body;
+ }
+
+ /**
+ * Set the body value.
+ *
+ * @param body the body value to set
+ * @return the ParameterGroupingPostRequiredParametersInner object itself.
+ */
+ public ParameterGroupingPostRequiredParametersInner withBody(int body) {
+ this.body = body;
+ return this;
+ }
+
+ /**
+ * Get the customHeader value.
+ *
+ * @return the customHeader value
+ */
+ public String customHeader() {
+ return this.customHeader;
+ }
+
+ /**
+ * Set the customHeader value.
+ *
+ * @param customHeader the customHeader value to set
+ * @return the ParameterGroupingPostRequiredParametersInner object itself.
+ */
+ public ParameterGroupingPostRequiredParametersInner withCustomHeader(String customHeader) {
+ this.customHeader = customHeader;
+ return this;
+ }
+
+ /**
+ * Get the query value.
+ *
+ * @return the query value
+ */
+ public Integer query() {
+ return this.query;
+ }
+
+ /**
+ * Set the query value.
+ *
+ * @param query the query value to set
+ * @return the ParameterGroupingPostRequiredParametersInner object itself.
+ */
+ public ParameterGroupingPostRequiredParametersInner withQuery(Integer query) {
+ this.query = query;
+ return this;
+ }
+
+ /**
+ * Get the path value.
+ *
+ * @return the path value
+ */
+ public String path() {
+ return this.path;
+ }
+
+ /**
+ * Set the path value.
+ *
+ * @param path the path value to set
+ * @return the ParameterGroupingPostRequiredParametersInner object itself.
+ */
+ public ParameterGroupingPostRequiredParametersInner withPath(String path) {
+ this.path = path;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java
new file mode 100644
index 0000000000000..1322f4fb0828b
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java
@@ -0,0 +1,495 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azureparametergrouping.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureServiceResponseBuilder;
+import com.microsoft.rest.ServiceCall;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.ServiceResponseCallback;
+import com.microsoft.rest.Validator;
+import fixtures.azureparametergrouping.ErrorException;
+import java.io.IOException;
+import okhttp3.ResponseBody;
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+import retrofit2.Response;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in ParameterGroupings.
+ */
+public final class ParameterGroupingsInner {
+ /** The Retrofit service to perform REST calls. */
+ private ParameterGroupingsService service;
+ /** The service client containing this operation class. */
+ private AutoRestParameterGroupingTestServiceImpl client;
+
+ /**
+ * Initializes an instance of ParameterGroupingsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public ParameterGroupingsInner(Retrofit retrofit, AutoRestParameterGroupingTestServiceImpl client) {
+ this.service = retrofit.create(ParameterGroupingsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ParameterGroupings to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface ParameterGroupingsService {
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @POST("parameterGrouping/postRequired/{path}")
+ Call postRequired(@Path("path") String path, @Header("accept-language") String acceptLanguage, @Body int body, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent);
+
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @POST("parameterGrouping/postOptional")
+ Call postOptional(@Header("accept-language") String acceptLanguage, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent);
+
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @POST("parameterGrouping/postMultipleParameterGroups")
+ Call postMultiParamGroups(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("header-two") String headerTwo, @Query("query-two") Integer queryTwo, @Header("User-Agent") String userAgent);
+
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @POST("parameterGrouping/sharedParameterGroupObject")
+ Call postSharedParameterGroupObject(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Post a bunch of required parameters grouped.
+ *
+ * @param parameterGroupingPostRequiredParameters Additional parameters for the operation
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @throws IllegalArgumentException exception thrown from invalid parameters
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postRequired(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters) throws ErrorException, IOException, IllegalArgumentException {
+ if (parameterGroupingPostRequiredParameters == null) {
+ throw new IllegalArgumentException("Parameter parameterGroupingPostRequiredParameters is required and cannot be null.");
+ }
+ Validator.validate(parameterGroupingPostRequiredParameters);
+ int body = parameterGroupingPostRequiredParameters.body();
+ String customHeader = parameterGroupingPostRequiredParameters.customHeader();
+ Integer query = parameterGroupingPostRequiredParameters.query();
+ String path = parameterGroupingPostRequiredParameters.path();
+ Call call = service.postRequired(path, this.client.acceptLanguage(), body, customHeader, query, this.client.userAgent());
+ return postRequiredDelegate(call.execute());
+ }
+
+ /**
+ * Post a bunch of required parameters grouped.
+ *
+ * @param parameterGroupingPostRequiredParameters Additional parameters for the operation
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postRequiredAsync(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters, final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ if (parameterGroupingPostRequiredParameters == null) {
+ serviceCallback.failure(new IllegalArgumentException("Parameter parameterGroupingPostRequiredParameters is required and cannot be null."));
+ return null;
+ }
+ Validator.validate(parameterGroupingPostRequiredParameters, serviceCallback);
+ int body = parameterGroupingPostRequiredParameters.body();
+ String customHeader = parameterGroupingPostRequiredParameters.customHeader();
+ Integer query = parameterGroupingPostRequiredParameters.query();
+ String path = parameterGroupingPostRequiredParameters.path();
+ Call call = service.postRequired(path, this.client.acceptLanguage(), body, customHeader, query, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postRequiredDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ private ServiceResponse postRequiredDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
+ return new AzureServiceResponseBuilder(this.client.mapperAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorException.class)
+ .build(response);
+ }
+
+ /**
+ * Post a bunch of optional parameters grouped.
+ *
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postOptional() throws ErrorException, IOException {
+ final ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters = null;
+ String customHeader = null;
+ Integer query = null;
+ Call call = service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent());
+ return postOptionalDelegate(call.execute());
+ }
+
+ /**
+ * Post a bunch of optional parameters grouped.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postOptionalAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ final ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters = null;
+ String customHeader = null;
+ Integer query = null;
+ Call call = service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postOptionalDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ /**
+ * Post a bunch of optional parameters grouped.
+ *
+ * @param parameterGroupingPostOptionalParameters Additional parameters for the operation
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postOptional(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters) throws ErrorException, IOException {
+ Validator.validate(parameterGroupingPostOptionalParameters);
+ String customHeader = null;
+ if (parameterGroupingPostOptionalParameters != null) {
+ customHeader = parameterGroupingPostOptionalParameters.customHeader();
+ }
+ Integer query = null;
+ if (parameterGroupingPostOptionalParameters != null) {
+ query = parameterGroupingPostOptionalParameters.query();
+ }
+ Call call = service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent());
+ return postOptionalDelegate(call.execute());
+ }
+
+ /**
+ * Post a bunch of optional parameters grouped.
+ *
+ * @param parameterGroupingPostOptionalParameters Additional parameters for the operation
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postOptionalAsync(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters, final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ Validator.validate(parameterGroupingPostOptionalParameters, serviceCallback);
+ String customHeader = null;
+ if (parameterGroupingPostOptionalParameters != null) {
+ customHeader = parameterGroupingPostOptionalParameters.customHeader();
+ }
+ Integer query = null;
+ if (parameterGroupingPostOptionalParameters != null) {
+ query = parameterGroupingPostOptionalParameters.query();
+ }
+ Call call = service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postOptionalDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ private ServiceResponse postOptionalDelegate(Response response) throws ErrorException, IOException {
+ return new AzureServiceResponseBuilder(this.client.mapperAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorException.class)
+ .build(response);
+ }
+
+ /**
+ * Post parameters from multiple different parameter groups.
+ *
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postMultiParamGroups() throws ErrorException, IOException {
+ final FirstParameterGroupInner firstParameterGroup = null;
+ final ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup = null;
+ String headerOne = null;
+ Integer queryOne = null;
+ String headerTwo = null;
+ Integer queryTwo = null;
+ Call call = service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent());
+ return postMultiParamGroupsDelegate(call.execute());
+ }
+
+ /**
+ * Post parameters from multiple different parameter groups.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postMultiParamGroupsAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ final FirstParameterGroupInner firstParameterGroup = null;
+ final ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup = null;
+ String headerOne = null;
+ Integer queryOne = null;
+ String headerTwo = null;
+ Integer queryTwo = null;
+ Call call = service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postMultiParamGroupsDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ /**
+ * Post parameters from multiple different parameter groups.
+ *
+ * @param firstParameterGroup Additional parameters for the operation
+ * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postMultiParamGroups(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup) throws ErrorException, IOException {
+ Validator.validate(firstParameterGroup);
+ Validator.validate(parameterGroupingPostMultiParamGroupsSecondParamGroup);
+ String headerOne = null;
+ if (firstParameterGroup != null) {
+ headerOne = firstParameterGroup.headerOne();
+ }
+ Integer queryOne = null;
+ if (firstParameterGroup != null) {
+ queryOne = firstParameterGroup.queryOne();
+ }
+ String headerTwo = null;
+ if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
+ headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.headerTwo();
+ }
+ Integer queryTwo = null;
+ if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
+ queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.queryTwo();
+ }
+ Call call = service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent());
+ return postMultiParamGroupsDelegate(call.execute());
+ }
+
+ /**
+ * Post parameters from multiple different parameter groups.
+ *
+ * @param firstParameterGroup Additional parameters for the operation
+ * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postMultiParamGroupsAsync(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup, final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ Validator.validate(firstParameterGroup, serviceCallback);
+ Validator.validate(parameterGroupingPostMultiParamGroupsSecondParamGroup, serviceCallback);
+ String headerOne = null;
+ if (firstParameterGroup != null) {
+ headerOne = firstParameterGroup.headerOne();
+ }
+ Integer queryOne = null;
+ if (firstParameterGroup != null) {
+ queryOne = firstParameterGroup.queryOne();
+ }
+ String headerTwo = null;
+ if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
+ headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.headerTwo();
+ }
+ Integer queryTwo = null;
+ if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
+ queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.queryTwo();
+ }
+ Call call = service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postMultiParamGroupsDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ private ServiceResponse postMultiParamGroupsDelegate(Response response) throws ErrorException, IOException {
+ return new AzureServiceResponseBuilder(this.client.mapperAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorException.class)
+ .build(response);
+ }
+
+ /**
+ * Post parameters with a shared parameter group object.
+ *
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postSharedParameterGroupObject() throws ErrorException, IOException {
+ final FirstParameterGroupInner firstParameterGroup = null;
+ String headerOne = null;
+ Integer queryOne = null;
+ Call call = service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent());
+ return postSharedParameterGroupObjectDelegate(call.execute());
+ }
+
+ /**
+ * Post parameters with a shared parameter group object.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postSharedParameterGroupObjectAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ final FirstParameterGroupInner firstParameterGroup = null;
+ String headerOne = null;
+ Integer queryOne = null;
+ Call call = service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postSharedParameterGroupObjectDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ /**
+ * Post parameters with a shared parameter group object.
+ *
+ * @param firstParameterGroup Additional parameters for the operation
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the {@link ServiceResponse} object if successful.
+ */
+ public ServiceResponse postSharedParameterGroupObject(FirstParameterGroupInner firstParameterGroup) throws ErrorException, IOException {
+ Validator.validate(firstParameterGroup);
+ String headerOne = null;
+ if (firstParameterGroup != null) {
+ headerOne = firstParameterGroup.headerOne();
+ }
+ Integer queryOne = null;
+ if (firstParameterGroup != null) {
+ queryOne = firstParameterGroup.queryOne();
+ }
+ Call call = service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent());
+ return postSharedParameterGroupObjectDelegate(call.execute());
+ }
+
+ /**
+ * Post parameters with a shared parameter group object.
+ *
+ * @param firstParameterGroup Additional parameters for the operation
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if callback is null
+ * @return the {@link Call} object
+ */
+ public ServiceCall postSharedParameterGroupObjectAsync(FirstParameterGroupInner firstParameterGroup, final ServiceCallback serviceCallback) throws IllegalArgumentException {
+ if (serviceCallback == null) {
+ throw new IllegalArgumentException("ServiceCallback is required for async calls.");
+ }
+ Validator.validate(firstParameterGroup, serviceCallback);
+ String headerOne = null;
+ if (firstParameterGroup != null) {
+ headerOne = firstParameterGroup.headerOne();
+ }
+ Integer queryOne = null;
+ if (firstParameterGroup != null) {
+ queryOne = firstParameterGroup.queryOne();
+ }
+ Call call = service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent());
+ final ServiceCall serviceCall = new ServiceCall(call);
+ call.enqueue(new ServiceResponseCallback(serviceCallback) {
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ serviceCallback.success(postSharedParameterGroupObjectDelegate(response));
+ } catch (ErrorException | IOException exception) {
+ serviceCallback.failure(exception);
+ }
+ }
+ });
+ return serviceCall;
+ }
+
+ private ServiceResponse postSharedParameterGroupObjectDelegate(Response response) throws ErrorException, IOException {
+ return new AzureServiceResponseBuilder(this.client.mapperAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorException.class)
+ .build(response);
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java
new file mode 100644
index 0000000000000..191b184e65a7d
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+/**
+ * This package contains the implementation classes for AutoRestParameterGroupingTestService.
+ * Test Infrastructure for AutoRest.
+ */
+package fixtures.azureparametergrouping.implementation;
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/package-info.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/package-info.java
new file mode 100644
index 0000000000000..e7d821411f361
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azureparametergrouping/package-info.java
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+/**
+ * This package contains the classes for AutoRestParameterGroupingTestService.
+ * Test Infrastructure for AutoRest.
+ */
+package fixtures.azureparametergrouping;
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/Error.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/Error.java
new file mode 100644
index 0000000000000..5b5927e320a8c
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/Error.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azurereport;
+
+
+/**
+ * The Error model.
+ */
+public class Error {
+ /**
+ * The status property.
+ */
+ private Integer status;
+
+ /**
+ * The message property.
+ */
+ private String message;
+
+ /**
+ * Get the status value.
+ *
+ * @return the status value
+ */
+ public Integer status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status value.
+ *
+ * @param status the status value to set
+ * @return the Error object itself.
+ */
+ public Error withStatus(Integer status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the message value.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message value.
+ *
+ * @param message the message value to set
+ * @return the Error object itself.
+ */
+ public Error withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/ErrorException.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/ErrorException.java
new file mode 100644
index 0000000000000..b9e28d9bce633
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/ErrorException.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azurereport;
+
+import com.microsoft.rest.RestException;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with Error information.
+ */
+public class ErrorException extends RestException {
+ /**
+ * Information about the associated HTTP response.
+ */
+ private Response response;
+ /**
+ * The actual response body.
+ */
+ private Error body;
+ /**
+ * Initializes a new instance of the ErrorException class.
+ */
+ public ErrorException() { }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param message The exception message.
+ */
+ public ErrorException(final String message) {
+ super(message);
+ }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param message the exception message
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+ /**
+ * Initializes a new instance of the ErrorException class.
+ *
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorException(final Throwable cause) {
+ super(cause);
+ }
+ /**
+ * Gets information about the associated HTTP response.
+ *
+ * @return the HTTP response
+ */
+ public Response getResponse() {
+ return response;
+ }
+ /**
+ * Gets the HTTP response body.
+ *
+ * @return the response body
+ */
+ public Error getBody() {
+ return body;
+ }
+ /**
+ * Sets the HTTP response.
+ *
+ * @param response the HTTP response
+ */
+ public void setResponse(Response response) {
+ this.response = response;
+ }
+ /**
+ * Sets the HTTP response body.
+ *
+ * @param body the response body
+ */
+ public void setBody(Error body) {
+ this.body = body;
+ }
+}
diff --git a/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java
new file mode 100644
index 0000000000000..fef1b3b84a103
--- /dev/null
+++ b/AutoRest/Generators/Java/Azure.Java.Fluent.Tests/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java
@@ -0,0 +1,231 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+package fixtures.azurereport.implementation;
+
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureClient;
+import com.microsoft.azure.AzureServiceClient;
+import com.microsoft.azure.AzureServiceResponseBuilder;
+import com.microsoft.azure.RestClient;
+import com.microsoft.rest.credentials.ServiceClientCredentials;
+import com.microsoft.rest.ServiceCall;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.ServiceResponseCallback;
+import fixtures.azurereport.ErrorException;
+import java.io.IOException;
+import java.util.Map;
+import okhttp3.ResponseBody;
+import retrofit2.Call;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.Response;
+
+/**
+ * Initializes a new instance of the AutoRestReportServiceForAzureImpl class.
+ */
+public final class AutoRestReportServiceForAzureImpl extends AzureServiceClient {
+ /** The Retrofit service to perform REST calls. */
+ private AutoRestReportServiceForAzureService service;
+ /** the {@link AzureClient} used for long running operations. */
+ private AzureClient azureClient;
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ public AzureClient getAzureClient() {
+ return this.azureClient;
+ }
+
+ /** Gets or sets the preferred language for the response. */
+ private String acceptLanguage;
+
+ /**
+ * Gets Gets or sets the preferred language for the response.
+ *
+ * @return the acceptLanguage value.
+ */
+ public String acceptLanguage() {
+ return this.acceptLanguage;
+ }
+
+ /**
+ * Sets Gets or sets the preferred language for the response.
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ public AutoRestReportServiceForAzureImpl withAcceptLanguage(String acceptLanguage) {
+ this.acceptLanguage = acceptLanguage;
+ return this;
+ }
+
+ /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
+ private int longRunningOperationRetryTimeout;
+
+ /**
+ * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ public int longRunningOperationRetryTimeout() {
+ return this.longRunningOperationRetryTimeout;
+ }
+
+ /**
+ * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ public AutoRestReportServiceForAzureImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
+ this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
+ return this;
+ }
+
+ /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
+ private boolean generateClientRequestId;
+
+ /**
+ * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @return the generateClientRequestId value.
+ */
+ public boolean generateClientRequestId() {
+ return this.generateClientRequestId;
+ }
+
+ /**
+ * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ public AutoRestReportServiceForAzureImpl withGenerateClientRequestId(boolean generateClientRequestId) {
+ this.generateClientRequestId = generateClientRequestId;
+ return this;
+ }
+
+ /**
+ * Initializes an instance of AutoRestReportServiceForAzure client.
+ *
+ * @param credentials the management credentials for Azure
+ */
+ public AutoRestReportServiceForAzureImpl(ServiceClientCredentials credentials) {
+ this("http://localhost", credentials);
+ }
+
+ /**
+ * Initializes an instance of AutoRestReportServiceForAzure client.
+ *
+ * @param baseUrl the base URL of the host
+ * @param credentials the management credentials for Azure
+ */
+ public AutoRestReportServiceForAzureImpl(String baseUrl, ServiceClientCredentials credentials) {
+ this(new RestClient.Builder()
+ .withBaseUrl(baseUrl)
+ .withCredentials(credentials)
+ .build());
+ }
+
+ /**
+ * Initializes an instance of AutoRestReportServiceForAzure client.
+ *
+ * @param restClient the REST client to connect to Azure.
+ */
+ public AutoRestReportServiceForAzureImpl(RestClient restClient) {
+ super(restClient);
+ initialize();
+ }
+
+ protected void initialize() {
+ this.acceptLanguage = "en-US";
+ this.longRunningOperationRetryTimeout = 30;
+ this.generateClientRequestId = true;
+ this.azureClient = new AzureClient(this);
+ initializeService();
+ }
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ @Override
+ public String userAgent() {
+ return String.format("Azure-SDK-For-Java/%s (%s)",
+ getClass().getPackage().getImplementationVersion(),
+ "AutoRestReportServiceForAzure, 1.0.0");
+ }
+
+ private void initializeService() {
+ service = restClient().retrofit().create(AutoRestReportServiceForAzureService.class);
+ }
+
+ /**
+ * The interface defining all the services for AutoRestReportServiceForAzure to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface AutoRestReportServiceForAzureService {
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @GET("report/azure")
+ Call getReport(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Get test coverage report.
+ *
+ * @throws ErrorException exception thrown from REST call
+ * @throws IOException exception thrown from serialization/deserialization
+ * @return the Map<String, Integer> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public ServiceResponse