# 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
#' ExperimentGetDTO Class
#'
#' @field uri
#' @field name
#' @field start_date
#' @field end_date
#' @field description
#' @field objective
#' @field species
#' @field factors
#' @field organisations
#' @field facilities
#' @field projects
#' @field scientific_supervisors
#' @field technical_supervisors
#' @field groups
#' @field is_public
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ExperimentGetDTO <- R6::R6Class(
'ExperimentGetDTO',
public = list(
`uri` = NULL,
`name` = NULL,
`start_date` = NULL,
`end_date` = NULL,
`description` = NULL,
`objective` = NULL,
`species` = NULL,
`factors` = NULL,
`organisations` = NULL,
`facilities` = NULL,
`projects` = NULL,
`scientific_supervisors` = NULL,
`technical_supervisors` = NULL,
`groups` = NULL,
`is_public` = NULL,
initialize = function(`uri`, `name`, `start_date`, `end_date`, `description`, `objective`, `species`, `factors`, `organisations`, `facilities`, `projects`, `scientific_supervisors`, `technical_supervisors`, `groups`, `is_public`){
if (!missing(`uri`)) {
stopifnot(is.character(`uri`), length(`uri`) == 1)
self$`uri` <- `uri`
}
if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
if (!missing(`start_date`)) {
stopifnot(is.character(`start_date`), length(`start_date`) == 1)
self$`start_date` <- `start_date`
}
if (!missing(`end_date`)) {
stopifnot(is.character(`end_date`), length(`end_date`) == 1)
self$`end_date` <- `end_date`
}
if (!missing(`description`)) {
stopifnot(is.character(`description`), length(`description`) == 1)
self$`description` <- `description`
}
if (!missing(`objective`)) {
stopifnot(is.character(`objective`), length(`objective`) == 1)
self$`objective` <- `objective`
}
if (!missing(`species`)) {
stopifnot(is.list(`species`), length(`species`) != 0)
lapply(`species`, function(x) stopifnot(is.character(x)))
self$`species` <- `species`
}
if (!missing(`factors`)) {
stopifnot(is.list(`factors`), length(`factors`) != 0)
lapply(`factors`, function(x) stopifnot(is.character(x)))
self$`factors` <- `factors`
}
if (!missing(`organisations`)) {
stopifnot(is.list(`organisations`), length(`organisations`) != 0)
lapply(`organisations`, function(x) stopifnot(R6::is.R6(x)))
self$`organisations` <- `organisations`
}
if (!missing(`facilities`)) {
stopifnot(is.list(`facilities`), length(`facilities`) != 0)
lapply(`facilities`, function(x) stopifnot(R6::is.R6(x)))
self$`facilities` <- `facilities`
}
if (!missing(`projects`)) {
stopifnot(is.list(`projects`), length(`projects`) != 0)
lapply(`projects`, function(x) stopifnot(R6::is.R6(x)))
self$`projects` <- `projects`
}
if (!missing(`scientific_supervisors`)) {
stopifnot(is.list(`scientific_supervisors`), length(`scientific_supervisors`) != 0)
lapply(`scientific_supervisors`, function(x) stopifnot(is.character(x)))
self$`scientific_supervisors` <- `scientific_supervisors`
}
if (!missing(`technical_supervisors`)) {
stopifnot(is.list(`technical_supervisors`), length(`technical_supervisors`) != 0)
lapply(`technical_supervisors`, function(x) stopifnot(is.character(x)))
self$`technical_supervisors` <- `technical_supervisors`
}
if (!missing(`groups`)) {
stopifnot(is.list(`groups`), length(`groups`) != 0)
lapply(`groups`, function(x) stopifnot(is.character(x)))
self$`groups` <- `groups`
}
if (!missing(`is_public`)) {
self$`is_public` <- `is_public`
}
},
toJSON = function() {
ExperimentGetDTOObject <- list()
if (!is.null(self$`uri`)) {
ExperimentGetDTOObject[['uri']] <- self$`uri`
}
if (!is.null(self$`name`)) {
ExperimentGetDTOObject[['name']] <- self$`name`
}
if (!is.null(self$`start_date`)) {
ExperimentGetDTOObject[['start_date']] <- self$`start_date`
}
if (!is.null(self$`end_date`)) {
ExperimentGetDTOObject[['end_date']] <- self$`end_date`
}
if (!is.null(self$`description`)) {
ExperimentGetDTOObject[['description']] <- self$`description`
}
if (!is.null(self$`objective`)) {
ExperimentGetDTOObject[['objective']] <- self$`objective`
}
if (!is.null(self$`species`)) {
ExperimentGetDTOObject[['species']] <- self$`species`
}
if (!is.null(self$`factors`)) {
ExperimentGetDTOObject[['factors']] <- self$`factors`
}
if (!is.null(self$`organisations`)) {
ExperimentGetDTOObject[['organisations']] <- lapply(self$`organisations`, function(x) x$toJSON())
}
if (!is.null(self$`facilities`)) {
ExperimentGetDTOObject[['facilities']] <- lapply(self$`facilities`, function(x) x$toJSON())
}
if (!is.null(self$`projects`)) {
ExperimentGetDTOObject[['projects']] <- lapply(self$`projects`, function(x) x$toJSON())
}
if (!is.null(self$`scientific_supervisors`)) {
ExperimentGetDTOObject[['scientific_supervisors']] <- self$`scientific_supervisors`
}
if (!is.null(self$`technical_supervisors`)) {
ExperimentGetDTOObject[['technical_supervisors']] <- self$`technical_supervisors`
}
if (!is.null(self$`groups`)) {
ExperimentGetDTOObject[['groups']] <- self$`groups`
}
if (!is.null(self$`is_public`)) {
ExperimentGetDTOObject[['is_public']] <- self$`is_public`
}
ExperimentGetDTOObject
},
fromJSON = function(ExperimentGetDTOJson) {
ExperimentGetDTOObject <- jsonlite::fromJSON(ExperimentGetDTOJson)
if (!is.null(ExperimentGetDTOObject$`uri`)) {
self$`uri` <- ExperimentGetDTOObject$`uri`
}
if (!is.null(ExperimentGetDTOObject$`name`)) {
self$`name` <- ExperimentGetDTOObject$`name`
}
if (!is.null(ExperimentGetDTOObject$`start_date`)) {
self$`start_date` <- ExperimentGetDTOObject$`start_date`
}
if (!is.null(ExperimentGetDTOObject$`end_date`)) {
self$`end_date` <- ExperimentGetDTOObject$`end_date`
}
if (!is.null(ExperimentGetDTOObject$`description`)) {
self$`description` <- ExperimentGetDTOObject$`description`
}
if (!is.null(ExperimentGetDTOObject$`objective`)) {
self$`objective` <- ExperimentGetDTOObject$`objective`
}
if (!is.null(ExperimentGetDTOObject$`species`)) {
self$`species` <- ExperimentGetDTOObject$`species`
}
if (!is.null(ExperimentGetDTOObject$`factors`)) {
self$`factors` <- ExperimentGetDTOObject$`factors`
}
if (!is.null(ExperimentGetDTOObject$`organisations`)) {
self$`organisations` <- lapply(ExperimentGetDTOObject$`organisations`, function(x) {
organisationsObject <- NamedResourceDTOInfrastructureModel$new()
organisationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
organisationsObject
})
}
if (!is.null(ExperimentGetDTOObject$`facilities`)) {
self$`facilities` <- lapply(ExperimentGetDTOObject$`facilities`, function(x) {
facilitiesObject <- NamedResourceDTOInfrastructureFacilityModel$new()
facilitiesObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
facilitiesObject
})
}
if (!is.null(ExperimentGetDTOObject$`projects`)) {
self$`projects` <- lapply(ExperimentGetDTOObject$`projects`, function(x) {
projectsObject <- NamedResourceDTOProjectModel$new()
projectsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
projectsObject
})
}
if (!is.null(ExperimentGetDTOObject$`scientific_supervisors`)) {
self$`scientific_supervisors` <- ExperimentGetDTOObject$`scientific_supervisors`
}
if (!is.null(ExperimentGetDTOObject$`technical_supervisors`)) {
self$`technical_supervisors` <- ExperimentGetDTOObject$`technical_supervisors`
}
if (!is.null(ExperimentGetDTOObject$`groups`)) {
self$`groups` <- ExperimentGetDTOObject$`groups`
}
if (!is.null(ExperimentGetDTOObject$`is_public`)) {
self$`is_public` <- ExperimentGetDTOObject$`is_public`
}
},
fromJSONObject = function(ExperimentGetDTOObject) {
if (!is.null(ExperimentGetDTOObject$`uri`)) {
self$`uri` <- ExperimentGetDTOObject$`uri`
}
if (!is.null(ExperimentGetDTOObject$`name`)) {
self$`name` <- ExperimentGetDTOObject$`name`
}
if (!is.null(ExperimentGetDTOObject$`start_date`)) {
self$`start_date` <- ExperimentGetDTOObject$`start_date`
}
if (!is.null(ExperimentGetDTOObject$`end_date`)) {
self$`end_date` <- ExperimentGetDTOObject$`end_date`
}
if (!is.null(ExperimentGetDTOObject$`description`)) {
self$`description` <- ExperimentGetDTOObject$`description`
}
if (!is.null(ExperimentGetDTOObject$`objective`)) {
self$`objective` <- ExperimentGetDTOObject$`objective`
}
if (!is.null(ExperimentGetDTOObject$`species`)) {
self$`species` <- ExperimentGetDTOObject$`species`
}
if (!is.null(ExperimentGetDTOObject$`factors`)) {
self$`factors` <- ExperimentGetDTOObject$`factors`
}
if (!is.null(ExperimentGetDTOObject$`organisations`)) {
self$`organisations` <- lapply(ExperimentGetDTOObject$`organisations`, function(x) {
organisationsObject <- NamedResourceDTOInfrastructureModel$new()
organisationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
organisationsObject
})
}
if (!is.null(ExperimentGetDTOObject$`facilities`)) {
self$`facilities` <- lapply(ExperimentGetDTOObject$`facilities`, function(x) {
facilitiesObject <- NamedResourceDTOInfrastructureFacilityModel$new()
facilitiesObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
facilitiesObject
})
}
if (!is.null(ExperimentGetDTOObject$`projects`)) {
self$`projects` <- lapply(ExperimentGetDTOObject$`projects`, function(x) {
projectsObject <- NamedResourceDTOProjectModel$new()
projectsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
projectsObject
})
}
if (!is.null(ExperimentGetDTOObject$`scientific_supervisors`)) {
self$`scientific_supervisors` <- ExperimentGetDTOObject$`scientific_supervisors`
}
if (!is.null(ExperimentGetDTOObject$`technical_supervisors`)) {
self$`technical_supervisors` <- ExperimentGetDTOObject$`technical_supervisors`
}
if (!is.null(ExperimentGetDTOObject$`groups`)) {
self$`groups` <- ExperimentGetDTOObject$`groups`
}
if (!is.null(ExperimentGetDTOObject$`is_public`)) {
self$`is_public` <- ExperimentGetDTOObject$`is_public`
}
},
toJSONString = function() {
organisationsList = paste(lapply(self$`organisations`, function(x) x$toJSONString()),collapse = ",")
facilitiesList = paste(lapply(self$`facilities`, function(x) x$toJSONString()),collapse = ",")
projectsList = paste(lapply(self$`projects`, function(x) x$toJSONString()),collapse = ",")
sprintf(
'{
"uri": %s,
"name": %s,
"start_date": %s,
"end_date": %s,
"description": %s,
"objective": %s,
"species": [%s],
"factors": [%s],
"organisations": [%s],
"facilities": [%s],
"projects": [%s],
"scientific_supervisors": [%s],
"technical_supervisors": [%s],
"groups": [%s],
"is_public": %s
}',
ifelse(is.null(self$`uri`), "null",jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`name`), "null",jsonlite::toJSON(self$`name`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`start_date`), "null",jsonlite::toJSON(self$`start_date`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`end_date`), "null",jsonlite::toJSON(self$`end_date`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`description`), "null",jsonlite::toJSON(self$`description`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`objective`), "null",jsonlite::toJSON(self$`objective`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`species`) || length(self$`species`) == 0, "" ,lapply(self$`species`, function(x) paste(paste0('"', x, '"'), sep=","))),
ifelse(is.null(self$`factors`) || length(self$`factors`) == 0, "" ,lapply(self$`factors`, function(x) paste(paste0('"', x, '"'), sep=","))),
organisationsList,
facilitiesList,
projectsList,
ifelse(is.null(self$`scientific_supervisors`) || length(self$`scientific_supervisors`) == 0, "" ,lapply(self$`scientific_supervisors`, function(x) paste(paste0('"', x, '"'), sep=","))),
ifelse(is.null(self$`technical_supervisors`) || length(self$`technical_supervisors`) == 0, "" ,lapply(self$`technical_supervisors`, function(x) paste(paste0('"', x, '"'), sep=","))),
ifelse(is.null(self$`groups`) || length(self$`groups`) == 0, "" ,lapply(self$`groups`, function(x) paste(paste0('"', x, '"'), sep=","))),
ifelse(is.null(self$`is_public`), "null",jsonlite::toJSON(self$`is_public`,auto_unbox=TRUE, null = "null"))
)
},
fromJSONString = function(ExperimentGetDTOJson) {
ExperimentGetDTOObject <- jsonlite::fromJSON(ExperimentGetDTOJson)
self$`uri` <- ExperimentGetDTOObject$`uri`
self$`name` <- ExperimentGetDTOObject$`name`
self$`start_date` <- ExperimentGetDTOObject$`start_date`
self$`end_date` <- ExperimentGetDTOObject$`end_date`
self$`description` <- ExperimentGetDTOObject$`description`
self$`objective` <- ExperimentGetDTOObject$`objective`
self$`species` <- ExperimentGetDTOObject$`species`
self$`factors` <- ExperimentGetDTOObject$`factors`
self$`organisations` <- lapply(ExperimentGetDTOObject$`organisations`, function(x) NamedResourceDTOInfrastructureModel$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`facilities` <- lapply(ExperimentGetDTOObject$`facilities`, function(x) NamedResourceDTOInfrastructureFacilityModel$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`projects` <- lapply(ExperimentGetDTOObject$`projects`, function(x) NamedResourceDTOProjectModel$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`scientific_supervisors` <- ExperimentGetDTOObject$`scientific_supervisors`
self$`technical_supervisors` <- ExperimentGetDTOObject$`technical_supervisors`
self$`groups` <- ExperimentGetDTOObject$`groups`
self$`is_public` <- ExperimentGetDTOObject$`is_public`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.