use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class BulkRequestGenerator_Test method toClassVariableArguments_Test.
@Test
public void toClassVariableArguments_Test() {
final Ds3Request request = createSimpleTestDs3Request();
final ImmutableList<Variable> result = generator.toClassVariableArguments(request);
assertThat(result.size(), is(4));
assertThat(result.get(0).getName(), is("ObjectName"));
assertThat(result.get(1).getName(), is("JobId"));
assertThat(result.get(2).getName(), is("NotificationEndPoint"));
assertThat(result.get(3).getName(), is("RequestType"));
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class JavaHelper_Test method removeVariable_FullList_Test.
@Test
public void removeVariable_FullList_Test() {
final ImmutableList<Variable> variables = ImmutableList.of(new Variable("Name", "Type", false), new Variable("Name2", "Type2", false));
final ImmutableList<Variable> nullVarName = removeVariable(variables, null);
assertThat(nullVarName.size(), is(2));
final ImmutableList<Variable> emptyVarName = removeVariable(variables, "");
assertThat(emptyVarName.size(), is(2));
final ImmutableList<Variable> result = removeVariable(variables, "Name");
assertThat(result.size(), is(1));
assertThat(result.get(0).getName(), is("Name2"));
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class GetObjectRequestGenerator method toClassVariableArguments.
/**
* Gets all the class variables to properly generate the variables and their
* getter functions. This consists of all constructor arguments and optional
* arguments being converted into variables, including the Channel variable.
*/
@Override
public ImmutableList<Variable> toClassVariableArguments(final Ds3Request ds3Request) {
final ImmutableList.Builder<Variable> builder = ImmutableList.builder();
builder.add(new Variable("Channel", "WritableByteChannel", true));
for (final Arguments arg : toConstructorArgumentsList(ds3Request)) {
builder.add(new Variable(arg.getName(), arg.getType(), true));
}
for (final Arguments arg : toOptionalArgumentsList(ds3Request.getOptionalQueryParams())) {
builder.add(new Variable(arg.getName(), arg.getType(), false));
}
return builder.build();
}
Aggregations