use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.
the class Parameter_Test method testSetQueryParamSignatureString.
@Test
public void testSetQueryParamSignatureString() {
final Parameter parm = new Parameter(ParameterModifier.CONST, "ds3_str", "bucket_id", ParameterPointerType.SINGLE_POINTER, false);
final String parmSig = ParameterHelper.generateSetQueryParamSignature(parm);
assertThat(parmSig, is("void ds3_request_set_bucket_id(const ds3_request* request, const char * const value)"));
}
use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.
the class Parameter_Test method testParameterToStringWithPointer.
@Test
public void testParameterToStringWithPointer() {
final Parameter param1 = new Parameter(ParameterModifier.NONE, "ds3_error", "ds3Error", ParameterPointerType.SINGLE_POINTER, false);
assertThat(param1.toString(), is("ds3_error* ds3Error"));
}
use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.
the class Parameter_Test method testSetQueryParamSignatureUint64_t.
@Test
public void testSetQueryParamSignatureUint64_t() {
final Parameter parm = new Parameter(ParameterModifier.CONST, "uint64_t", "offset", ParameterPointerType.NONE, false);
final String parmSig = ParameterHelper.generateSetQueryParamSignature(parm);
assertThat(parmSig, is("void ds3_request_set_offset(const ds3_request* request, const uint64_t value)"));
}
use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.
the class RequestConverter_Test method testGetRequestParameterListWithResponseType.
@Test
public void testGetRequestParameterListWithResponseType() throws IOException {
final ImmutableList<Parameter> paramList = RequestConverter.getParamList("ds3_get_service_response", new Ds3DocSpecEmptyImpl());
assertEquals(paramList.size(), 3);
assertEquals(RequestHelper.paramListToString(paramList), "const ds3_client* client, const ds3_request* request, ds3_get_service_response** response");
}
use of com.spectralogic.ds3autogen.c.models.Parameter in project ds3_autogen by SpectraLogic.
the class RequestConverter method getOptionalQueryParams.
private static ImmutableList<Parameter> getOptionalQueryParams(final Ds3Request ds3Request, final Ds3DocSpec docSpec) {
final ImmutableList.Builder<Parameter> optionalArgsBuilder = ImmutableList.builder();
if (isEmpty(ds3Request.getOptionalQueryParams())) {
return optionalArgsBuilder.build();
}
for (final Ds3Param ds3Param : ds3Request.getOptionalQueryParams()) {
final Parameter optionalQueryParam = ParameterConverter.toParameter(ds3Param, false, toParamDocs(Helper.unqualifiedName(ds3Param.getName()), docSpec));
LOG.debug("\tOptional QueryParam: " + optionalQueryParam.toString());
optionalArgsBuilder.add(optionalQueryParam);
}
return optionalArgsBuilder.build();
}
Aggregations