Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestClient moved to Azure only and a few improvements #1181

Merged
merged 12 commits into from
Jun 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.serializer.AzureJacksonMapperAdapter;
import com.microsoft.azure.RestClient;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

/**
* Initializes a new instance of the AutoRestParameterGroupingTestServiceImpl class.
Expand Down Expand Up @@ -129,8 +128,8 @@ public AutoRestParameterGroupingTestServiceImpl(ServiceClientCredentials credent
* @param credentials the management credentials for Azure
*/
public AutoRestParameterGroupingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) {
this(new RestClient.Builder(baseUrl)
.withMapperAdapter(new AzureJacksonMapperAdapter())
this(new RestClient.Builder()
.withBaseUrl(baseUrl)
.withCredentials(credentials)
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> postRequiredDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -241,7 +241,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> postOptionalDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -376,7 +376,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> postMultiParamGroupsDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -485,7 +485,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> postSharedParameterGroupObjectDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.AzureServiceResponseBuilder;
import com.microsoft.azure.serializer.AzureJacksonMapperAdapter;
import com.microsoft.azure.RestClient;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;
import com.microsoft.rest.ServiceCall;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceResponse;
Expand Down Expand Up @@ -132,8 +131,8 @@ public AutoRestReportServiceForAzureImpl(ServiceClientCredentials credentials) {
* @param credentials the management credentials for Azure
*/
public AutoRestReportServiceForAzureImpl(String baseUrl, ServiceClientCredentials credentials) {
this(new RestClient.Builder(baseUrl)
.withMapperAdapter(new AzureJacksonMapperAdapter())
this(new RestClient.Builder()
.withBaseUrl(baseUrl)
.withCredentials(credentials)
.build());
}
Expand Down Expand Up @@ -222,7 +221,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Map<String, Integer>> getReportDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Map<String, Integer>, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Map<String, Integer>, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<Map<String, Integer>>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.AzureServiceResponseBuilder;
import com.microsoft.azure.serializer.AzureJacksonMapperAdapter;
import com.microsoft.azure.RestClient;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;
import com.microsoft.rest.ServiceCall;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceResponse;
Expand Down Expand Up @@ -136,8 +135,8 @@ public AutoRestResourceFlatteningTestServiceImpl(ServiceClientCredentials creden
* @param credentials the management credentials for Azure
*/
public AutoRestResourceFlatteningTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) {
this(new RestClient.Builder(baseUrl)
.withMapperAdapter(new AzureJacksonMapperAdapter())
this(new RestClient.Builder()
.withBaseUrl(baseUrl)
.withCredentials(credentials)
.build());
}
Expand Down Expand Up @@ -290,7 +289,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> putArrayDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -335,7 +334,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<List<FlattenedProductInner>> getArrayDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<List<FlattenedProductInner>, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<List<FlattenedProductInner>, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<List<FlattenedProductInner>>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -424,7 +423,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> putDictionaryDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -469,7 +468,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Map<String, FlattenedProductInner>> getDictionaryDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Map<String, FlattenedProductInner>, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Map<String, FlattenedProductInner>, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<Map<String, FlattenedProductInner>>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -558,7 +557,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> putResourceCollectionDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -603,7 +602,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<ResourceCollectionInner> getResourceCollectionDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<ResourceCollectionInner, ErrorException>(this.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<ResourceCollectionInner, ErrorException>(this.mapperAdapter())
.register(200, new TypeToken<ResourceCollectionInner>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getMethodGlobalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -170,7 +170,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getMethodGlobalNotProvidedValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -223,7 +223,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getPathGlobalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -276,7 +276,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getSwaggerGlobalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getMethodLocalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -198,7 +198,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getMethodLocalNullDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -245,7 +245,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getPathLocalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down Expand Up @@ -292,7 +292,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getSwaggerLocalValidDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.serializer.AzureJacksonMapperAdapter;
import com.microsoft.azure.RestClient;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

/**
* Initializes a new instance of the AutoRestAzureSpecialParametersTestClientImpl class.
Expand Down Expand Up @@ -255,8 +254,8 @@ public AutoRestAzureSpecialParametersTestClientImpl(ServiceClientCredentials cre
* @param credentials the management credentials for Azure
*/
public AutoRestAzureSpecialParametersTestClientImpl(String baseUrl, ServiceClientCredentials credentials) {
this(new RestClient.Builder(baseUrl)
.withMapperAdapter(new AzureJacksonMapperAdapter())
this(new RestClient.Builder()
.withBaseUrl(baseUrl)
.withCredentials(credentials)
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponseWithHeaders<Void, HeaderCustomNamedRequestIdHeadersInner> customNamedRequestIdDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.buildWithHeaders(response, HeaderCustomNamedRequestIdHeadersInner.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
}

private ServiceResponse<Void> getWithFilterDelegate(Response<ResponseBody> response) throws ErrorException, IOException {
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.restClient().mapperAdapter())
return new AzureServiceResponseBuilder<Void, ErrorException>(this.client.mapperAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorException.class)
.build(response);
Expand Down
Loading