# Dkube api server
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 2.2.1.11
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' UserCollectionJobsNotebooks Class
#'
#' @field running
#' @field completed
#' @field failed
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
UserCollectionJobsNotebooks <- R6::R6Class(
'UserCollectionJobsNotebooks',
public = list(
`running` = NULL,
`completed` = NULL,
`failed` = NULL,
initialize = function(`running`, `completed`, `failed`){
if (!missing(`running`)) {
stopifnot(is.list(`running`), length(`running`) != 0)
lapply(`running`, function(x) stopifnot(R6::is.R6(x)))
self$`running` <- `running`
}
if (!missing(`completed`)) {
stopifnot(is.list(`completed`), length(`completed`) != 0)
lapply(`completed`, function(x) stopifnot(R6::is.R6(x)))
self$`completed` <- `completed`
}
if (!missing(`failed`)) {
stopifnot(is.list(`failed`), length(`failed`) != 0)
lapply(`failed`, function(x) stopifnot(R6::is.R6(x)))
self$`failed` <- `failed`
}
},
toJSON = function() {
UserCollectionJobsNotebooksObject <- list()
if (!is.null(self$`running`)) {
UserCollectionJobsNotebooksObject[['running']] <- lapply(self$`running`, function(x) x$toJSON())
}
if (!is.null(self$`completed`)) {
UserCollectionJobsNotebooksObject[['completed']] <- lapply(self$`completed`, function(x) x$toJSON())
}
if (!is.null(self$`failed`)) {
UserCollectionJobsNotebooksObject[['failed']] <- lapply(self$`failed`, function(x) x$toJSON())
}
UserCollectionJobsNotebooksObject
},
fromJSON = function(UserCollectionJobsNotebooksJson) {
UserCollectionJobsNotebooksObject <- jsonlite::fromJSON(UserCollectionJobsNotebooksJson)
if (!is.null(UserCollectionJobsNotebooksObject$`running`)) {
self$`running` <- lapply(UserCollectionJobsNotebooksObject$`running`, function(x) {
runningObject <- JobCollection$new()
runningObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
runningObject
})
}
if (!is.null(UserCollectionJobsNotebooksObject$`completed`)) {
self$`completed` <- lapply(UserCollectionJobsNotebooksObject$`completed`, function(x) {
completedObject <- JobCollection$new()
completedObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
completedObject
})
}
if (!is.null(UserCollectionJobsNotebooksObject$`failed`)) {
self$`failed` <- lapply(UserCollectionJobsNotebooksObject$`failed`, function(x) {
failedObject <- JobCollection$new()
failedObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
failedObject
})
}
},
toJSONString = function() {
sprintf(
'{
"running": [%s],
"completed": [%s],
"failed": [%s]
}',
lapply(self$`running`, function(x) paste(x$toJSON(), sep=",")),
lapply(self$`completed`, function(x) paste(x$toJSON(), sep=",")),
lapply(self$`failed`, function(x) paste(x$toJSON(), sep=","))
)
},
fromJSONString = function(UserCollectionJobsNotebooksJson) {
UserCollectionJobsNotebooksObject <- jsonlite::fromJSON(UserCollectionJobsNotebooksJson)
self$`running` <- lapply(UserCollectionJobsNotebooksObject$`running`, function(x) JobCollection$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`completed` <- lapply(UserCollectionJobsNotebooksObject$`completed`, function(x) JobCollection$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
self$`failed` <- lapply(UserCollectionJobsNotebooksObject$`failed`, function(x) JobCollection$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.