R/ApplicationArgumentDetails.r

# Agave Platform Science API
#
# Power your digital lab and reduce the time from theory to discovery using the Agave Science-as-a-Service API Platform. Agave provides hosted services that allow researchers to manage data, conduct experiments, and publish and share results from anywhere at any time.
#
# Agave Platform version: 2.2.14
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' ApplicationArgumentDetails Class
#'
#' 
#'
#' @field description Description of this input.
#' @field label The label for this input
#' @field argument The command line value of this input (ex -n, --name, -name, etc)
#' @field showArgument Whether the argument value should be passed into the wrapper at run time
#' @field repeatArgument Whether the argument value should be repeated in front of each user-supplied input before injection into the wrapper template at runtime
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ApplicationArgumentDetails <- R6::R6Class(
  'ApplicationArgumentDetails',
  public = list(
    `description` = NULL,
    `label` = NULL,
    `argument` = NULL,
    `showArgument` = NULL,
    `repeatArgument` = NULL,
    initialize = function(`description`, `label`, `argument`, `showArgument`, `repeatArgument`){
      if (!missing(`description`)) {
        stopifnot(is.character(`description`), length(`description`) == 1)
        self$`description` <- `description`
      }
      if (!missing(`label`)) {
        stopifnot(is.character(`label`), length(`label`) == 1)
        self$`label` <- `label`
      }
      if (!missing(`argument`)) {
        stopifnot(is.character(`argument`), length(`argument`) == 1)
        self$`argument` <- `argument`
      }
      if (!missing(`showArgument`)) {
        self$`showArgument` <- `showArgument`
      }
      if (!missing(`repeatArgument`)) {
        self$`repeatArgument` <- `repeatArgument`
      }
    },
    asJSON = function() {
      self$toJSON()
    },
    toJSON = function() {
      ApplicationArgumentDetailsObject <- list()
      if (!is.null(self$`description`)) {
        ApplicationArgumentDetailsObject[['description']] <- self$`description`
      }
      else {
        ApplicationArgumentDetailsObject[['description']] <- NULL
      }
      if (!is.null(self$`label`)) {
        ApplicationArgumentDetailsObject[['label']] <- self$`label`
      }
      else {
        ApplicationArgumentDetailsObject[['label']] <- NULL
      }
      if (!is.null(self$`argument`)) {
        ApplicationArgumentDetailsObject[['argument']] <- self$`argument`
      }
      else {
        ApplicationArgumentDetailsObject[['argument']] <- NULL
      }
      if (!is.null(self$`showArgument`)) {
        ApplicationArgumentDetailsObject[['showArgument']] <- self$`showArgument`
      }
      else {
        ApplicationArgumentDetailsObject[['showArgument']] <- NULL
      }
      if (!is.null(self$`repeatArgument`)) {
        ApplicationArgumentDetailsObject[['repeatArgument']] <- self$`repeatArgument`
      }
      else {
        ApplicationArgumentDetailsObject[['repeatArgument']] <- NULL
      }

      ApplicationArgumentDetailsObject
    },
    fromJSON = function(ApplicationArgumentDetailsObject) {
      if (is.character(ApplicationArgumentDetailsObject)) {
        ApplicationArgumentDetailsObject <- jsonlite::fromJSON(ApplicationArgumentDetailsJson)
      }

      if ("result" %in% names(ApplicationArgumentDetailsObject)) {
        ApplicationArgumentDetailsObject <- ApplicationArgumentDetailsObject$result
      }

      if (!is.null(ApplicationArgumentDetailsObject$`description`)) {
        self$`description` <- ApplicationArgumentDetailsObject$`description`
      }
      if (!is.null(ApplicationArgumentDetailsObject$`label`)) {
        self$`label` <- ApplicationArgumentDetailsObject$`label`
      }
      if (!is.null(ApplicationArgumentDetailsObject$`argument`)) {
        self$`argument` <- ApplicationArgumentDetailsObject$`argument`
      }
      if (!is.null(ApplicationArgumentDetailsObject$`showArgument`)) {
        self$`showArgument` <- ApplicationArgumentDetailsObject$`showArgument`
      }
      if (!is.null(ApplicationArgumentDetailsObject$`repeatArgument`)) {
        self$`repeatArgument` <- ApplicationArgumentDetailsObject$`repeatArgument`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "description": %s,
           "label": %s,
           "argument": %s,
           "showArgument": %s,
           "repeatArgument": %s
        }',
        ifelse( is.null(self$`description`),"null",paste0(c('"', self$`description`, '"'))),
        ifelse( is.null(self$`label`),"null",paste0(c('"', self$`label`, '"'))),
        ifelse( is.null(self$`argument`),"null",paste0(c('"', self$`argument`, '"'))),
        ifelse( is.null(self$`showArgument`),"null",paste0(c('"', self$`showArgument`, '"'))),
        ifelse( is.null(self$`repeatArgument`),"null",paste0(c('"', self$`repeatArgument`, '"')))
      )
    },
    fromJSONString = function(ApplicationArgumentDetailsJson) {
      ApplicationArgumentDetailsObject <- jsonlite::fromJSON(ApplicationArgumentDetailsJson)
      self::fromJSON(ApplicationArgumentDetailsObject)

    }
  )
)
agaveplatform/r-sdk documentation built on May 13, 2019, 8:20 a.m.