Skip to content

Commit

Permalink
Merge pull request #14 from Azure/master
Browse files Browse the repository at this point in the history
Merge changes from base repository
  • Loading branch information
NiklasGustafsson committed Apr 1, 2016
2 parents 315eb88 + 4c4604f commit 654954f
Show file tree
Hide file tree
Showing 60 changed files with 2,291 additions and 384 deletions.
2 changes: 1 addition & 1 deletion AutoRest/Generators/Extensions/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private static IEnumerable<Property> FlattenProperty(Property propertyToFlatten,
}

List<Property> extractedProperties = new List<Property>();
foreach (Property innerProperty in typeToFlatten.Properties)
foreach (Property innerProperty in typeToFlatten.ComposedProperties)
{
Debug.Assert(typeToFlatten.SerializedName != null);
Debug.Assert(innerProperty.SerializedName != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,7 @@ private ServiceResponse<Void> postRequiredDelegate(Response<ResponseBody> respon
public ServiceResponse<Void> postOptional() throws ErrorException, IOException {
final ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters = null;
String customHeader = null;
if (parameterGroupingPostOptionalParameters != null) {
customHeader = parameterGroupingPostOptionalParameters.getCustomHeader();
}
Integer query = null;
if (parameterGroupingPostOptionalParameters != null) {
query = parameterGroupingPostOptionalParameters.getQuery();
}
Call<ResponseBody> call = service.postOptional(this.client.getAcceptLanguage(), customHeader, query);
return postOptionalDelegate(call.execute());
}
Expand All @@ -177,13 +171,7 @@ public ServiceCall postOptionalAsync(final ServiceCallback<Void> serviceCallback
}
final ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters = null;
String customHeader = null;
if (parameterGroupingPostOptionalParameters != null) {
customHeader = parameterGroupingPostOptionalParameters.getCustomHeader();
}
Integer query = null;
if (parameterGroupingPostOptionalParameters != null) {
query = parameterGroupingPostOptionalParameters.getQuery();
}
Call<ResponseBody> call = service.postOptional(this.client.getAcceptLanguage(), customHeader, query);
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Void>(serviceCallback) {
Expand Down Expand Up @@ -275,21 +263,9 @@ public ServiceResponse<Void> postMultiParamGroups() throws ErrorException, IOExc
final FirstParameterGroup firstParameterGroup = null;
final ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup = null;
String headerOne = null;
if (firstParameterGroup != null) {
headerOne = firstParameterGroup.getHeaderOne();
}
Integer queryOne = null;
if (firstParameterGroup != null) {
queryOne = firstParameterGroup.getQueryOne();
}
String headerTwo = null;
if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.getHeaderTwo();
}
Integer queryTwo = null;
if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.getQueryTwo();
}
Call<ResponseBody> call = service.postMultiParamGroups(this.client.getAcceptLanguage(), headerOne, queryOne, headerTwo, queryTwo);
return postMultiParamGroupsDelegate(call.execute());
}
Expand All @@ -308,21 +284,9 @@ public ServiceCall postMultiParamGroupsAsync(final ServiceCallback<Void> service
final FirstParameterGroup firstParameterGroup = null;
final ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup = null;
String headerOne = null;
if (firstParameterGroup != null) {
headerOne = firstParameterGroup.getHeaderOne();
}
Integer queryOne = null;
if (firstParameterGroup != null) {
queryOne = firstParameterGroup.getQueryOne();
}
String headerTwo = null;
if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.getHeaderTwo();
}
Integer queryTwo = null;
if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.getQueryTwo();
}
Call<ResponseBody> call = service.postMultiParamGroups(this.client.getAcceptLanguage(), headerOne, queryOne, headerTwo, queryTwo);
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Void>(serviceCallback) {
Expand Down Expand Up @@ -433,13 +397,7 @@ private ServiceResponse<Void> postMultiParamGroupsDelegate(Response<ResponseBody
public ServiceResponse<Void> postSharedParameterGroupObject() throws ErrorException, IOException {
final FirstParameterGroup firstParameterGroup = null;
String headerOne = null;
if (firstParameterGroup != null) {
headerOne = firstParameterGroup.getHeaderOne();
}
Integer queryOne = null;
if (firstParameterGroup != null) {
queryOne = firstParameterGroup.getQueryOne();
}
Call<ResponseBody> call = service.postSharedParameterGroupObject(this.client.getAcceptLanguage(), headerOne, queryOne);
return postSharedParameterGroupObjectDelegate(call.execute());
}
Expand All @@ -457,13 +415,7 @@ public ServiceCall postSharedParameterGroupObjectAsync(final ServiceCallback<Voi
}
final FirstParameterGroup firstParameterGroup = null;
String headerOne = null;
if (firstParameterGroup != null) {
headerOne = firstParameterGroup.getHeaderOne();
}
Integer queryOne = null;
if (firstParameterGroup != null) {
queryOne = firstParameterGroup.getQueryOne();
}
Call<ResponseBody> call = service.postSharedParameterGroupObject(this.client.getAcceptLanguage(), headerOne, queryOne);
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Void>(serviceCallback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,13 @@ public ServiceResponse<PagedList<Product>> getMultiplePages() throws CloudExcept
final String clientRequestId = null;
final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null;
Integer maxresults = null;
if (pagingGetMultiplePagesOptions != null) {
maxresults = pagingGetMultiplePagesOptions.getMaxresults();
}
Integer timeout = null;
if (pagingGetMultiplePagesOptions != null) {
timeout = pagingGetMultiplePagesOptions.getTimeout();
}
Call<ResponseBody> call = service.getMultiplePages(clientRequestId, this.client.getAcceptLanguage(), maxresults, timeout);
ServiceResponse<PageImpl<Product>> response = getMultiplePagesDelegate(call.execute());
PagedList<Product> result = new PagedList<Product>(response.getBody()) {
@Override
public Page<Product> nextPage(String nextPageLink) throws CloudException, IOException {
return getMultiplePagesNext(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).getBody();
return getMultiplePagesNext(nextPageLink, null, null).getBody();
}
};
return new ServiceResponse<>(result, response.getResponse());
Expand All @@ -231,13 +225,7 @@ public ServiceCall getMultiplePagesAsync(final ListOperationCallback<Product> se
final String clientRequestId = null;
final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null;
Integer maxresults = null;
if (pagingGetMultiplePagesOptions != null) {
maxresults = pagingGetMultiplePagesOptions.getMaxresults();
}
Integer timeout = null;
if (pagingGetMultiplePagesOptions != null) {
timeout = pagingGetMultiplePagesOptions.getTimeout();
}
Call<ResponseBody> call = service.getMultiplePages(clientRequestId, this.client.getAcceptLanguage(), maxresults, timeout);
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<List<Product>>(serviceCallback) {
Expand All @@ -248,7 +236,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
serviceCallback.load(result.getBody().getItems());
if (result.getBody().getNextPageLink() != null
&& serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) {
getMultiplePagesNextAsync(result.getBody().getNextPageLink(), clientRequestId, pagingGetMultiplePagesOptions, serviceCall, serviceCallback);
getMultiplePagesNextAsync(result.getBody().getNextPageLink(), null, null, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse()));
}
Expand Down Expand Up @@ -367,7 +355,7 @@ public Page<Product> nextPage(String nextPageLink) throws CloudException, IOExce
PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions();
pagingGetMultiplePagesWithOffsetNextOptions.setMaxresults(pagingGetMultiplePagesWithOffsetOptions.getMaxresults());
pagingGetMultiplePagesWithOffsetNextOptions.setTimeout(pagingGetMultiplePagesWithOffsetOptions.getTimeout());
return getMultiplePagesWithOffsetNext(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).getBody();
return getMultiplePagesWithOffsetNext(nextPageLink, null, null).getBody();
}
};
return new ServiceResponse<>(result, response.getResponse());
Expand Down Expand Up @@ -407,7 +395,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions();
pagingGetMultiplePagesWithOffsetNextOptions.setMaxresults(pagingGetMultiplePagesWithOffsetOptions.getMaxresults());
pagingGetMultiplePagesWithOffsetNextOptions.setTimeout(pagingGetMultiplePagesWithOffsetOptions.getTimeout());
getMultiplePagesWithOffsetNextAsync(result.getBody().getNextPageLink(), clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions, serviceCall, serviceCallback);
getMultiplePagesWithOffsetNextAsync(result.getBody().getNextPageLink(), null, null, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse()));
}
Expand Down Expand Up @@ -878,13 +866,7 @@ public ServiceResponse<PageImpl<Product>> getMultiplePagesNext(final String next
final String clientRequestId = null;
final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null;
Integer maxresults = null;
if (pagingGetMultiplePagesOptions != null) {
maxresults = pagingGetMultiplePagesOptions.getMaxresults();
}
Integer timeout = null;
if (pagingGetMultiplePagesOptions != null) {
timeout = pagingGetMultiplePagesOptions.getTimeout();
}
Call<ResponseBody> call = service.getMultiplePagesNext(nextPageLink, clientRequestId, this.client.getAcceptLanguage(), maxresults, timeout);
return getMultiplePagesNextDelegate(call.execute());
}
Expand All @@ -909,13 +891,7 @@ public ServiceCall getMultiplePagesNextAsync(final String nextPageLink, final Se
final String clientRequestId = null;
final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null;
Integer maxresults = null;
if (pagingGetMultiplePagesOptions != null) {
maxresults = pagingGetMultiplePagesOptions.getMaxresults();
}
Integer timeout = null;
if (pagingGetMultiplePagesOptions != null) {
timeout = pagingGetMultiplePagesOptions.getTimeout();
}
Call<ResponseBody> call = service.getMultiplePagesNext(nextPageLink, clientRequestId, this.client.getAcceptLanguage(), maxresults, timeout);
serviceCall.newCall(call);
call.enqueue(new ServiceResponseCallback<List<Product>>(serviceCallback) {
Expand All @@ -926,7 +902,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
serviceCallback.load(result.getBody().getItems());
if (result.getBody().getNextPageLink() != null
&& serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) {
getMultiplePagesNextAsync(result.getBody().getNextPageLink(), clientRequestId, pagingGetMultiplePagesOptions, serviceCall, serviceCallback);
getMultiplePagesNextAsync(result.getBody().getNextPageLink(), null, null, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse()));
}
Expand Down Expand Up @@ -1075,7 +1051,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
serviceCallback.load(result.getBody().getItems());
if (result.getBody().getNextPageLink() != null
&& serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) {
getMultiplePagesWithOffsetNextAsync(result.getBody().getNextPageLink(), clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions, serviceCall, serviceCallback);
getMultiplePagesWithOffsetNextAsync(result.getBody().getNextPageLink(), null, null, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse()));
}
Expand Down
11 changes: 11 additions & 0 deletions AutoRest/Generators/Java/Azure.Java/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureCompositeTypeModel.#.ctor(Microsoft.Rest.Generator.Java.CompositeTypeModel)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureJavaCodeGenerator.#.ctor(Microsoft.Rest.Generator.Settings)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureModelTemplateModel.#.ctor(Microsoft.Rest.Generator.ClientModel.CompositeType,Microsoft.Rest.Generator.ClientModel.ServiceClient)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "Microsoft.Rest.Generator.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "serviceCallback", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getItems", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "Microsoft.Rest.Generator.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "PagingBahavior", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getNextPageLink", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ListOperationCallback", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "Microsoft.Rest.Generator.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(Microsoft.Rest.Generator.Utilities.IndentedStringBuilder,Microsoft.Rest.Generator.Java.Azure.AzureMethodTemplateModel,System.Boolean)")]
Loading

0 comments on commit 654954f

Please sign in to comment.