# 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
#' InfrastructureUpdateDTO Class
#'
#' @field uri
#' @field rdf_type
#' @field name
#' @field parents
#' @field groups
#' @field facilities
#' @field rdf_type_name
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InfrastructureUpdateDTO <- R6::R6Class(
'InfrastructureUpdateDTO',
public = list(
`uri` = NULL,
`rdf_type` = NULL,
`name` = NULL,
`parents` = NULL,
`groups` = NULL,
`facilities` = NULL,
`rdf_type_name` = NULL,
initialize = function(`uri`, `rdf_type`, `name`, `parents`, `groups`, `facilities`, `rdf_type_name`){
if (!missing(`uri`)) {
stopifnot(is.character(`uri`), length(`uri`) == 1)
self$`uri` <- `uri`
}
if (!missing(`rdf_type`)) {
stopifnot(is.character(`rdf_type`), length(`rdf_type`) == 1)
self$`rdf_type` <- `rdf_type`
}
if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
if (!missing(`parents`)) {
stopifnot(is.list(`parents`), length(`parents`) != 0)
lapply(`parents`, function(x) stopifnot(is.character(x)))
self$`parents` <- `parents`
}
if (!missing(`groups`)) {
stopifnot(is.list(`groups`), length(`groups`) != 0)
lapply(`groups`, function(x) stopifnot(is.character(x)))
self$`groups` <- `groups`
}
if (!missing(`facilities`)) {
stopifnot(is.list(`facilities`), length(`facilities`) != 0)
lapply(`facilities`, function(x) stopifnot(is.character(x)))
self$`facilities` <- `facilities`
}
if (!missing(`rdf_type_name`)) {
stopifnot(is.character(`rdf_type_name`), length(`rdf_type_name`) == 1)
self$`rdf_type_name` <- `rdf_type_name`
}
},
toJSON = function() {
InfrastructureUpdateDTOObject <- list()
if (!is.null(self$`uri`)) {
InfrastructureUpdateDTOObject[['uri']] <- self$`uri`
}
if (!is.null(self$`rdf_type`)) {
InfrastructureUpdateDTOObject[['rdf_type']] <- self$`rdf_type`
}
if (!is.null(self$`name`)) {
InfrastructureUpdateDTOObject[['name']] <- self$`name`
}
if (!is.null(self$`parents`)) {
InfrastructureUpdateDTOObject[['parents']] <- self$`parents`
}
if (!is.null(self$`groups`)) {
InfrastructureUpdateDTOObject[['groups']] <- self$`groups`
}
if (!is.null(self$`facilities`)) {
InfrastructureUpdateDTOObject[['facilities']] <- self$`facilities`
}
if (!is.null(self$`rdf_type_name`)) {
InfrastructureUpdateDTOObject[['rdf_type_name']] <- self$`rdf_type_name`
}
InfrastructureUpdateDTOObject
},
fromJSON = function(InfrastructureUpdateDTOJson) {
InfrastructureUpdateDTOObject <- jsonlite::fromJSON(InfrastructureUpdateDTOJson)
if (!is.null(InfrastructureUpdateDTOObject$`uri`)) {
self$`uri` <- InfrastructureUpdateDTOObject$`uri`
}
if (!is.null(InfrastructureUpdateDTOObject$`rdf_type`)) {
self$`rdf_type` <- InfrastructureUpdateDTOObject$`rdf_type`
}
if (!is.null(InfrastructureUpdateDTOObject$`name`)) {
self$`name` <- InfrastructureUpdateDTOObject$`name`
}
if (!is.null(InfrastructureUpdateDTOObject$`parents`)) {
self$`parents` <- InfrastructureUpdateDTOObject$`parents`
}
if (!is.null(InfrastructureUpdateDTOObject$`groups`)) {
self$`groups` <- InfrastructureUpdateDTOObject$`groups`
}
if (!is.null(InfrastructureUpdateDTOObject$`facilities`)) {
self$`facilities` <- InfrastructureUpdateDTOObject$`facilities`
}
if (!is.null(InfrastructureUpdateDTOObject$`rdf_type_name`)) {
self$`rdf_type_name` <- InfrastructureUpdateDTOObject$`rdf_type_name`
}
},
fromJSONObject = function(InfrastructureUpdateDTOObject) {
if (!is.null(InfrastructureUpdateDTOObject$`uri`)) {
self$`uri` <- InfrastructureUpdateDTOObject$`uri`
}
if (!is.null(InfrastructureUpdateDTOObject$`rdf_type`)) {
self$`rdf_type` <- InfrastructureUpdateDTOObject$`rdf_type`
}
if (!is.null(InfrastructureUpdateDTOObject$`name`)) {
self$`name` <- InfrastructureUpdateDTOObject$`name`
}
if (!is.null(InfrastructureUpdateDTOObject$`parents`)) {
self$`parents` <- InfrastructureUpdateDTOObject$`parents`
}
if (!is.null(InfrastructureUpdateDTOObject$`groups`)) {
self$`groups` <- InfrastructureUpdateDTOObject$`groups`
}
if (!is.null(InfrastructureUpdateDTOObject$`facilities`)) {
self$`facilities` <- InfrastructureUpdateDTOObject$`facilities`
}
if (!is.null(InfrastructureUpdateDTOObject$`rdf_type_name`)) {
self$`rdf_type_name` <- InfrastructureUpdateDTOObject$`rdf_type_name`
}
},
toJSONString = function() {
sprintf(
'{
"uri": %s,
"rdf_type": %s,
"name": %s,
"parents": [%s],
"groups": [%s],
"facilities": [%s],
"rdf_type_name": %s
}',
ifelse(is.null(self$`uri`), "null",jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`rdf_type`), "null",jsonlite::toJSON(self$`rdf_type`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`name`), "null",jsonlite::toJSON(self$`name`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`parents`) || length(self$`parents`) == 0, "" ,lapply(self$`parents`, 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$`facilities`) || length(self$`facilities`) == 0, "" ,lapply(self$`facilities`, function(x) paste(paste0('"', x, '"'), sep=","))),
ifelse(is.null(self$`rdf_type_name`), "null",jsonlite::toJSON(self$`rdf_type_name`,auto_unbox=TRUE, null = "null"))
)
},
fromJSONString = function(InfrastructureUpdateDTOJson) {
InfrastructureUpdateDTOObject <- jsonlite::fromJSON(InfrastructureUpdateDTOJson)
self$`uri` <- InfrastructureUpdateDTOObject$`uri`
self$`rdf_type` <- InfrastructureUpdateDTOObject$`rdf_type`
self$`name` <- InfrastructureUpdateDTOObject$`name`
self$`parents` <- InfrastructureUpdateDTOObject$`parents`
self$`groups` <- InfrastructureUpdateDTOObject$`groups`
self$`facilities` <- InfrastructureUpdateDTOObject$`facilities`
self$`rdf_type_name` <- InfrastructureUpdateDTOObject$`rdf_type_name`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.