use of retrofit2.http.PUT in project autorest.java by Azure.
the class LROsImpl method putAsyncSubResourceWithServiceResponseAsync.
/**
* Long running put request with sub resource.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<SubProduct>> putAsyncSubResourceWithServiceResponseAsync() {
final SubProduct product = null;
Observable<Response<ResponseBody>> observable = service.putAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<SubProduct>() {
}.getType());
}
use of retrofit2.http.PUT in project autorest.java by Azure.
the class LROsImpl method putAsyncNoHeaderInRetryWithServiceResponseAsync.
/**
* Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponseWithHeaders<Product, LROsPutAsyncNoHeaderInRetryHeaders>> putAsyncNoHeaderInRetryWithServiceResponseAsync() {
final Product product = null;
Observable<Response<ResponseBody>> observable = service.putAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken<Product>() {
}.getType(), LROsPutAsyncNoHeaderInRetryHeaders.class);
}
use of retrofit2.http.PUT in project autorest.java by Azure.
the class AutoRestResourceFlatteningTestServiceImpl method postFlattenedSimpleProductWithServiceResponseAsync.
/**
* Put Flattened Simple Product with client flattening true on the parameter.
*
* @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
* @param maxProductDisplayName Display name of product.
* @param description Description of product.
* @param genericValue Generic URL value.
* @param odatavalue URL value.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SimpleProduct object
*/
public Observable<ServiceResponse<SimpleProduct>> postFlattenedSimpleProductWithServiceResponseAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue) {
if (productId == null) {
throw new IllegalArgumentException("Parameter productId is required and cannot be null.");
}
if (maxProductDisplayName == null) {
throw new IllegalArgumentException("Parameter maxProductDisplayName is required and cannot be null.");
}
SimpleProduct simpleBodyProduct = null;
if (description != null || genericValue != null || odatavalue != null) {
simpleBodyProduct = new SimpleProduct();
simpleBodyProduct.withProductId(productId);
simpleBodyProduct.withDescription(description);
simpleBodyProduct.withMaxProductDisplayName(maxProductDisplayName);
simpleBodyProduct.withGenericValue(genericValue);
simpleBodyProduct.withOdatavalue(odatavalue);
}
return service.postFlattenedSimpleProduct(simpleBodyProduct).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<SimpleProduct>>>() {
@Override
public Observable<ServiceResponse<SimpleProduct>> call(Response<ResponseBody> response) {
try {
ServiceResponse<SimpleProduct> clientResponse = postFlattenedSimpleProductDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of retrofit2.http.PUT in project autorest.java by Azure.
the class AutoRestResourceFlatteningTestServiceImpl method putSimpleProductWithGroupingWithServiceResponseAsync.
/**
* Put Simple Product with client flattening true on the model.
*
* @param flattenParameterGroup Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SimpleProduct object
*/
public Observable<ServiceResponse<SimpleProduct>> putSimpleProductWithGroupingWithServiceResponseAsync(FlattenParameterGroup flattenParameterGroup) {
if (flattenParameterGroup == null) {
throw new IllegalArgumentException("Parameter flattenParameterGroup is required and cannot be null.");
}
Validator.validate(flattenParameterGroup);
String name = flattenParameterGroup.name();
String productId = flattenParameterGroup.productId();
String description = flattenParameterGroup.description();
String maxProductDisplayName = flattenParameterGroup.maxProductDisplayName();
String genericValue = flattenParameterGroup.genericValue();
String odatavalue = flattenParameterGroup.odatavalue();
SimpleProduct simpleBodyProduct = null;
if (description != null || genericValue != null || odatavalue != null) {
simpleBodyProduct = new SimpleProduct();
simpleBodyProduct.withProductId(productId);
simpleBodyProduct.withDescription(description);
simpleBodyProduct.withMaxProductDisplayName(maxProductDisplayName);
simpleBodyProduct.withGenericValue(genericValue);
simpleBodyProduct.withOdatavalue(odatavalue);
}
return service.putSimpleProductWithGrouping(name, simpleBodyProduct).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<SimpleProduct>>>() {
@Override
public Observable<ServiceResponse<SimpleProduct>> call(Response<ResponseBody> response) {
try {
ServiceResponse<SimpleProduct> clientResponse = putSimpleProductWithGroupingDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of retrofit2.http.PUT in project autorest.java by Azure.
the class LRORetrysImpl method putAsyncRelativeRetrySucceededWithServiceResponseAsync.
/**
* Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponseWithHeaders<Product, LRORetrysPutAsyncRelativeRetrySucceededHeaders>> putAsyncRelativeRetrySucceededWithServiceResponseAsync() {
final Product product = null;
Observable<Response<ResponseBody>> observable = service.putAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken<Product>() {
}.getType(), LRORetrysPutAsyncRelativeRetrySucceededHeaders.class);
}
Aggregations