Search in sources :

Example 1 with QueryParam

use of com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toQueryParam_VoidParam_Test.

@Test
public void toQueryParam_VoidParam_Test() {
    final Arguments arg = new Arguments("void", "VoidArg");
    final QueryParam result = toQueryParam(arg);
    assertThat(result, instanceOf(VoidQueryParam.class));
    assertThat(result.getName(), is("void_arg"));
    assertThat(result.getAssignment(), is("None"));
}
Also used : BaseQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam) VoidQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam) OperationQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam) QueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam) Arguments(com.spectralogic.ds3autogen.api.models.Arguments) VoidQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam) Test(org.junit.Test)

Example 2 with QueryParam

use of com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator method toQueryParamList.

/**
     * Creates the list of non-optional query params assigned in the constructor
     */
public static ImmutableList<QueryParam> toQueryParamList(final Operation operation, final ImmutableList<Ds3Param> requiredParams) {
    final ImmutableList.Builder<QueryParam> builder = ImmutableList.builder();
    if (operation != null) {
        builder.add(new OperationQueryParam(operation.toString().toLowerCase()));
    }
    builder.addAll(toRequiredQueryParamList(requiredParams));
    return builder.build();
}
Also used : OperationQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam) BaseQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam) VoidQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam) OperationQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam) QueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam) ImmutableList(com.google.common.collect.ImmutableList)

Example 3 with QueryParam

use of com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toQueryParam_Test.

@Test
public void toQueryParam_Test() {
    final Arguments arg = new Arguments("int", "IntArg");
    final QueryParam result = toQueryParam(arg);
    assertThat(result, instanceOf(BaseQueryParam.class));
    assertThat(result.getName(), is("int_arg"));
    assertThat(result.getAssignment(), is("int_arg"));
}
Also used : BaseQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam) VoidQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam) OperationQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam) QueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam) Arguments(com.spectralogic.ds3autogen.api.models.Arguments) BaseQueryParam(com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam) Test(org.junit.Test)

Aggregations

BaseQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam)3 OperationQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam)3 QueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam)3 VoidQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam)3 Arguments (com.spectralogic.ds3autogen.api.models.Arguments)2 Test (org.junit.Test)2 ImmutableList (com.google.common.collect.ImmutableList)1