R/JobInputs.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


#' JobInputs Class
#'
#' 
#'
#' @field parameter1 One or more inputs identified in the description of the app you're running. 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
JobInputs <- R6::R6Class(
  'JobInputs',
  public = list(
    `parameter1` = NULL,
    initialize = function(`parameter1`){
      if (!missing(`parameter1`)) {
        stopifnot(is.character(`parameter1`), length(`parameter1`) == 1)
        self$`parameter1` <- `parameter1`
      }
    },
    asJSON = function() {
      self$toJSON()
    },
    toJSON = function() {
      JobInputsObject <- list()
      if (!is.null(self$`parameter1`)) {
        JobInputsObject[['parameter1']] <- self$`parameter1`
      }
      else {
        JobInputsObject[['parameter1']] <- NULL
      }

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

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

      if (!is.null(JobInputsObject$`parameter1`)) {
        self$`parameter1` <- JobInputsObject$`parameter1`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "parameter1": %s
        }',
        ifelse( is.null(self$`parameter1`),"null",paste0(c('"', self$`parameter1`, '"')))
      )
    },
    fromJSONString = function(JobInputsJson) {
      JobInputsObject <- jsonlite::fromJSON(JobInputsJson)
      self::fromJSON(JobInputsObject)

    }
  )
)
deardooley/agave-rlang-sdk documentation built on May 17, 2019, 10:12 p.m.