# 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
#' GroupCollectionUsers Class
#'
#' @field user
#' @field devices
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
GroupCollectionUsers <- R6::R6Class(
'GroupCollectionUsers',
public = list(
`user` = NULL,
`devices` = NULL,
initialize = function(`user`, `devices`){
if (!missing(`user`)) {
stopifnot(R6::is.R6(`user`))
self$`user` <- `user`
}
if (!missing(`devices`)) {
stopifnot(is.list(`devices`), length(`devices`) != 0)
lapply(`devices`, function(x) stopifnot(R6::is.R6(x)))
self$`devices` <- `devices`
}
},
toJSON = function() {
GroupCollectionUsersObject <- list()
if (!is.null(self$`user`)) {
GroupCollectionUsersObject[['user']] <- self$`user`$toJSON()
}
if (!is.null(self$`devices`)) {
GroupCollectionUsersObject[['devices']] <- lapply(self$`devices`, function(x) x$toJSON())
}
GroupCollectionUsersObject
},
fromJSON = function(GroupCollectionUsersJson) {
GroupCollectionUsersObject <- jsonlite::fromJSON(GroupCollectionUsersJson)
if (!is.null(GroupCollectionUsersObject$`user`)) {
userObject <- UserModel$new()
userObject$fromJSON(jsonlite::toJSON(GroupCollectionUsersObject$user, auto_unbox = TRUE))
self$`user` <- userObject
}
if (!is.null(GroupCollectionUsersObject$`devices`)) {
self$`devices` <- lapply(GroupCollectionUsersObject$`devices`, function(x) {
devicesObject <- DeviceModel$new()
devicesObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
devicesObject
})
}
},
toJSONString = function() {
sprintf(
'{
"user": %s,
"devices": [%s]
}',
self$`user`$toJSON(),
lapply(self$`devices`, function(x) paste(x$toJSON(), sep=","))
)
},
fromJSONString = function(GroupCollectionUsersJson) {
GroupCollectionUsersObject <- jsonlite::fromJSON(GroupCollectionUsersJson)
UserModelObject <- UserModel$new()
self$`user` <- UserModelObject$fromJSON(jsonlite::toJSON(GroupCollectionUsersObject$user, auto_unbox = TRUE))
self$`devices` <- lapply(GroupCollectionUsersObject$`devices`, function(x) DeviceModel$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.