# College Football Data API
#
# This is an API for accessing all sorts of college football data. It currently has a wide array of data ranging from play by play to player statistics to game scores and more.
#
# OpenAPI spec version: 2.3.5
# Contact: admin@collegefootballdata.com
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' TeamRecordTotal Class
#'
#' @field games
#' @field wins
#' @field losses
#' @field ties
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
TeamRecordTotal <- R6::R6Class(
'TeamRecordTotal',
public = list(
`games` = NULL,
`wins` = NULL,
`losses` = NULL,
`ties` = NULL,
initialize = function(`games`, `wins`, `losses`, `ties`){
if (!missing(`games`)) {
stopifnot(is.numeric(`games`), length(`games`) == 1)
self$`games` <- `games`
}
if (!missing(`wins`)) {
stopifnot(is.numeric(`wins`), length(`wins`) == 1)
self$`wins` <- `wins`
}
if (!missing(`losses`)) {
stopifnot(is.numeric(`losses`), length(`losses`) == 1)
self$`losses` <- `losses`
}
if (!missing(`ties`)) {
stopifnot(is.numeric(`ties`), length(`ties`) == 1)
self$`ties` <- `ties`
}
},
toJSON = function() {
TeamRecordTotalObject <- list()
if (!is.null(self$`games`)) {
TeamRecordTotalObject[['games']] <- self$`games`
}
if (!is.null(self$`wins`)) {
TeamRecordTotalObject[['wins']] <- self$`wins`
}
if (!is.null(self$`losses`)) {
TeamRecordTotalObject[['losses']] <- self$`losses`
}
if (!is.null(self$`ties`)) {
TeamRecordTotalObject[['ties']] <- self$`ties`
}
TeamRecordTotalObject
},
fromJSON = function(TeamRecordTotalJson) {
TeamRecordTotalObject <- jsonlite::fromJSON(TeamRecordTotalJson)
if (!is.null(TeamRecordTotalObject$`games`)) {
self$`games` <- TeamRecordTotalObject$`games`
}
if (!is.null(TeamRecordTotalObject$`wins`)) {
self$`wins` <- TeamRecordTotalObject$`wins`
}
if (!is.null(TeamRecordTotalObject$`losses`)) {
self$`losses` <- TeamRecordTotalObject$`losses`
}
if (!is.null(TeamRecordTotalObject$`ties`)) {
self$`ties` <- TeamRecordTotalObject$`ties`
}
},
toJSONString = function() {
sprintf(
'{
"games": %d,
"wins": %d,
"losses": %d,
"ties": %d
}',
self$`games`,
self$`wins`,
self$`losses`,
self$`ties`
)
},
fromJSONString = function(TeamRecordTotalJson) {
TeamRecordTotalObject <- jsonlite::fromJSON(TeamRecordTotalJson)
self$`games` <- TeamRecordTotalObject$`games`
self$`wins` <- TeamRecordTotalObject$`wins`
self$`losses` <- TeamRecordTotalObject$`losses`
self$`ties` <- TeamRecordTotalObject$`ties`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.