R/configuration_response.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title ConfigurationResponse
#'
#' @description ConfigurationResponse Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field managers  list( character ) [optional]
#'
#' @field method  named list( object ) [optional]
#'
#' @field namespace  character [optional]
#'
#' @field name  character [optional]
#'
#' @field snapshotId  integer [optional]
#'
#' @field snapshotComment  character [optional]
#'
#' @field synopsis  character [optional]
#'
#' @field documentation  character [optional]
#'
#' @field createDate  character [optional]
#'
#' @field url  character [optional]
#'
#' @field payload  character [optional]
#'
#' @field entityType  character [optional]
#'
#' @field public  character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ConfigurationResponse <- R6::R6Class(
  'ConfigurationResponse',
  public = list(
    `managers` = NULL,
    `method` = NULL,
    `namespace` = NULL,
    `name` = NULL,
    `snapshotId` = NULL,
    `snapshotComment` = NULL,
    `synopsis` = NULL,
    `documentation` = NULL,
    `createDate` = NULL,
    `url` = NULL,
    `payload` = NULL,
    `entityType` = NULL,
    `public` = NULL,
    initialize = function(
        `managers`=NULL, `method`=NULL, `namespace`='YOUR_NAMESPACE', `name`='BWA', `snapshotId`=NULL, `snapshotComment`='Improved spline reticulation', `synopsis`='Quickly aligns short nucleotide sequences.', `documentation`='BWA is a software package for mapping low-divergent sequences
against a large reference genome, such as the human genome.
It consists of three algorithms: BWA-backtrack, BWA-SW and BWA-MEM.
', `createDate`=NULL, `url`=NULL, `payload`='{ "methodRepoMethod": { "methodNamespace": "YOUR_NAMESPACE", "methodName": "BWA", "methodVersion": 1}}
', `entityType`='Task', `public`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!is.null(`managers`)) {
        stopifnot(is.vector(`managers`), length(`managers`) != 0)
        sapply(`managers`, function(x) stopifnot(is.character(x)))
        self$`managers` <- `managers`
      }
      if (!is.null(`method`)) {
        stopifnot(is.vector(`method`), length(`method`) != 0)
        sapply(`method`, function(x) stopifnot(is.character(x)))
        self$`method` <- `method`
      }
      if (!is.null(`namespace`)) {
        stopifnot(is.character(`namespace`), length(`namespace`) == 1)
        self$`namespace` <- `namespace`
      }
      if (!is.null(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!is.null(`snapshotId`)) {
        stopifnot(is.numeric(`snapshotId`), length(`snapshotId`) == 1)
        self$`snapshotId` <- `snapshotId`
      }
      if (!is.null(`snapshotComment`)) {
        stopifnot(is.character(`snapshotComment`), length(`snapshotComment`) == 1)
        self$`snapshotComment` <- `snapshotComment`
      }
      if (!is.null(`synopsis`)) {
        stopifnot(is.character(`synopsis`), length(`synopsis`) == 1)
        self$`synopsis` <- `synopsis`
      }
      if (!is.null(`documentation`)) {
        stopifnot(is.character(`documentation`), length(`documentation`) == 1)
        self$`documentation` <- `documentation`
      }
      if (!is.null(`createDate`)) {
        stopifnot(is.character(`createDate`), length(`createDate`) == 1)
        self$`createDate` <- `createDate`
      }
      if (!is.null(`url`)) {
        stopifnot(is.character(`url`), length(`url`) == 1)
        self$`url` <- `url`
      }
      if (!is.null(`payload`)) {
        stopifnot(is.character(`payload`), length(`payload`) == 1)
        self$`payload` <- `payload`
      }
      if (!is.null(`entityType`)) {
        stopifnot(is.character(`entityType`), length(`entityType`) == 1)
        self$`entityType` <- `entityType`
      }
      if (!is.null(`public`)) {
        self$`public` <- `public`
      }
    },
    toJSON = function() {
      ConfigurationResponseObject <- list()
      if (!is.null(self$`managers`)) {
        ConfigurationResponseObject[['managers']] <-
          self$`managers`
      }
      if (!is.null(self$`method`)) {
        ConfigurationResponseObject[['method']] <-
          self$`method`
      }
      if (!is.null(self$`namespace`)) {
        ConfigurationResponseObject[['namespace']] <-
          self$`namespace`
      }
      if (!is.null(self$`name`)) {
        ConfigurationResponseObject[['name']] <-
          self$`name`
      }
      if (!is.null(self$`snapshotId`)) {
        ConfigurationResponseObject[['snapshotId']] <-
          self$`snapshotId`
      }
      if (!is.null(self$`snapshotComment`)) {
        ConfigurationResponseObject[['snapshotComment']] <-
          self$`snapshotComment`
      }
      if (!is.null(self$`synopsis`)) {
        ConfigurationResponseObject[['synopsis']] <-
          self$`synopsis`
      }
      if (!is.null(self$`documentation`)) {
        ConfigurationResponseObject[['documentation']] <-
          self$`documentation`
      }
      if (!is.null(self$`createDate`)) {
        ConfigurationResponseObject[['createDate']] <-
          self$`createDate`
      }
      if (!is.null(self$`url`)) {
        ConfigurationResponseObject[['url']] <-
          self$`url`
      }
      if (!is.null(self$`payload`)) {
        ConfigurationResponseObject[['payload']] <-
          self$`payload`
      }
      if (!is.null(self$`entityType`)) {
        ConfigurationResponseObject[['entityType']] <-
          self$`entityType`
      }
      if (!is.null(self$`public`)) {
        ConfigurationResponseObject[['public']] <-
          self$`public`
      }

      ConfigurationResponseObject
    },
    fromJSON = function(ConfigurationResponseJson) {
      ConfigurationResponseObject <- jsonlite::fromJSON(ConfigurationResponseJson)
      if (!is.null(ConfigurationResponseObject$`managers`)) {
        self$`managers` <- ApiClient$new()$deserializeObj(ConfigurationResponseObject$`managers`, "array[character]", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationResponseObject$`method`)) {
        self$`method` <- ApiClient$new()$deserializeObj(ConfigurationResponseObject$`method`, "map(object)", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationResponseObject$`namespace`)) {
        self$`namespace` <- ConfigurationResponseObject$`namespace`
      }
      if (!is.null(ConfigurationResponseObject$`name`)) {
        self$`name` <- ConfigurationResponseObject$`name`
      }
      if (!is.null(ConfigurationResponseObject$`snapshotId`)) {
        self$`snapshotId` <- ConfigurationResponseObject$`snapshotId`
      }
      if (!is.null(ConfigurationResponseObject$`snapshotComment`)) {
        self$`snapshotComment` <- ConfigurationResponseObject$`snapshotComment`
      }
      if (!is.null(ConfigurationResponseObject$`synopsis`)) {
        self$`synopsis` <- ConfigurationResponseObject$`synopsis`
      }
      if (!is.null(ConfigurationResponseObject$`documentation`)) {
        self$`documentation` <- ConfigurationResponseObject$`documentation`
      }
      if (!is.null(ConfigurationResponseObject$`createDate`)) {
        self$`createDate` <- ConfigurationResponseObject$`createDate`
      }
      if (!is.null(ConfigurationResponseObject$`url`)) {
        self$`url` <- ConfigurationResponseObject$`url`
      }
      if (!is.null(ConfigurationResponseObject$`payload`)) {
        self$`payload` <- ConfigurationResponseObject$`payload`
      }
      if (!is.null(ConfigurationResponseObject$`entityType`)) {
        self$`entityType` <- ConfigurationResponseObject$`entityType`
      }
      if (!is.null(ConfigurationResponseObject$`public`)) {
        self$`public` <- ConfigurationResponseObject$`public`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`managers`)) {
        sprintf(
        '"managers":
           [%s]
        ',
        paste(unlist(lapply(self$`managers`, function(x) paste0('"', x, '"'))), collapse=",")
        )},
        if (!is.null(self$`method`)) {
        sprintf(
        '"method":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`method`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )},
        if (!is.null(self$`namespace`)) {
        sprintf(
        '"namespace":
          "%s"
                ',
        self$`namespace`
        )},
        if (!is.null(self$`name`)) {
        sprintf(
        '"name":
          "%s"
                ',
        self$`name`
        )},
        if (!is.null(self$`snapshotId`)) {
        sprintf(
        '"snapshotId":
          %d
                ',
        self$`snapshotId`
        )},
        if (!is.null(self$`snapshotComment`)) {
        sprintf(
        '"snapshotComment":
          "%s"
                ',
        self$`snapshotComment`
        )},
        if (!is.null(self$`synopsis`)) {
        sprintf(
        '"synopsis":
          "%s"
                ',
        self$`synopsis`
        )},
        if (!is.null(self$`documentation`)) {
        sprintf(
        '"documentation":
          "%s"
                ',
        self$`documentation`
        )},
        if (!is.null(self$`createDate`)) {
        sprintf(
        '"createDate":
          "%s"
                ',
        self$`createDate`
        )},
        if (!is.null(self$`url`)) {
        sprintf(
        '"url":
          "%s"
                ',
        self$`url`
        )},
        if (!is.null(self$`payload`)) {
        sprintf(
        '"payload":
          "%s"
                ',
        self$`payload`
        )},
        if (!is.null(self$`entityType`)) {
        sprintf(
        '"entityType":
          "%s"
                ',
        self$`entityType`
        )},
        if (!is.null(self$`public`)) {
        sprintf(
        '"public":
          "%s"
                ',
        self$`public`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(ConfigurationResponseJson) {
      ConfigurationResponseObject <- jsonlite::fromJSON(ConfigurationResponseJson)
      self$`managers` <- ApiClient$new()$deserializeObj(ConfigurationResponseObject$`managers`, "array[character]", loadNamespace("openapi"))
      self$`method` <- ApiClient$new()$deserializeObj(ConfigurationResponseObject$`method`, "map(object)", loadNamespace("openapi"))
      self$`namespace` <- ConfigurationResponseObject$`namespace`
      self$`name` <- ConfigurationResponseObject$`name`
      self$`snapshotId` <- ConfigurationResponseObject$`snapshotId`
      self$`snapshotComment` <- ConfigurationResponseObject$`snapshotComment`
      self$`synopsis` <- ConfigurationResponseObject$`synopsis`
      self$`documentation` <- ConfigurationResponseObject$`documentation`
      self$`createDate` <- ConfigurationResponseObject$`createDate`
      self$`url` <- ConfigurationResponseObject$`url`
      self$`payload` <- ConfigurationResponseObject$`payload`
      self$`entityType` <- ConfigurationResponseObject$`entityType`
      self$`public` <- ConfigurationResponseObject$`public`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.