Search in sources :

Example 46 with Header

use of retrofit2.http.Header in project autorest.java by Azure.

the class LROSADsImpl method putAsyncRelativeRetryNoStatusWithServiceResponseAsync.

/**
 * Long running put request, service returns 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, LROSADsPutAsyncRelativeRetryNoStatusHeaders>> putAsyncRelativeRetryNoStatusWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.putAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken<Product>() {
    }.getType(), LROSADsPutAsyncRelativeRetryNoStatusHeaders.class);
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product)

Example 47 with Header

use of retrofit2.http.Header in project autorest.java by Azure.

the class LROsImpl method postAsyncNoRetrySucceededWithServiceResponseAsync.

/**
 * Long running post request, service returns a 202 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, LROsPostAsyncNoRetrySucceededHeaders>> postAsyncNoRetrySucceededWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.postAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Product>() {
    }.getType(), LROsPostAsyncNoRetrySucceededHeaders.class);
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product) SubProduct(fixtures.lro.models.SubProduct)

Example 48 with Header

use of retrofit2.http.Header in project autorest.java by Azure.

the class LROsImpl method put202Retry200WithServiceResponseAsync.

/**
 * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable for the request
 */
public Observable<ServiceResponse<Product>> put202Retry200WithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.put202Retry200(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<Product>() {
    }.getType());
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product) SubProduct(fixtures.lro.models.SubProduct)

Example 49 with Header

use of retrofit2.http.Header in project autorest.java by Azure.

the class LROsImpl method putAsyncRetrySucceededWithServiceResponseAsync.

/**
 * Long running put request, service returns 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, LROsPutAsyncRetrySucceededHeaders>> putAsyncRetrySucceededWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken<Product>() {
    }.getType(), LROsPutAsyncRetrySucceededHeaders.class);
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product) SubProduct(fixtures.lro.models.SubProduct)

Example 50 with Header

use of retrofit2.http.Header in project autorest.java by Azure.

the class LROsImpl method postAsyncRetrycanceledWithServiceResponseAsync.

/**
 * Long running post request, service returns a 202 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<Void, LROsPostAsyncRetrycanceledHeaders>> postAsyncRetrycanceledWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.postAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Void>() {
    }.getType(), LROsPostAsyncRetrycanceledHeaders.class);
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product) SubProduct(fixtures.lro.models.SubProduct)

Aggregations

Response (retrofit2.Response)39 ServiceResponse (com.microsoft.rest.ServiceResponse)30 TypeToken (com.google.common.reflect.TypeToken)29 Product (fixtures.lro.models.Product)29 Request (okhttp3.Request)23 Retrofit (retrofit2.Retrofit)21 OkHttpClient (okhttp3.OkHttpClient)19 IOException (java.io.IOException)15 Test (org.junit.Test)14 SubProduct (fixtures.lro.models.SubProduct)12 Interceptor (okhttp3.Interceptor)12 Response (okhttp3.Response)10 ResponseBody (okhttp3.ResponseBody)9 Header (retrofit2.http.Header)6 ArrayList (java.util.ArrayList)4 HttpLoggingInterceptor (okhttp3.logging.HttpLoggingInterceptor)4 GsonBuilder (com.google.gson.GsonBuilder)3 HttpException (retrofit2.HttpException)3 Context (android.content.Context)2 Nullable (android.support.annotation.Nullable)2