use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class StreamRequestPayloadGenerator method toClassVariableArguments.
/**
* Gets all the class variables to properly generate the variables and their
* getter functions, including Stream and Channel
*/
@Override
public ImmutableList<Variable> toClassVariableArguments(final Ds3Request ds3Request) {
final ImmutableList.Builder<Variable> builder = ImmutableList.builder();
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));
}
builder.add(new Variable("Stream", "InputStream", true));
builder.add(new Variable("Channel", "SeekableByteChannel", false));
return builder.build();
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method convertAllUuidClassVariables_FullList_Test.
@Test
public void convertAllUuidClassVariables_FullList_Test() {
final ImmutableList<Variable> variables = ImmutableList.of(new Variable("Var", "String", true), new Variable("Var", "UUID", true), new Variable("Var", "UUID", false), new Variable("Var", "Integer", true));
final ImmutableList<Variable> result = convertAllUuidClassVariables(variables);
assertThat(result.size(), is(4));
for (final Variable var : result) {
assertThat(var.getType(), not(is("UUID")));
}
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method convertUuidClassVariable_Test.
@Test
public void convertUuidClassVariable_Test() {
final Variable uuidVar = convertUuidClassVariable(new Variable("UuidVar", "UUID", true));
assertThat(uuidVar.getType(), is("String"));
final Variable intVar = convertUuidClassVariable(new Variable("IntVar", "int", true));
assertThat(intVar.getType(), is("int"));
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class CreateNotificationRequestGenerator_Test method toClassVariableArguments_Test.
@Test
public void toClassVariableArguments_Test() {
final Ds3Request request = createSimpleTestDs3Request();
final ImmutableList<Variable> result = generator.toClassVariableArguments(request);
assertThat(result.size(), is(5));
assertThat(result.get(0).getName(), is("BucketName"));
assertThat(result.get(1).getName(), is("ObjectName"));
assertThat(result.get(2).getName(), is("JobId"));
assertThat(result.get(3).getName(), is("Priority"));
assertThat(result.get(4).getName(), is("RequestType"));
}
use of com.spectralogic.ds3autogen.java.models.Variable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toClassVariableArguments_Test.
@Test
public void toClassVariableArguments_Test() {
final Ds3Request request = createSimpleTestDs3Request();
final ImmutableList<Variable> result = generator.toClassVariableArguments(request);
assertThat(result.size(), is(6));
assertThat(result.get(0).getName(), is("BucketName"));
assertThat(result.get(1).getName(), is("ObjectName"));
assertThat(result.get(2).getName(), is("JobId"));
assertThat(result.get(3).getName(), is("Priority"));
assertThat(result.get(4).getName(), is("NotificationEndPoint"));
assertThat(result.get(5).getName(), is("RequestType"));
}
Aggregations