# 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
#' ObservationTreatment Class
#'
#' @field factor
#' @field modality
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ObservationTreatment <- R6::R6Class(
'ObservationTreatment',
public = list(
`factor` = NULL,
`modality` = NULL,
initialize = function(`factor`, `modality`){
if (!missing(`factor`)) {
stopifnot(is.character(`factor`), length(`factor`) == 1)
self$`factor` <- `factor`
}
if (!missing(`modality`)) {
stopifnot(is.character(`modality`), length(`modality`) == 1)
self$`modality` <- `modality`
}
},
toJSON = function() {
ObservationTreatmentObject <- list()
if (!is.null(self$`factor`)) {
ObservationTreatmentObject[['factor']] <- self$`factor`
}
if (!is.null(self$`modality`)) {
ObservationTreatmentObject[['modality']] <- self$`modality`
}
ObservationTreatmentObject
},
fromJSON = function(ObservationTreatmentJson) {
ObservationTreatmentObject <- jsonlite::fromJSON(ObservationTreatmentJson)
if (!is.null(ObservationTreatmentObject$`factor`)) {
self$`factor` <- ObservationTreatmentObject$`factor`
}
if (!is.null(ObservationTreatmentObject$`modality`)) {
self$`modality` <- ObservationTreatmentObject$`modality`
}
},
fromJSONObject = function(ObservationTreatmentObject) {
if (!is.null(ObservationTreatmentObject$`factor`)) {
self$`factor` <- ObservationTreatmentObject$`factor`
}
if (!is.null(ObservationTreatmentObject$`modality`)) {
self$`modality` <- ObservationTreatmentObject$`modality`
}
},
toJSONString = function() {
sprintf(
'{
"factor": %s,
"modality": %s
}',
ifelse(is.null(self$`factor`), "null",jsonlite::toJSON(self$`factor`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`modality`), "null",jsonlite::toJSON(self$`modality`,auto_unbox=TRUE, null = "null"))
)
},
fromJSONString = function(ObservationTreatmentJson) {
ObservationTreatmentObject <- jsonlite::fromJSON(ObservationTreatmentJson)
self$`factor` <- ObservationTreatmentObject$`factor`
self$`modality` <- ObservationTreatmentObject$`modality`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.