# Singlearity Baseball API
#
# Baseball optimization API using machine learning
#
# The version of the OpenAPI document: 0.1.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title Lineup
#'
#' @description Lineup Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field lineup Lineup list( \link{LineupPos} )
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Lineup <- R6::R6Class(
'Lineup',
public = list(
`lineup` = NULL,
initialize = function(
`lineup`, ...
) {
local.optional.var <- list(...)
if (length(local.optional.var) > 0) {
stop(paste("Unknown argument(s) in initialize of object Lineup:", paste(names(local.optional.var), collapse=", "), collapse=" "))
}
if (!missing(`lineup`)) {
stopifnot(is.vector(`lineup`), length(`lineup`) != 0)
sapply(`lineup`, function(x) stopifnot(R6::is.R6(x)))
self$`lineup` <- `lineup`
}
},
toJSON = function() {
LineupObject <- list()
if (!is.null(self$`lineup`)) {
LineupObject[['lineup']] <-
lapply(self$`lineup`, function(x) x$toJSON())
}
LineupObject
},
fromJSON = function(LineupJson) {
LineupObject <- jsonlite::fromJSON(LineupJson)
if (!is.null(LineupObject$`lineup`)) {
self$`lineup` <- ApiClient$new()$deserializeObj(LineupObject$`lineup`, "array[LineupPos]", loadNamespace("singlearity"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`lineup`)) {
sprintf(
'"lineup":
[%s]
',
paste(sapply(self$`lineup`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(LineupJson) {
LineupObject <- jsonlite::fromJSON(LineupJson)
self$`lineup` <- ApiClient$new()$deserializeObj(LineupObject$`lineup`, "array[LineupPos]", loadNamespace("singlearity"))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.