Class BashClientCodegen

    • Field Detail

      • apiVersion

        protected String apiVersion
      • curlOptions

        protected String curlOptions
      • processMarkdown

        protected boolean processMarkdown
      • scriptName

        protected String scriptName
      • generateBashCompletion

        protected boolean generateBashCompletion
      • generateZshCompletion

        protected boolean generateZshCompletion
      • hostEnvironmentVariable

        protected String hostEnvironmentVariable
      • basicAuthEnvironmentVariable

        protected String basicAuthEnvironmentVariable
      • apiKeyAuthEnvironmentVariable

        protected String apiKeyAuthEnvironmentVariable
      • apiDocPath

        protected String apiDocPath
      • modelDocPath

        protected String modelDocPath
      • BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME

        public static final String BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME
        See Also:
        Constant Field Values
      • APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME

        public static final String APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • BashClientCodegen

        public BashClientCodegen()
    • Method Detail

      • getName

        public String getName()
        Configures a friendly name for the generator. This will be used by the generator to select the library with the -l flag.
        Specified by:
        getName in interface CodegenConfig
        Returns:
        the friendly name for the generator
      • getHelp

        public String getHelp()
        Returns human-friendly help for the generator. Provide the consumer with help tips, parameters here
        Specified by:
        getHelp in interface CodegenConfig
        Returns:
        A string value for the help message
      • setCurlOptions

        public void setCurlOptions​(String curlOptions)
      • setProcessMarkdown

        public void setProcessMarkdown​(boolean processMarkdown)
      • setScriptName

        public void setScriptName​(String scriptName)
      • setGenerateBashCompletion

        public void setGenerateBashCompletion​(boolean generateBashCompletion)
      • setGenerateZshCompletion

        public void setGenerateZshCompletion​(boolean generateZshCompletion)
      • setHostEnvironmentVariable

        public void setHostEnvironmentVariable​(String hostEnvironmentVariable)
      • setBasicAuthEnvironmentVariable

        public void setBasicAuthEnvironmentVariable​(String basicAuthEnvironmentVariable)
      • setApiKeyAuthEnvironmentVariable

        public void setApiKeyAuthEnvironmentVariable​(String apiKeyAuthEnvironmentVariable)
      • escapeReservedWord

        public String escapeReservedWord​(String name)
        Escapes a reserved word as defined in the `reservedWords` array. Handle escaping those terms here. This logic is only called if a variable matches the reserved words.
        Specified by:
        escapeReservedWord in interface CodegenConfig
        Overrides:
        escapeReservedWord in class DefaultCodegen
        Parameters:
        name - the name to be escaped
        Returns:
        the escaped term
      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.models.properties.Property p)
        Optional - type declaration. This is a String which is used by the templates to instantiate your types. There is typically special handling for different property types
        Specified by:
        getTypeDeclaration in interface CodegenConfig
        Overrides:
        getTypeDeclaration in class DefaultCodegen
        Parameters:
        p - Swagger Property object
        Returns:
        a string value used as the `dataType` field for model templates, `returnType` for api templates
      • getSwaggerType

        public String getSwaggerType​(io.swagger.models.properties.Property p)
        Optional - swagger type conversion. This is used to map swagger types in a `Property` into either language specific types via `typeMapping` or into complex models if there is not a mapping.
        Overrides:
        getSwaggerType in class DefaultCodegen
        Parameters:
        p - Swagger property object
        Returns:
        a string value of the type or complex model for this property
        See Also:
        Property
      • fromParameter

        public CodegenParameter fromParameter​(io.swagger.models.parameters.Parameter param,
                                              Set<String> imports)
        Convert Swagger Parameter object to Codegen Parameter object
        Overrides:
        fromParameter in class DefaultCodegen
        Parameters:
        param - Swagger parameter object
        imports - set of imports for library/package/module
        Returns:
        Codegen Parameter object
      • fromOperation

        public CodegenOperation fromOperation​(String path,
                                              String httpMethod,
                                              io.swagger.models.Operation operation,
                                              Map<String,​io.swagger.models.Model> definitions,
                                              io.swagger.models.Swagger swagger)
        Description copied from class: DefaultCodegen
        Convert Swagger Operation object to Codegen Operation object
        Specified by:
        fromOperation in interface CodegenConfig
        Overrides:
        fromOperation in class DefaultCodegen
        Parameters:
        path - the path of the operation
        httpMethod - HTTP method
        operation - Swagger operation object
        definitions - a map of Swagger models
        swagger - a Swagger object representing the spec
        Returns:
        Codegen Operation object
      • preprocessSwagger

        public void preprocessSwagger​(io.swagger.models.Swagger swagger)
        Preprocess original properties from the Swagger definition where necessary.
        Specified by:
        preprocessSwagger in interface CodegenConfig
        Overrides:
        preprocessSwagger in class DefaultCodegen
        Parameters:
        swagger - [description]