Search in sources :

Example 1 with PayloadCommand

use of com.spectralogic.ds3autogen.net.model.client.PayloadCommand in project ds3_autogen by SpectraLogic.

the class BaseClientGenerator_Test method toPayloadCommand_Test.

@Test
public void toPayloadCommand_Test() throws IOException {
    final Ds3Request request = createTestRequestWithResponseCodes("com.test.WithPayloadRequest", true);
    final PayloadCommand result = toPayloadCommand(request, getTestDocSpec());
    assertThat(result.getCommandName(), is("WithPayload"));
    assertThat(result.getRequestName(), is("WithPayloadRequest"));
    assertThat(result.getResponseType(), is("WithPayloadResponse"));
}
Also used : Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) PayloadCommand(com.spectralogic.ds3autogen.net.model.client.PayloadCommand) Test(org.junit.Test)

Example 2 with PayloadCommand

use of com.spectralogic.ds3autogen.net.model.client.PayloadCommand 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)

Aggregations

Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)2 PayloadCommand (com.spectralogic.ds3autogen.net.model.client.PayloadCommand)2 ImmutableList (com.google.common.collect.ImmutableList)1 Test (org.junit.Test)1