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


#' ExecutionSystem Class
#'
#' Represents a system used for running Application codes. Also has the ability to store data and participate in transfer operations.
#'
#' @field description Verbose description of this system.
#' @field environment Environment variables to set upon login prior to job submission.
#' @field id Unique identifier for this system.
#' @field isDefault Is the system the default for the authenticated user?
#' @field isPublic Is the system publicly available?
#' @field lastModified The date this system was last modified in ISO 8601 format.
#' @field name Common name for this system.
#' @field revision The number of times this app has been updated.
#' @field scratchDir The scratch directory where job execution directories will be created at runtime. The workDir is used if this is not specified.
#' @field site The site associated with this system.
#' @field status 
#' @field storage 
#' @field type 
#' @field uuid The uuid of this system.
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ExecutionSystem <- R6::R6Class(
  'ExecutionSystem',
  public = list(
    `description` = NULL,
    `environment` = NULL,
    `id` = NULL,
    `isDefault` = NULL,
    `isPublic` = NULL,
    `lastModified` = NULL,
    `name` = NULL,
    `revision` = NULL,
    `scratchDir` = NULL,
    `site` = NULL,
    `status` = NULL,
    `storage` = NULL,
    `type` = NULL,
    `uuid` = NULL,
    initialize = function(`description`, `environment`, `id`, `isDefault`, `isPublic`, `lastModified`, `name`, `revision`, `scratchDir`, `site`, `status`, `storage`, `type`, `uuid`){
      if (!missing(`description`)) {
        stopifnot(is.character(`description`), length(`description`) == 1)
        self$`description` <- `description`
      }
      if (!missing(`environment`)) {
        stopifnot(is.character(`environment`), length(`environment`) == 1)
        self$`environment` <- `environment`
      }
      if (!missing(`id`)) {
        stopifnot(is.character(`id`), length(`id`) == 1)
        self$`id` <- `id`
      }
      if (!missing(`isDefault`)) {
        self$`isDefault` <- `isDefault`
      }
      if (!missing(`isPublic`)) {
        self$`isPublic` <- `isPublic`
      }
      if (!missing(`lastModified`)) {
        stopifnot(is.character(`lastModified`), length(`lastModified`) == 1)
        self$`lastModified` <- `lastModified`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`revision`)) {
        stopifnot(is.numeric(`revision`), length(`revision`) == 1)
        self$`revision` <- `revision`
      }
      if (!missing(`scratchDir`)) {
        stopifnot(is.character(`scratchDir`), length(`scratchDir`) == 1)
        self$`scratchDir` <- `scratchDir`
      }
      if (!missing(`site`)) {
        stopifnot(is.character(`site`), length(`site`) == 1)
        self$`site` <- `site`
      }
      if (!missing(`status`)) {
        stopifnot(R6::is.R6(`status`))
        self$`status` <- `status`
      }
      if (!missing(`storage`)) {
        stopifnot(R6::is.R6(`storage`))
        self$`storage` <- `storage`
      }
      if (!missing(`type`)) {
        stopifnot(R6::is.R6(`type`))
        self$`type` <- `type`
      }
      if (!missing(`uuid`)) {
        stopifnot(is.character(`uuid`), length(`uuid`) == 1)
        self$`uuid` <- `uuid`
      }
    },
    asJSON = function() {
      self$toJSON()
    },
    toJSON = function() {
      ExecutionSystemObject <- list()
      if (!is.null(self$`description`)) {
        ExecutionSystemObject[['description']] <- self$`description`
      }
      else {
        ExecutionSystemObject[['description']] <- NULL
      }
      if (!is.null(self$`environment`)) {
        ExecutionSystemObject[['environment']] <- self$`environment`
      }
      else {
        ExecutionSystemObject[['environment']] <- NULL
      }
      if (!is.null(self$`id`)) {
        ExecutionSystemObject[['id']] <- self$`id`
      }
      else {
        ExecutionSystemObject[['id']] <- NULL
      }
      if (!is.null(self$`isDefault`)) {
        ExecutionSystemObject[['isDefault']] <- self$`isDefault`
      }
      else {
        ExecutionSystemObject[['isDefault']] <- NULL
      }
      if (!is.null(self$`isPublic`)) {
        ExecutionSystemObject[['isPublic']] <- self$`isPublic`
      }
      else {
        ExecutionSystemObject[['isPublic']] <- NULL
      }
      if (!is.null(self$`lastModified`)) {
        ExecutionSystemObject[['lastModified']] <- self$`lastModified`
      }
      else {
        ExecutionSystemObject[['lastModified']] <- NULL
      }
      if (!is.null(self$`name`)) {
        ExecutionSystemObject[['name']] <- self$`name`
      }
      else {
        ExecutionSystemObject[['name']] <- NULL
      }
      if (!is.null(self$`revision`)) {
        ExecutionSystemObject[['revision']] <- self$`revision`
      }
      else {
        ExecutionSystemObject[['revision']] <- NULL
      }
      if (!is.null(self$`scratchDir`)) {
        ExecutionSystemObject[['scratchDir']] <- self$`scratchDir`
      }
      else {
        ExecutionSystemObject[['scratchDir']] <- NULL
      }
      if (!is.null(self$`site`)) {
        ExecutionSystemObject[['site']] <- self$`site`
      }
      else {
        ExecutionSystemObject[['site']] <- NULL
      }
      if (!is.null(self$`status`)) {
        ExecutionSystemObject[['status']] <- self$`status`$toJSON()
      }
      else {
        ExecutionSystemObject[['status']] <- NULL
      }
      if (!is.null(self$`storage`)) {
        ExecutionSystemObject[['storage']] <- self$`storage`$toJSON()
      }
      else {
        ExecutionSystemObject[['storage']] <- NULL
      }
      if (!is.null(self$`type`)) {
        ExecutionSystemObject[['type']] <- self$`type`$toJSON()
      }
      else {
        ExecutionSystemObject[['type']] <- NULL
      }
      if (!is.null(self$`uuid`)) {
        ExecutionSystemObject[['uuid']] <- self$`uuid`
      }
      else {
        ExecutionSystemObject[['uuid']] <- NULL
      }

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

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

      if (!is.null(ExecutionSystemObject$`description`)) {
        self$`description` <- ExecutionSystemObject$`description`
      }
      if (!is.null(ExecutionSystemObject$`environment`)) {
        self$`environment` <- ExecutionSystemObject$`environment`
      }
      if (!is.null(ExecutionSystemObject$`id`)) {
        self$`id` <- ExecutionSystemObject$`id`
      }
      if (!is.null(ExecutionSystemObject$`isDefault`)) {
        self$`isDefault` <- ExecutionSystemObject$`isDefault`
      }
      if (!is.null(ExecutionSystemObject$`isPublic`)) {
        self$`isPublic` <- ExecutionSystemObject$`isPublic`
      }
      if (!is.null(ExecutionSystemObject$`lastModified`)) {
        self$`lastModified` <- ExecutionSystemObject$`lastModified`
      }
      if (!is.null(ExecutionSystemObject$`name`)) {
        self$`name` <- ExecutionSystemObject$`name`
      }
      if (!is.null(ExecutionSystemObject$`revision`)) {
        self$`revision` <- ExecutionSystemObject$`revision`
      }
      if (!is.null(ExecutionSystemObject$`scratchDir`)) {
        self$`scratchDir` <- ExecutionSystemObject$`scratchDir`
      }
      if (!is.null(ExecutionSystemObject$`site`)) {
        self$`site` <- ExecutionSystemObject$`site`
      }
      if (!is.null(ExecutionSystemObject$`status`)) {
        statusObject <- SystemStatusType$new()
        statusObject$fromJSON(jsonlite::toJSON(ExecutionSystemObject$status, auto_unbox = TRUE))
        self$`status` <- statusObject
      }
      if (!is.null(ExecutionSystemObject$`storage`)) {
        storageObject <- SystemStorageConfig$new()
        storageObject$fromJSON(jsonlite::toJSON(ExecutionSystemObject$storage, auto_unbox = TRUE))
        self$`storage` <- storageObject
      }
      if (!is.null(ExecutionSystemObject$`type`)) {
        typeObject <- SystemType$new()
        typeObject$fromJSON(jsonlite::toJSON(ExecutionSystemObject$type, auto_unbox = TRUE))
        self$`type` <- typeObject
      }
      if (!is.null(ExecutionSystemObject$`uuid`)) {
        self$`uuid` <- ExecutionSystemObject$`uuid`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "description": %s,
           "environment": %s,
           "id": %s,
           "isDefault": %s,
           "isPublic": %s,
           "lastModified": %s,
           "name": %s,
           "revision": %d,
           "scratchDir": %s,
           "site": %s,
           "status": %s,
           "storage": %s,
           "type": %s,
           "uuid": %s
        }',
        ifelse( is.null(self$`description`),"null",paste0(c('"', self$`description`, '"'))),
        ifelse( is.null(self$`environment`),"null",paste0(c('"', self$`environment`, '"'))),
        ifelse( is.null(self$`id`),"null",paste0(c('"', self$`id`, '"'))),
        ifelse( is.null(self$`isDefault`),"null",paste0(c('"', self$`isDefault`, '"'))),
        ifelse( is.null(self$`isPublic`),"null",paste0(c('"', self$`isPublic`, '"'))),
        ifelse( is.null(self$`lastModified`),"null",paste0(c('"', self$`lastModified`, '"'))),
        ifelse( is.null(self$`name`),"null",paste0(c('"', self$`name`, '"'))),
        ifelse( is.null(self$`revision`),"null",paste0(c('"', self$`revision`, '"'))),
        ifelse( is.null(self$`scratchDir`),"null",paste0(c('"', self$`scratchDir`, '"'))),
        ifelse( is.null(self$`site`),"null",paste0(c('"', self$`site`, '"'))),
        self$`status`$toJSON(),
        self$`storage`$toJSON(),
        self$`type`$toJSON(),
        ifelse( is.null(self$`uuid`),"null",paste0(c('"', self$`uuid`, '"')))
      )
    },
    fromJSONString = function(ExecutionSystemJson) {
      ExecutionSystemObject <- jsonlite::fromJSON(ExecutionSystemJson)
      self::fromJSON(ExecutionSystemObject)

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