# 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
#' MoveUpdateDTO Class
#'
#' @field uri
#' @field rdf_type
#' @field start
#' @field end
#' @field is_instant
#' @field description
#' @field targets
#' @field relations
#' @field from
#' @field to
#' @field targets_positions
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
MoveUpdateDTO <- R6::R6Class(
'MoveUpdateDTO',
public = list(
`uri` = NULL,
`rdf_type` = NULL,
`start` = NULL,
`end` = NULL,
`is_instant` = NULL,
`description` = NULL,
`targets` = NULL,
`relations` = NULL,
`from` = NULL,
`to` = NULL,
`targets_positions` = NULL,
initialize = function(`uri`, `rdf_type`, `start`, `end`, `is_instant`, `description`, `targets`, `relations`, `from`, `to`, `targets_positions`){
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(`start`)) {
stopifnot(is.character(`start`), length(`start`) == 1)
self$`start` <- `start`
}
if (!missing(`end`)) {
stopifnot(is.character(`end`), length(`end`) == 1)
self$`end` <- `end`
}
if (!missing(`is_instant`)) {
self$`is_instant` <- `is_instant`
}
if (!missing(`description`)) {
stopifnot(is.character(`description`), length(`description`) == 1)
self$`description` <- `description`
}
if (!missing(`targets`)) {
stopifnot(is.list(`targets`), length(`targets`) != 0)
lapply(`targets`, function(x) stopifnot(is.character(x)))
self$`targets` <- `targets`
}
if (!missing(`relations`)) {
stopifnot(is.list(`relations`), length(`relations`) != 0)
lapply(`relations`, function(x) stopifnot(R6::is.R6(x)))
self$`relations` <- `relations`
}
if (!missing(`from`)) {
stopifnot(is.character(`from`), length(`from`) == 1)
self$`from` <- `from`
}
if (!missing(`to`)) {
stopifnot(is.character(`to`), length(`to`) == 1)
self$`to` <- `to`
}
if (!missing(`targets_positions`)) {
stopifnot(is.list(`targets_positions`), length(`targets_positions`) != 0)
lapply(`targets_positions`, function(x) stopifnot(R6::is.R6(x)))
self$`targets_positions` <- `targets_positions`
}
},
toJSON = function() {
MoveUpdateDTOObject <- list()
if (!is.null(self$`uri`)) {
MoveUpdateDTOObject[['uri']] <- self$`uri`
}
if (!is.null(self$`rdf_type`)) {
MoveUpdateDTOObject[['rdf_type']] <- self$`rdf_type`
}
if (!is.null(self$`start`)) {
MoveUpdateDTOObject[['start']] <- self$`start`
}
if (!is.null(self$`end`)) {
MoveUpdateDTOObject[['end']] <- self$`end`
}
if (!is.null(self$`is_instant`)) {
MoveUpdateDTOObject[['is_instant']] <- self$`is_instant`
}
if (!is.null(self$`description`)) {
MoveUpdateDTOObject[['description']] <- self$`description`
}
if (!is.null(self$`targets`)) {
MoveUpdateDTOObject[['targets']] <- self$`targets`
}
if (!is.null(self$`relations`)) {
MoveUpdateDTOObject[['relations']] <- lapply(self$`relations`, function(x) x$toJSON())
}
if (!is.null(self$`from`)) {
MoveUpdateDTOObject[['from']] <- self$`from`
}
if (!is.null(self$`to`)) {
MoveUpdateDTOObject[['to']] <- self$`to`
}
if (!is.null(self$`targets_positions`)) {
MoveUpdateDTOObject[['targets_positions']] <- lapply(self$`targets_positions`, function(x) x$toJSON())
}
MoveUpdateDTOObject
},
fromJSON = function(MoveUpdateDTOJson) {
MoveUpdateDTOObject <- jsonlite::fromJSON(MoveUpdateDTOJson)
if (!is.null(MoveUpdateDTOObject$`uri`)) {
self$`uri` <- MoveUpdateDTOObject$`uri`
}
if (!is.null(MoveUpdateDTOObject$`rdf_type`)) {
self$`rdf_type` <- MoveUpdateDTOObject$`rdf_type`
}
if (!is.null(MoveUpdateDTOObject$`start`)) {
self$`start` <- MoveUpdateDTOObject$`start`
}
if (!is.null(MoveUpdateDTOObject$`end`)) {
self$`end` <- MoveUpdateDTOObject$`end`
}
if (!is.null(MoveUpdateDTOObject$`is_instant`)) {
self$`is_instant` <- MoveUpdateDTOObject$`is_instant`
}
if (!is.null(MoveUpdateDTOObject$`description`)) {
self$`description` <- MoveUpdateDTOObject$`description`
}
if (!is.null(MoveUpdateDTOObject$`targets`)) {
self$`targets` <- MoveUpdateDTOObject$`targets`
}
if (!is.null(MoveUpdateDTOObject$`relations`)) {
self$`relations` <- lapply(MoveUpdateDTOObject$`relations`, function(x) {
relationsObject <- RDFObjectRelationDTO$new()
relationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
relationsObject
})
}
if (!is.null(MoveUpdateDTOObject$`from`)) {
self$`from` <- MoveUpdateDTOObject$`from`
}
if (!is.null(MoveUpdateDTOObject$`to`)) {
self$`to` <- MoveUpdateDTOObject$`to`
}
if (!is.null(MoveUpdateDTOObject$`targets_positions`)) {
self$`targets_positions` <- lapply(MoveUpdateDTOObject$`targets_positions`, function(x) {
targets_positionsObject <- TargetPositionCreationDTO$new()
targets_positionsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
targets_positionsObject
})
}
},
fromJSONObject = function(MoveUpdateDTOObject) {
if (!is.null(MoveUpdateDTOObject$`uri`)) {
self$`uri` <- MoveUpdateDTOObject$`uri`
}
if (!is.null(MoveUpdateDTOObject$`rdf_type`)) {
self$`rdf_type` <- MoveUpdateDTOObject$`rdf_type`
}
if (!is.null(MoveUpdateDTOObject$`start`)) {
self$`start` <- MoveUpdateDTOObject$`start`
}
if (!is.null(MoveUpdateDTOObject$`end`)) {
self$`end` <- MoveUpdateDTOObject$`end`
}
if (!is.null(MoveUpdateDTOObject$`is_instant`)) {
self$`is_instant` <- MoveUpdateDTOObject$`is_instant`
}
if (!is.null(MoveUpdateDTOObject$`description`)) {
self$`description` <- MoveUpdateDTOObject$`description`
}
if (!is.null(MoveUpdateDTOObject$`targets`)) {
self$`targets` <- MoveUpdateDTOObject$`targets`
}
if (!is.null(MoveUpdateDTOObject$`relations`)) {
self$`relations` <- lapply(MoveUpdateDTOObject$`relations`, function(x) {
relationsObject <- RDFObjectRelationDTO$new()
relationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
relationsObject
})
}
if (!is.null(MoveUpdateDTOObject$`from`)) {
self$`from` <- MoveUpdateDTOObject$`from`
}
if (!is.null(MoveUpdateDTOObject$`to`)) {
self$`to` <- MoveUpdateDTOObject$`to`
}
if (!is.null(MoveUpdateDTOObject$`targets_positions`)) {
self$`targets_positions` <- lapply(MoveUpdateDTOObject$`targets_positions`, function(x) {
targets_positionsObject <- TargetPositionCreationDTO$new()
targets_positionsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE, null = "null"))
targets_positionsObject
})
}
},
toJSONString = function() {
relationsList = paste(lapply(self$`relations`, function(x) x$toJSONString()),collapse = ",")
targets_positionsList = paste(lapply(self$`targets_positions`, function(x) x$toJSONString()),collapse = ",")
sprintf(
'{
"uri": %s,
"rdf_type": %s,
"start": %s,
"end": %s,
"is_instant": %s,
"description": %s,
"targets": [%s],
"relations": [%s],
"from": %s,
"to": %s,
"targets_positions": [%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$`start`), "null",jsonlite::toJSON(self$`start`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`end`), "null",jsonlite::toJSON(self$`end`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`is_instant`), "null",jsonlite::toJSON(self$`is_instant`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`description`), "null",jsonlite::toJSON(self$`description`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`targets`) || length(self$`targets`) == 0, "" ,lapply(self$`targets`, function(x) paste(paste0('"', x, '"'), sep=","))),
relationsList,
ifelse(is.null(self$`from`), "null",jsonlite::toJSON(self$`from`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`to`), "null",jsonlite::toJSON(self$`to`,auto_unbox=TRUE, null = "null")),
targets_positionsList
)
},
fromJSONString = function(MoveUpdateDTOJson) {
MoveUpdateDTOObject <- jsonlite::fromJSON(MoveUpdateDTOJson)
self$`uri` <- MoveUpdateDTOObject$`uri`
self$`rdf_type` <- MoveUpdateDTOObject$`rdf_type`
self$`start` <- MoveUpdateDTOObject$`start`
self$`end` <- MoveUpdateDTOObject$`end`
self$`is_instant` <- MoveUpdateDTOObject$`is_instant`
self$`description` <- MoveUpdateDTOObject$`description`
self$`targets` <- MoveUpdateDTOObject$`targets`
self$`relations` <- lapply(MoveUpdateDTOObject$`relations`, function(x) RDFObjectRelationDTO$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`from` <- MoveUpdateDTOObject$`from`
self$`to` <- MoveUpdateDTOObject$`to`
self$`targets_positions` <- lapply(MoveUpdateDTOObject$`targets_positions`, function(x) TargetPositionCreationDTO$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.