Search in sources :

Example 1 with Product

use of fixtures.lro.models.Product in project autorest.java by Azure.

the class LRORetrysImpl method put201CreatingSucceeded200WithServiceResponseAsync.

/**
 * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’.  Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable for the request
 */
public Observable<ServiceResponse<Product>> put201CreatingSucceeded200WithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.put201CreatingSucceeded200(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)

Example 2 with Product

use of fixtures.lro.models.Product in project autorest.java by Azure.

the class LROsCustomHeadersImpl method postAsyncRetrySucceededWithServiceResponseAsync.

/**
 * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. 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, LROsCustomHeaderPostAsyncRetrySucceededHeaders>> postAsyncRetrySucceededWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Void>() {
    }.getType(), LROsCustomHeaderPostAsyncRetrySucceededHeaders.class);
}
Also used : ServiceResponse(com.microsoft.rest.ServiceResponse) Response(retrofit2.Response) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product)

Example 3 with Product

use of fixtures.lro.models.Product in project autorest.java by Azure.

the class LROsCustomHeadersImpl method putAsyncRetrySucceededWithServiceResponseAsync.

/**
 * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. 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, LROsCustomHeaderPutAsyncRetrySucceededHeaders>> 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(), LROsCustomHeaderPutAsyncRetrySucceededHeaders.class);
}
Also used : ServiceResponse(com.microsoft.rest.ServiceResponse) Response(retrofit2.Response) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product)

Example 4 with Product

use of fixtures.lro.models.Product in project autorest.java by Azure.

the class LROSADsImpl method post202NoLocationWithServiceResponseAsync.

/**
 * Long running post request, service returns a 202 to the initial request, without a location header.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable for the request
 */
public Observable<ServiceResponseWithHeaders<Void, LROSADsPost202NoLocationHeaders>> post202NoLocationWithServiceResponseAsync() {
    final Product product = null;
    Observable<Response<ResponseBody>> observable = service.post202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Void>() {
    }.getType(), LROSADsPost202NoLocationHeaders.class);
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) Product(fixtures.lro.models.Product)

Example 5 with Product

use of fixtures.lro.models.Product in project autorest.java by Azure.

the class LROSADsImpl method putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync.

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

Aggregations

TypeToken (com.google.common.reflect.TypeToken)45 ServiceResponse (com.microsoft.rest.ServiceResponse)45 Product (fixtures.lro.models.Product)45 Response (retrofit2.Response)45 SubProduct (fixtures.lro.models.SubProduct)19