Search in sources :

Example 1 with ParameterGroupingPostMultiParamGroupsSecondParamGroup

use of fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup in project autorest.java by Azure.

the class ParameterGroupingsImpl method postMultiParamGroupsWithServiceResponseAsync.

/**
 * Post parameters from multiple different parameter groups.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> postMultiParamGroupsWithServiceResponseAsync() {
    final FirstParameterGroup firstParameterGroup = null;
    final ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup = null;
    String headerOne = null;
    Integer queryOne = null;
    String headerTwo = null;
    Integer queryTwo = null;
    return service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {

        @Override
        public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<Void> clientResponse = postMultiParamGroupsDelegate(response);
                return Observable.just(clientResponse);
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : FirstParameterGroup(fixtures.azureparametergrouping.models.FirstParameterGroup) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) ServiceResponse(com.microsoft.rest.ServiceResponse) Response(retrofit2.Response) ParameterGroupingPostMultiParamGroupsSecondParamGroup(fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup) ServiceResponse(com.microsoft.rest.ServiceResponse)

Example 2 with ParameterGroupingPostMultiParamGroupsSecondParamGroup

use of fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup in project autorest.java by Azure.

the class ParameterGroupingTests method postMultipleParameterGroups.

@Test
public void postMultipleParameterGroups() throws Exception {
    FirstParameterGroup first = new FirstParameterGroup();
    first.withQueryOne(21);
    first.withHeaderOne("header");
    ParameterGroupingPostMultiParamGroupsSecondParamGroup second = new ParameterGroupingPostMultiParamGroupsSecondParamGroup();
    second.withHeaderTwo("header2");
    second.withQueryTwo(42);
    client.parameterGroupings().postMultiParamGroups(first, second);
}
Also used : ParameterGroupingPostMultiParamGroupsSecondParamGroup(fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup) FirstParameterGroup(fixtures.azureparametergrouping.models.FirstParameterGroup) Test(org.junit.Test)

Aggregations

FirstParameterGroup (fixtures.azureparametergrouping.models.FirstParameterGroup)2 ParameterGroupingPostMultiParamGroupsSecondParamGroup (fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup)2 ServiceResponse (com.microsoft.rest.ServiceResponse)1 ResponseBody (okhttp3.ResponseBody)1 Test (org.junit.Test)1 Response (retrofit2.Response)1 Observable (rx.Observable)1