Search in sources :

Example 6 with ConstructorParam

use of com.spectralogic.ds3autogen.python.model.request.ConstructorParam in project ds3_autogen by SpectraLogic.

the class ObjectsPayloadGenerator method toOptionalConstructorParams.

/**
     * Gets the sorted list of optional constructor parameters including the request payload
     */
@Override
public ImmutableList<ConstructorParam> toOptionalConstructorParams(final Ds3Request ds3Request) {
    final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
    builder.addAll(toOptionalArgumentsList(ds3Request.getOptionalQueryParams()));
    if (isEjectStorageDomainBlobsRequest(ds3Request)) {
        builder.add(new Arguments(FILE_OBJECTS_TYPE, OBJECTS_NAME));
    }
    return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), true)).collect(GuavaCollectors.immutableList());
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) RequestConverterUtil.getNonVoidArgsFromParamList(com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList) Helper.camelToUnderscore(com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) GuavaCollectors(com.spectralogic.ds3autogen.utils.collections.GuavaCollectors) ImmutableList(com.google.common.collect.ImmutableList) Ds3RequestClassificationUtil(com.spectralogic.ds3autogen.utils.Ds3RequestClassificationUtil) PythonHelper.pythonIndent(com.spectralogic.ds3autogen.python.helpers.PythonHelper.pythonIndent) GeneratorUtils.hasRequiredFileObjectListPayload(com.spectralogic.ds3autogen.python.utils.GeneratorUtils.hasRequiredFileObjectListPayload) ConstructorParam(com.spectralogic.ds3autogen.python.model.request.ConstructorParam) CustomArgumentComparator(com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator) ConstructorParam(com.spectralogic.ds3autogen.python.model.request.ConstructorParam) ImmutableList(com.google.common.collect.ImmutableList) CustomArgumentComparator(com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator) Arguments(com.spectralogic.ds3autogen.api.models.Arguments)

Example 7 with ConstructorParam

use of com.spectralogic.ds3autogen.python.model.request.ConstructorParam in project ds3_autogen by SpectraLogic.

the class PutObjectRequestGenerator method toOptionalConstructorParams.

/**
     * Gets the sorted list of optional constructor params with headers
     */
@Override
public ImmutableList<ConstructorParam> toOptionalConstructorParams(final Ds3Request ds3Request) {
    final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
    builder.addAll(toOptionalArgumentsList(ds3Request.getOptionalQueryParams()));
    builder.add(new Arguments("", "headers"));
    return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), true)).collect(GuavaCollectors.immutableList());
}
Also used : Arguments(com.spectralogic.ds3autogen.api.models.Arguments) RequestConverterUtil.getNonVoidArgsFromParamList(com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList) Helper.camelToUnderscore(com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) GuavaCollectors(com.spectralogic.ds3autogen.utils.collections.GuavaCollectors) ImmutableList(com.google.common.collect.ImmutableList) PythonHelper.pythonIndent(com.spectralogic.ds3autogen.python.helpers.PythonHelper.pythonIndent) ConstructorParam(com.spectralogic.ds3autogen.python.model.request.ConstructorParam) CustomArgumentComparator(com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator) ConstructorParam(com.spectralogic.ds3autogen.python.model.request.ConstructorParam) ImmutableList(com.google.common.collect.ImmutableList) CustomArgumentComparator(com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator) Arguments(com.spectralogic.ds3autogen.api.models.Arguments)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)7 Arguments (com.spectralogic.ds3autogen.api.models.Arguments)7 Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)7 ConstructorParam (com.spectralogic.ds3autogen.python.model.request.ConstructorParam)7 Helper.camelToUnderscore (com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore)7 GuavaCollectors (com.spectralogic.ds3autogen.utils.collections.GuavaCollectors)7 CustomArgumentComparator (com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator)7 RequestConverterUtil.getNonVoidArgsFromParamList (com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList)6 PythonHelper.pythonIndent (com.spectralogic.ds3autogen.python.helpers.PythonHelper.pythonIndent)5 GeneratorUtils.hasRequiredFileObjectListPayload (com.spectralogic.ds3autogen.python.utils.GeneratorUtils.hasRequiredFileObjectListPayload)2 Ds3RequestClassificationUtil (com.spectralogic.ds3autogen.utils.Ds3RequestClassificationUtil)2 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)1 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1 Operation (com.spectralogic.ds3autogen.api.models.enums.Operation)1 BaseRequest (com.spectralogic.ds3autogen.python.model.request.BaseRequest)1 BaseQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.BaseQueryParam)1 OperationQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.OperationQueryParam)1 QueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.QueryParam)1 VoidQueryParam (com.spectralogic.ds3autogen.python.model.request.queryparam.VoidQueryParam)1 GeneratorUtils (com.spectralogic.ds3autogen.python.utils.GeneratorUtils)1