Search in sources :

Example 91 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class BaseClientGenerator method toPayloadCommands.

/**
     * Converts the Ds3Requests with a response type into Payload Commands
     */
protected static ImmutableList<PayloadCommand> toPayloadCommands(final ImmutableList<Ds3Request> ds3Requests, final Ds3DocSpec docSpec) {
    final ImmutableList.Builder<PayloadCommand> builder = ImmutableList.builder();
    final ImmutableList<Ds3Request> payloadRequests = getRequestsBasedOnResponsePayload(ds3Requests, true);
    for (final Ds3Request ds3Request : payloadRequests) {
        builder.add(toPayloadCommand(ds3Request, docSpec));
    }
    return builder.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) PayloadCommand(com.spectralogic.ds3autogen.net.model.client.PayloadCommand)

Example 92 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class NetCodeGenerator method generateCommands.

/**
     * Generates all code associated with the Ds3ApiSpec
     */
private void generateCommands(final ImmutableList<Ds3Request> requests, final ImmutableMap<String, Ds3Type> typeMap, final Ds3DocSpec docSpec) throws TemplateException, IOException {
    if (isEmpty(requests)) {
        LOG.info("There were no requests to generate");
        return;
    }
    for (final Ds3Request request : requests) {
        generateRequest(request, typeMap, docSpec);
        generateResponseAndParser(request);
    }
}
Also used : Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)

Aggregations

Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)92 Test (org.junit.Test)76 RequestGeneratorTestHelper.createSimpleTestDs3Request (com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request)37 Arguments (com.spectralogic.ds3autogen.api.models.Arguments)24 Ds3ModelPartialDataFixture.createEmptyDs3Request (com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request)17 ImmutableList (com.google.common.collect.ImmutableList)11 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)11 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)9 QueryParam (com.spectralogic.ds3autogen.java.models.QueryParam)9 GuavaCollectors (com.spectralogic.ds3autogen.utils.collections.GuavaCollectors)8 RequestConstructor (com.spectralogic.ds3autogen.java.models.RequestConstructor)7 ConstructorParam (com.spectralogic.ds3autogen.python.model.request.ConstructorParam)7 Helper.camelToUnderscore (com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore)7 CustomArgumentComparator (com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator)7 RequestConverterUtil.getNonVoidArgsFromParamList (com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList)6 Ds3ApiSpec (com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)5 PythonHelper.pythonIndent (com.spectralogic.ds3autogen.python.helpers.PythonHelper.pythonIndent)5 Variable (com.spectralogic.ds3autogen.java.models.Variable)3 Ds3RequestClassificationUtil (com.spectralogic.ds3autogen.utils.Ds3RequestClassificationUtil)3 OutputStream (java.io.OutputStream)3