R/ObservationUnitDTO.r

# OpenSilex API
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 1.0.0-rc+2
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' ObservationUnitDTO Class
#'
#' @field blockNumber 
#' @field entryNumber 
#' @field entryType 
#' @field germplasmDbId 
#' @field germplasmName 
#' @field observationLevel 
#' @field observationLevels 
#' @field observationUnitDbId 
#' @field observationUnitXref 
#' @field observations 
#' @field plantNumber 
#' @field plotNumber 
#' @field positionCoordinateX 
#' @field positionCoordinateXType 
#' @field positionCoordinateY 
#' @field positionCoordinateYType 
#' @field programName 
#' @field replicate 
#' @field studyDbId 
#' @field studyLocation 
#' @field studyLocationDbId 
#' @field studyName 
#' @field treatments 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ObservationUnitDTO <- R6::R6Class(
  'ObservationUnitDTO',
  public = list(
    `blockNumber` = NULL,
    `entryNumber` = NULL,
    `entryType` = NULL,
    `germplasmDbId` = NULL,
    `germplasmName` = NULL,
    `observationLevel` = NULL,
    `observationLevels` = NULL,
    `observationUnitDbId` = NULL,
    `observationUnitXref` = NULL,
    `observations` = NULL,
    `plantNumber` = NULL,
    `plotNumber` = NULL,
    `positionCoordinateX` = NULL,
    `positionCoordinateXType` = NULL,
    `positionCoordinateY` = NULL,
    `positionCoordinateYType` = NULL,
    `programName` = NULL,
    `replicate` = NULL,
    `studyDbId` = NULL,
    `studyLocation` = NULL,
    `studyLocationDbId` = NULL,
    `studyName` = NULL,
    `treatments` = NULL,
    initialize = function(`blockNumber`, `entryNumber`, `entryType`, `germplasmDbId`, `germplasmName`, `observationLevel`, `observationLevels`, `observationUnitDbId`, `observationUnitXref`, `observations`, `plantNumber`, `plotNumber`, `positionCoordinateX`, `positionCoordinateXType`, `positionCoordinateY`, `positionCoordinateYType`, `programName`, `replicate`, `studyDbId`, `studyLocation`, `studyLocationDbId`, `studyName`, `treatments`){
      if (!missing(`blockNumber`)) {
        stopifnot(is.character(`blockNumber`), length(`blockNumber`) == 1)
        self$`blockNumber` <- `blockNumber`
      }
      if (!missing(`entryNumber`)) {
        stopifnot(is.character(`entryNumber`), length(`entryNumber`) == 1)
        self$`entryNumber` <- `entryNumber`
      }
      if (!missing(`entryType`)) {
        stopifnot(is.character(`entryType`), length(`entryType`) == 1)
        self$`entryType` <- `entryType`
      }
      if (!missing(`germplasmDbId`)) {
        stopifnot(is.character(`germplasmDbId`), length(`germplasmDbId`) == 1)
        self$`germplasmDbId` <- `germplasmDbId`
      }
      if (!missing(`germplasmName`)) {
        stopifnot(is.character(`germplasmName`), length(`germplasmName`) == 1)
        self$`germplasmName` <- `germplasmName`
      }
      if (!missing(`observationLevel`)) {
        stopifnot(is.character(`observationLevel`), length(`observationLevel`) == 1)
        self$`observationLevel` <- `observationLevel`
      }
      if (!missing(`observationLevels`)) {
        stopifnot(is.character(`observationLevels`), length(`observationLevels`) == 1)
        self$`observationLevels` <- `observationLevels`
      }
      if (!missing(`observationUnitDbId`)) {
        stopifnot(is.character(`observationUnitDbId`), length(`observationUnitDbId`) == 1)
        self$`observationUnitDbId` <- `observationUnitDbId`
      }
      if (!missing(`observationUnitXref`)) {
        stopifnot(is.list(`observationUnitXref`), length(`observationUnitXref`) != 0)
        lapply(`observationUnitXref`, function(x) stopifnot(R6::is.R6(x)))
        self$`observationUnitXref` <- `observationUnitXref`
      }
      if (!missing(`observations`)) {
        stopifnot(is.list(`observations`), length(`observations`) != 0)
        lapply(`observations`, function(x) stopifnot(R6::is.R6(x)))
        self$`observations` <- `observations`
      }
      if (!missing(`plantNumber`)) {
        stopifnot(is.character(`plantNumber`), length(`plantNumber`) == 1)
        self$`plantNumber` <- `plantNumber`
      }
      if (!missing(`plotNumber`)) {
        stopifnot(is.character(`plotNumber`), length(`plotNumber`) == 1)
        self$`plotNumber` <- `plotNumber`
      }
      if (!missing(`positionCoordinateX`)) {
        stopifnot(is.character(`positionCoordinateX`), length(`positionCoordinateX`) == 1)
        self$`positionCoordinateX` <- `positionCoordinateX`
      }
      if (!missing(`positionCoordinateXType`)) {
        stopifnot(is.character(`positionCoordinateXType`), length(`positionCoordinateXType`) == 1)
        self$`positionCoordinateXType` <- `positionCoordinateXType`
      }
      if (!missing(`positionCoordinateY`)) {
        stopifnot(is.character(`positionCoordinateY`), length(`positionCoordinateY`) == 1)
        self$`positionCoordinateY` <- `positionCoordinateY`
      }
      if (!missing(`positionCoordinateYType`)) {
        stopifnot(is.character(`positionCoordinateYType`), length(`positionCoordinateYType`) == 1)
        self$`positionCoordinateYType` <- `positionCoordinateYType`
      }
      if (!missing(`programName`)) {
        stopifnot(is.character(`programName`), length(`programName`) == 1)
        self$`programName` <- `programName`
      }
      if (!missing(`replicate`)) {
        stopifnot(is.character(`replicate`), length(`replicate`) == 1)
        self$`replicate` <- `replicate`
      }
      if (!missing(`studyDbId`)) {
        stopifnot(is.character(`studyDbId`), length(`studyDbId`) == 1)
        self$`studyDbId` <- `studyDbId`
      }
      if (!missing(`studyLocation`)) {
        stopifnot(is.character(`studyLocation`), length(`studyLocation`) == 1)
        self$`studyLocation` <- `studyLocation`
      }
      if (!missing(`studyLocationDbId`)) {
        stopifnot(is.character(`studyLocationDbId`), length(`studyLocationDbId`) == 1)
        self$`studyLocationDbId` <- `studyLocationDbId`
      }
      if (!missing(`studyName`)) {
        stopifnot(is.character(`studyName`), length(`studyName`) == 1)
        self$`studyName` <- `studyName`
      }
      if (!missing(`treatments`)) {
        stopifnot(is.list(`treatments`), length(`treatments`) != 0)
        lapply(`treatments`, function(x) stopifnot(R6::is.R6(x)))
        self$`treatments` <- `treatments`
      }
    },
    toJSON = function() {
      ObservationUnitDTOObject <- list()
      if (!is.null(self$`blockNumber`)) {
        ObservationUnitDTOObject[['blockNumber']] <- self$`blockNumber`
      }
      if (!is.null(self$`entryNumber`)) {
        ObservationUnitDTOObject[['entryNumber']] <- self$`entryNumber`
      }
      if (!is.null(self$`entryType`)) {
        ObservationUnitDTOObject[['entryType']] <- self$`entryType`
      }
      if (!is.null(self$`germplasmDbId`)) {
        ObservationUnitDTOObject[['germplasmDbId']] <- self$`germplasmDbId`
      }
      if (!is.null(self$`germplasmName`)) {
        ObservationUnitDTOObject[['germplasmName']] <- self$`germplasmName`
      }
      if (!is.null(self$`observationLevel`)) {
        ObservationUnitDTOObject[['observationLevel']] <- self$`observationLevel`
      }
      if (!is.null(self$`observationLevels`)) {
        ObservationUnitDTOObject[['observationLevels']] <- self$`observationLevels`
      }
      if (!is.null(self$`observationUnitDbId`)) {
        ObservationUnitDTOObject[['observationUnitDbId']] <- self$`observationUnitDbId`
      }
      if (!is.null(self$`observationUnitXref`)) {
        ObservationUnitDTOObject[['observationUnitXref']] <- lapply(self$`observationUnitXref`, function(x) x$toJSON())
      }
      if (!is.null(self$`observations`)) {
        ObservationUnitDTOObject[['observations']] <- lapply(self$`observations`, function(x) x$toJSON())
      }
      if (!is.null(self$`plantNumber`)) {
        ObservationUnitDTOObject[['plantNumber']] <- self$`plantNumber`
      }
      if (!is.null(self$`plotNumber`)) {
        ObservationUnitDTOObject[['plotNumber']] <- self$`plotNumber`
      }
      if (!is.null(self$`positionCoordinateX`)) {
        ObservationUnitDTOObject[['positionCoordinateX']] <- self$`positionCoordinateX`
      }
      if (!is.null(self$`positionCoordinateXType`)) {
        ObservationUnitDTOObject[['positionCoordinateXType']] <- self$`positionCoordinateXType`
      }
      if (!is.null(self$`positionCoordinateY`)) {
        ObservationUnitDTOObject[['positionCoordinateY']] <- self$`positionCoordinateY`
      }
      if (!is.null(self$`positionCoordinateYType`)) {
        ObservationUnitDTOObject[['positionCoordinateYType']] <- self$`positionCoordinateYType`
      }
      if (!is.null(self$`programName`)) {
        ObservationUnitDTOObject[['programName']] <- self$`programName`
      }
      if (!is.null(self$`replicate`)) {
        ObservationUnitDTOObject[['replicate']] <- self$`replicate`
      }
      if (!is.null(self$`studyDbId`)) {
        ObservationUnitDTOObject[['studyDbId']] <- self$`studyDbId`
      }
      if (!is.null(self$`studyLocation`)) {
        ObservationUnitDTOObject[['studyLocation']] <- self$`studyLocation`
      }
      if (!is.null(self$`studyLocationDbId`)) {
        ObservationUnitDTOObject[['studyLocationDbId']] <- self$`studyLocationDbId`
      }
      if (!is.null(self$`studyName`)) {
        ObservationUnitDTOObject[['studyName']] <- self$`studyName`
      }
      if (!is.null(self$`treatments`)) {
        ObservationUnitDTOObject[['treatments']] <- lapply(self$`treatments`, function(x) x$toJSON())
      }

      ObservationUnitDTOObject
    },
    fromJSON = function(ObservationUnitDTOJson) {
      ObservationUnitDTOObject <- jsonlite::fromJSON(ObservationUnitDTOJson)
      if (!is.null(ObservationUnitDTOObject$`blockNumber`)) {
        self$`blockNumber` <- ObservationUnitDTOObject$`blockNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`entryNumber`)) {
        self$`entryNumber` <- ObservationUnitDTOObject$`entryNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`entryType`)) {
        self$`entryType` <- ObservationUnitDTOObject$`entryType`
      }
      if (!is.null(ObservationUnitDTOObject$`germplasmDbId`)) {
        self$`germplasmDbId` <- ObservationUnitDTOObject$`germplasmDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`germplasmName`)) {
        self$`germplasmName` <- ObservationUnitDTOObject$`germplasmName`
      }
      if (!is.null(ObservationUnitDTOObject$`observationLevel`)) {
        self$`observationLevel` <- ObservationUnitDTOObject$`observationLevel`
      }
      if (!is.null(ObservationUnitDTOObject$`observationLevels`)) {
        self$`observationLevels` <- ObservationUnitDTOObject$`observationLevels`
      }
      if (!is.null(ObservationUnitDTOObject$`observationUnitDbId`)) {
        self$`observationUnitDbId` <- ObservationUnitDTOObject$`observationUnitDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`observationUnitXref`)) {
        self$`observationUnitXref` <- lapply(ObservationUnitDTOObject$`observationUnitXref`, function(x) {
          observationUnitXrefObject <- ObservationUnitXref$new()
          observationUnitXrefObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          observationUnitXrefObject
        })
      }
      if (!is.null(ObservationUnitDTOObject$`observations`)) {
        self$`observations` <- lapply(ObservationUnitDTOObject$`observations`, function(x) {
          observationsObject <- ObservationSummary$new()
          observationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          observationsObject
        })
      }
      if (!is.null(ObservationUnitDTOObject$`plantNumber`)) {
        self$`plantNumber` <- ObservationUnitDTOObject$`plantNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`plotNumber`)) {
        self$`plotNumber` <- ObservationUnitDTOObject$`plotNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateX`)) {
        self$`positionCoordinateX` <- ObservationUnitDTOObject$`positionCoordinateX`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateXType`)) {
        self$`positionCoordinateXType` <- ObservationUnitDTOObject$`positionCoordinateXType`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateY`)) {
        self$`positionCoordinateY` <- ObservationUnitDTOObject$`positionCoordinateY`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateYType`)) {
        self$`positionCoordinateYType` <- ObservationUnitDTOObject$`positionCoordinateYType`
      }
      if (!is.null(ObservationUnitDTOObject$`programName`)) {
        self$`programName` <- ObservationUnitDTOObject$`programName`
      }
      if (!is.null(ObservationUnitDTOObject$`replicate`)) {
        self$`replicate` <- ObservationUnitDTOObject$`replicate`
      }
      if (!is.null(ObservationUnitDTOObject$`studyDbId`)) {
        self$`studyDbId` <- ObservationUnitDTOObject$`studyDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`studyLocation`)) {
        self$`studyLocation` <- ObservationUnitDTOObject$`studyLocation`
      }
      if (!is.null(ObservationUnitDTOObject$`studyLocationDbId`)) {
        self$`studyLocationDbId` <- ObservationUnitDTOObject$`studyLocationDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`studyName`)) {
        self$`studyName` <- ObservationUnitDTOObject$`studyName`
      }
      if (!is.null(ObservationUnitDTOObject$`treatments`)) {
        self$`treatments` <- lapply(ObservationUnitDTOObject$`treatments`, function(x) {
          treatmentsObject <- ObservationTreatment$new()
          treatmentsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          treatmentsObject
        })
      }
    },
    fromJSONObject = function(ObservationUnitDTOObject) {
      if (!is.null(ObservationUnitDTOObject$`blockNumber`)) {
        self$`blockNumber` <- ObservationUnitDTOObject$`blockNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`entryNumber`)) {
        self$`entryNumber` <- ObservationUnitDTOObject$`entryNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`entryType`)) {
        self$`entryType` <- ObservationUnitDTOObject$`entryType`
      }
      if (!is.null(ObservationUnitDTOObject$`germplasmDbId`)) {
        self$`germplasmDbId` <- ObservationUnitDTOObject$`germplasmDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`germplasmName`)) {
        self$`germplasmName` <- ObservationUnitDTOObject$`germplasmName`
      }
      if (!is.null(ObservationUnitDTOObject$`observationLevel`)) {
        self$`observationLevel` <- ObservationUnitDTOObject$`observationLevel`
      }
      if (!is.null(ObservationUnitDTOObject$`observationLevels`)) {
        self$`observationLevels` <- ObservationUnitDTOObject$`observationLevels`
      }
      if (!is.null(ObservationUnitDTOObject$`observationUnitDbId`)) {
        self$`observationUnitDbId` <- ObservationUnitDTOObject$`observationUnitDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`observationUnitXref`)) {
        self$`observationUnitXref` <- lapply(ObservationUnitDTOObject$`observationUnitXref`, function(x) {
          observationUnitXrefObject <- ObservationUnitXref$new()
          observationUnitXrefObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          observationUnitXrefObject
        })
      }
      if (!is.null(ObservationUnitDTOObject$`observations`)) {
        self$`observations` <- lapply(ObservationUnitDTOObject$`observations`, function(x) {
          observationsObject <- ObservationSummary$new()
          observationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          observationsObject
        })
      }
      if (!is.null(ObservationUnitDTOObject$`plantNumber`)) {
        self$`plantNumber` <- ObservationUnitDTOObject$`plantNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`plotNumber`)) {
        self$`plotNumber` <- ObservationUnitDTOObject$`plotNumber`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateX`)) {
        self$`positionCoordinateX` <- ObservationUnitDTOObject$`positionCoordinateX`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateXType`)) {
        self$`positionCoordinateXType` <- ObservationUnitDTOObject$`positionCoordinateXType`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateY`)) {
        self$`positionCoordinateY` <- ObservationUnitDTOObject$`positionCoordinateY`
      }
      if (!is.null(ObservationUnitDTOObject$`positionCoordinateYType`)) {
        self$`positionCoordinateYType` <- ObservationUnitDTOObject$`positionCoordinateYType`
      }
      if (!is.null(ObservationUnitDTOObject$`programName`)) {
        self$`programName` <- ObservationUnitDTOObject$`programName`
      }
      if (!is.null(ObservationUnitDTOObject$`replicate`)) {
        self$`replicate` <- ObservationUnitDTOObject$`replicate`
      }
      if (!is.null(ObservationUnitDTOObject$`studyDbId`)) {
        self$`studyDbId` <- ObservationUnitDTOObject$`studyDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`studyLocation`)) {
        self$`studyLocation` <- ObservationUnitDTOObject$`studyLocation`
      }
      if (!is.null(ObservationUnitDTOObject$`studyLocationDbId`)) {
        self$`studyLocationDbId` <- ObservationUnitDTOObject$`studyLocationDbId`
      }
      if (!is.null(ObservationUnitDTOObject$`studyName`)) {
        self$`studyName` <- ObservationUnitDTOObject$`studyName`
      }
      if (!is.null(ObservationUnitDTOObject$`treatments`)) {
        self$`treatments` <- lapply(ObservationUnitDTOObject$`treatments`, function(x) {
          treatmentsObject <- ObservationTreatment$new()
          treatmentsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
          treatmentsObject
        })
      }
    },
    toJSONString = function() {
      observationUnitXrefList = paste(lapply(self$`observationUnitXref`, function(x) x$toJSONString()),collapse = ",")
      observationsList = paste(lapply(self$`observations`, function(x) x$toJSONString()),collapse = ",")
      treatmentsList = paste(lapply(self$`treatments`, function(x) x$toJSONString()),collapse = ",")
       sprintf(
        '{
           "blockNumber": %s,
           "entryNumber": %s,
           "entryType": %s,
           "germplasmDbId": %s,
           "germplasmName": %s,
           "observationLevel": %s,
           "observationLevels": %s,
           "observationUnitDbId": %s,
           "observationUnitXref": [%s],
           "observations": [%s],
           "plantNumber": %s,
           "plotNumber": %s,
           "positionCoordinateX": %s,
           "positionCoordinateXType": %s,
           "positionCoordinateY": %s,
           "positionCoordinateYType": %s,
           "programName": %s,
           "replicate": %s,
           "studyDbId": %s,
           "studyLocation": %s,
           "studyLocationDbId": %s,
           "studyName": %s,
           "treatments": [%s]
        }',
        ifelse(is.null(self$`blockNumber`), "null",jsonlite::toJSON(self$`blockNumber`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`entryNumber`), "null",jsonlite::toJSON(self$`entryNumber`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`entryType`), "null",jsonlite::toJSON(self$`entryType`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`germplasmDbId`), "null",jsonlite::toJSON(self$`germplasmDbId`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`germplasmName`), "null",jsonlite::toJSON(self$`germplasmName`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`observationLevel`), "null",jsonlite::toJSON(self$`observationLevel`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`observationLevels`), "null",jsonlite::toJSON(self$`observationLevels`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`observationUnitDbId`), "null",jsonlite::toJSON(self$`observationUnitDbId`,auto_unbox=TRUE, null = "null")),
        observationUnitXrefList,
        observationsList,
        ifelse(is.null(self$`plantNumber`), "null",jsonlite::toJSON(self$`plantNumber`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`plotNumber`), "null",jsonlite::toJSON(self$`plotNumber`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`positionCoordinateX`), "null",jsonlite::toJSON(self$`positionCoordinateX`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`positionCoordinateXType`), "null",jsonlite::toJSON(self$`positionCoordinateXType`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`positionCoordinateY`), "null",jsonlite::toJSON(self$`positionCoordinateY`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`positionCoordinateYType`), "null",jsonlite::toJSON(self$`positionCoordinateYType`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`programName`), "null",jsonlite::toJSON(self$`programName`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`replicate`), "null",jsonlite::toJSON(self$`replicate`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`studyDbId`), "null",jsonlite::toJSON(self$`studyDbId`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`studyLocation`), "null",jsonlite::toJSON(self$`studyLocation`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`studyLocationDbId`), "null",jsonlite::toJSON(self$`studyLocationDbId`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`studyName`), "null",jsonlite::toJSON(self$`studyName`,auto_unbox=TRUE, null = "null")),
        treatmentsList
      )
    },
    fromJSONString = function(ObservationUnitDTOJson) {
      ObservationUnitDTOObject <- jsonlite::fromJSON(ObservationUnitDTOJson)
      self$`blockNumber` <- ObservationUnitDTOObject$`blockNumber`
      self$`entryNumber` <- ObservationUnitDTOObject$`entryNumber`
      self$`entryType` <- ObservationUnitDTOObject$`entryType`
      self$`germplasmDbId` <- ObservationUnitDTOObject$`germplasmDbId`
      self$`germplasmName` <- ObservationUnitDTOObject$`germplasmName`
      self$`observationLevel` <- ObservationUnitDTOObject$`observationLevel`
      self$`observationLevels` <- ObservationUnitDTOObject$`observationLevels`
      self$`observationUnitDbId` <- ObservationUnitDTOObject$`observationUnitDbId`
      self$`observationUnitXref` <- lapply(ObservationUnitDTOObject$`observationUnitXref`, function(x) ObservationUnitXref$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`observations` <- lapply(ObservationUnitDTOObject$`observations`, function(x) ObservationSummary$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`plantNumber` <- ObservationUnitDTOObject$`plantNumber`
      self$`plotNumber` <- ObservationUnitDTOObject$`plotNumber`
      self$`positionCoordinateX` <- ObservationUnitDTOObject$`positionCoordinateX`
      self$`positionCoordinateXType` <- ObservationUnitDTOObject$`positionCoordinateXType`
      self$`positionCoordinateY` <- ObservationUnitDTOObject$`positionCoordinateY`
      self$`positionCoordinateYType` <- ObservationUnitDTOObject$`positionCoordinateYType`
      self$`programName` <- ObservationUnitDTOObject$`programName`
      self$`replicate` <- ObservationUnitDTOObject$`replicate`
      self$`studyDbId` <- ObservationUnitDTOObject$`studyDbId`
      self$`studyLocation` <- ObservationUnitDTOObject$`studyLocation`
      self$`studyLocationDbId` <- ObservationUnitDTOObject$`studyLocationDbId`
      self$`studyName` <- ObservationUnitDTOObject$`studyName`
      self$`treatments` <- lapply(ObservationUnitDTOObject$`treatments`, function(x) ObservationTreatment$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
    }
  )
)
OpenSILEX/opensilexClientToolsR documentation built on Jan. 28, 2022, 5:03 a.m.