Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Azure/autorest
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyuan Wan committed Apr 29, 2016
2 parents 1a6bf4e + 651b102 commit 340132b
Show file tree
Hide file tree
Showing 24 changed files with 2,372 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,82 @@ public interface LROSADsOperations {
*/
ServiceCall beginPutNonRetry201Creating400Async(Product product, final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when long running operation is interrupted
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Product> putNonRetry201Creating400InvalidJson() throws CloudException, IOException, InterruptedException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException;
/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when long running operation is interrupted
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Product> putNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException, InterruptedException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Product> beginPutNonRetry201Creating400InvalidJson() throws CloudException, IOException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException;
/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Product> beginPutNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException;

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException;

/**
* Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ interface LROSADsService {
@PUT("lro/nonretryerror/put/201/creating/400")
Call<ResponseBody> beginPutNonRetry201Creating400(@Body Product product, @Header("accept-language") String acceptLanguage);

@Headers("Content-Type: application/json; charset=utf-8")
@PUT("lro/nonretryerror/put/201/creating/400/invalidjson")
Call<ResponseBody> putNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage);

@Headers("Content-Type: application/json; charset=utf-8")
@PUT("lro/nonretryerror/put/201/creating/400/invalidjson")
Call<ResponseBody> beginPutNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage);

@Headers("Content-Type: application/json; charset=utf-8")
@PUT("lro/nonretryerror/putasync/retry/400")
Call<ResponseBody> putAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage);
Expand Down Expand Up @@ -627,6 +635,179 @@ private ServiceResponse<Product> beginPutNonRetry201Creating400Delegate(Response
.build(response);
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when long running operation is interrupted
* @return the Product object wrapped in ServiceResponse if successful.
*/
public ServiceResponse<Product> putNonRetry201Creating400InvalidJson() throws CloudException, IOException, InterruptedException {
final Product product = null;
Response<ResponseBody> result = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()).execute();
return client.getAzureClient().getPutOrPatchResult(result, new TypeToken<Product>() { }.getType());
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
public ServiceCall putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
final Product product = null;
Call<ResponseBody> call = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new Callback<ResponseBody>() {
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
serviceCallback.failure(t);
}
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken<Product>() { }.getType(), serviceCall, serviceCallback);
}
});
return serviceCall;
}
/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when long running operation is interrupted
* @return the Product object wrapped in ServiceResponse if successful.
*/
public ServiceResponse<Product> putNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException, InterruptedException {
Validator.validate(product);
Response<ResponseBody> result = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()).execute();
return client.getAzureClient().getPutOrPatchResult(result, new TypeToken<Product>() { }.getType());
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
public ServiceCall putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
Validator.validate(product, serviceCallback);
Call<ResponseBody> call = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new Callback<ResponseBody>() {
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
serviceCallback.failure(t);
}
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken<Product>() { }.getType(), serviceCall, serviceCallback);
}
});
return serviceCall;
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
public ServiceResponse<Product> beginPutNonRetry201Creating400InvalidJson() throws CloudException, IOException {
final Product product = null;
Call<ResponseBody> call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
return beginPutNonRetry201Creating400InvalidJsonDelegate(call.execute());
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @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 beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
final Product product = null;
Call<ResponseBody> call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Product>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
serviceCallback.success(beginPutNonRetry201Creating400InvalidJsonDelegate(response));
} catch (CloudException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Product object wrapped in {@link ServiceResponse} if successful.
*/
public ServiceResponse<Product> beginPutNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException {
Validator.validate(product);
Call<ResponseBody> call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
return beginPutNonRetry201Creating400InvalidJsonDelegate(call.execute());
}

/**
* Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code.
*
* @param product Product to put
* @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 beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback<Product> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
Validator.validate(product, serviceCallback);
Call<ResponseBody> call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Product>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
serviceCallback.success(beginPutNonRetry201Creating400InvalidJsonDelegate(response));
} catch (CloudException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}

private ServiceResponse<Product> beginPutNonRetry201Creating400InvalidJsonDelegate(Response<ResponseBody> response) throws CloudException, IOException {
return new AzureServiceResponseBuilder<Product, CloudException>(this.client.getMapperAdapter())
.register(200, new TypeToken<Product>() { }.getType())
.register(201, new TypeToken<Product>() { }.getType())
.registerError(CloudException.class)
.build(response);
}

/**
* Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,78 @@ public interface IntOperations {
*/
ServiceCall putMin64Async(long intBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;

/**
* Get datetime encoded as Unix time value.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the long object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Long> getUnixTime() throws ErrorException, IOException;

/**
* Get datetime encoded as Unix time value.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getUnixTimeAsync(final ServiceCallback<Long> serviceCallback) throws IllegalArgumentException;

/**
* Put datetime encoded as Unix time.
*
* @param intBody the long value
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> putUnixTimeDate(long intBody) throws ErrorException, IOException;

/**
* Put datetime encoded as Unix time.
*
* @param intBody the long value
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall putUnixTimeDateAsync(long intBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;

/**
* Get invalid Unix time value.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the long object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Long> getInvalidUnixTime() throws ErrorException, IOException;

/**
* Get invalid Unix time value.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getInvalidUnixTimeAsync(final ServiceCallback<Long> serviceCallback) throws IllegalArgumentException;

/**
* Get null Unix time value.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the long object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Long> getNullUnixTime() throws ErrorException, IOException;

/**
* Get null Unix time value.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getNullUnixTimeAsync(final ServiceCallback<Long> serviceCallback) throws IllegalArgumentException;

}
Loading

0 comments on commit 340132b

Please sign in to comment.