# Agave Platform Science API
#
# Power your digital lab and reduce the time from theory to discovery using the Agave Science-as-a-Service API Platform. Agave provides hosted services that allow researchers to manage data, conduct experiments, and publish and share results from anywhere at any time.
#
# Agave Platform version: 2.2.14
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' Permission Class
#'
#' A generic permission applied to any resource in the API
#'
#' @field username The username to whom this permission grant applies
#' @field internalUsername The internal user associated with this permission
#' @field permission
#' @field created The date the permission was created
#' @field lastUpdated The date the permission was last updated
#' @field id The unique id of this permission
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Permission <- R6::R6Class(
'Permission',
public = list(
`username` = NULL,
`internalUsername` = NULL,
`permission` = NULL,
`created` = NULL,
`lastUpdated` = NULL,
`id` = NULL,
initialize = function(`username`, `internalUsername`, `permission`, `created`, `lastUpdated`, `id`){
if (!missing(`username`)) {
stopifnot(is.character(`username`), length(`username`) == 1)
self$`username` <- `username`
}
if (!missing(`internalUsername`)) {
stopifnot(is.character(`internalUsername`), length(`internalUsername`) == 1)
self$`internalUsername` <- `internalUsername`
}
if (!missing(`permission`)) {
stopifnot(R6::is.R6(`permission`))
self$`permission` <- `permission`
}
if (!missing(`created`)) {
stopifnot(is.character(`created`), length(`created`) == 1)
self$`created` <- `created`
}
if (!missing(`lastUpdated`)) {
stopifnot(is.character(`lastUpdated`), length(`lastUpdated`) == 1)
self$`lastUpdated` <- `lastUpdated`
}
if (!missing(`id`)) {
stopifnot(is.character(`id`), length(`id`) == 1)
self$`id` <- `id`
}
},
asJSON = function() {
self$toJSON()
},
toJSON = function() {
PermissionObject <- list()
if (!is.null(self$`username`)) {
PermissionObject[['username']] <- self$`username`
}
else {
PermissionObject[['username']] <- NULL
}
if (!is.null(self$`internalUsername`)) {
PermissionObject[['internalUsername']] <- self$`internalUsername`
}
else {
PermissionObject[['internalUsername']] <- NULL
}
if (!is.null(self$`permission`)) {
PermissionObject[['permission']] <- self$`permission`$toJSON()
}
else {
PermissionObject[['permission']] <- NULL
}
if (!is.null(self$`created`)) {
PermissionObject[['created']] <- self$`created`
}
else {
PermissionObject[['created']] <- NULL
}
if (!is.null(self$`lastUpdated`)) {
PermissionObject[['lastUpdated']] <- self$`lastUpdated`
}
else {
PermissionObject[['lastUpdated']] <- NULL
}
if (!is.null(self$`id`)) {
PermissionObject[['id']] <- self$`id`
}
else {
PermissionObject[['id']] <- NULL
}
PermissionObject
},
fromJSON = function(PermissionObject) {
if (is.character(PermissionObject)) {
PermissionObject <- jsonlite::fromJSON(PermissionJson)
}
if ("result" %in% names(PermissionObject)) {
PermissionObject <- PermissionObject$result
}
if (!is.null(PermissionObject$`username`)) {
self$`username` <- PermissionObject$`username`
}
if (!is.null(PermissionObject$`internalUsername`)) {
self$`internalUsername` <- PermissionObject$`internalUsername`
}
if (!is.null(PermissionObject$`permission`)) {
permissionObject <- PermissionStanza$new()
permissionObject$fromJSON(jsonlite::toJSON(PermissionObject$permission, auto_unbox = TRUE))
self$`permission` <- permissionObject
}
if (!is.null(PermissionObject$`created`)) {
self$`created` <- PermissionObject$`created`
}
if (!is.null(PermissionObject$`lastUpdated`)) {
self$`lastUpdated` <- PermissionObject$`lastUpdated`
}
if (!is.null(PermissionObject$`id`)) {
self$`id` <- PermissionObject$`id`
}
},
toJSONString = function() {
sprintf(
'{
"username": %s,
"internalUsername": %s,
"permission": %s,
"created": %s,
"lastUpdated": %s,
"id": %s
}',
ifelse( is.null(self$`username`),"null",paste0(c('"', self$`username`, '"'))),
ifelse( is.null(self$`internalUsername`),"null",paste0(c('"', self$`internalUsername`, '"'))),
self$`permission`$toJSON(),
ifelse( is.null(self$`created`),"null",paste0(c('"', self$`created`, '"'))),
ifelse( is.null(self$`lastUpdated`),"null",paste0(c('"', self$`lastUpdated`, '"'))),
ifelse( is.null(self$`id`),"null",paste0(c('"', self$`id`, '"')))
)
},
fromJSONString = function(PermissionJson) {
PermissionObject <- jsonlite::fromJSON(PermissionJson)
self::fromJSON(PermissionObject)
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.