use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class RequestGeneratorUtil_Test method toRequestPath_Exception_Test.
@Test(expected = IllegalArgumentException.class)
public void toRequestPath_Exception_Test() {
final Ds3Request request = new Ds3Request("Test", HttpVerb.GET, Classification.spectrainternal, Requirement.NOT_ALLOWED, Requirement.NOT_ALLOWED, Action.BULK_DELETE, Resource.ACTIVE_JOB, ResourceType.NON_SINGLETON, Operation.ALLOCATE, false, ImmutableList.of(), ImmutableList.of(), ImmutableList.of());
toRequestPath(request);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator method toRequiredConstructorParams.
/**
* Gets the sorted list of required constructor parameters for a Ds3Request
*/
@Override
public ImmutableList<ConstructorParam> toRequiredConstructorParams(final Ds3Request ds3Request) {
final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
builder.addAll(getNonVoidArgsFromParamList(ds3Request.getRequiredQueryParams()));
builder.addAll(getAssignmentArguments(ds3Request));
return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), false)).collect(GuavaCollectors.immutableList());
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class StringPayloadGenerator method toRequiredConstructorParams.
/**
* Gets the sorted list of required constructor parameters including the request payload
*/
@Override
public ImmutableList<ConstructorParam> toRequiredConstructorParams(final Ds3Request ds3Request) {
final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
builder.addAll(getNonVoidArgsFromParamList(ds3Request.getRequiredQueryParams()));
builder.addAll(getAssignmentArguments(ds3Request));
builder.add(new Arguments("string", PAYLOAD_NAME));
return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), false)).collect(GuavaCollectors.immutableList());
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class PythonCodeGenerator_Test method toResponseModel_Test.
@Test
public void toResponseModel_Test() {
final Ds3Request request = getBucketRequest();
final BaseResponse result = toResponseModel(request);
assertThat(result.getName(), is("GetBucketResponseHandler"));
assertThat(result.getCodes().size(), is(1));
final String expectedParseResponse = "if self.response.status == 200:\n" + " self.result = parseModel(xmldom.fromstring(response.read()), ListBucketResult())";
assertThat(result.getParseResponseCode(), is(expectedParseResponse));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class GetObjectRequestGenerator method toRequiredConstructorParams.
/**
* Gets the sorted list of required constructor parameters, including the stream
*/
@Override
public ImmutableList<ConstructorParam> toRequiredConstructorParams(final Ds3Request ds3Request) {
final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
builder.addAll(getNonVoidArgsFromParamList(ds3Request.getRequiredQueryParams()));
builder.addAll(getAssignmentArguments(ds3Request));
builder.add(new Arguments("", "stream"));
return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), false)).collect(GuavaCollectors.immutableList());
}
Aggregations