# 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
#' PlayerGamePPA Class
#'
#' @field season
#' @field week
#' @field name
#' @field position
#' @field team
#' @field opponent
#' @field averagePPA
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
PlayerGamePPA <- R6::R6Class(
'PlayerGamePPA',
public = list(
`season` = NULL,
`week` = NULL,
`name` = NULL,
`position` = NULL,
`team` = NULL,
`opponent` = NULL,
`averagePPA` = NULL,
initialize = function(`season`, `week`, `name`, `position`, `team`, `opponent`, `averagePPA`){
if (!missing(`season`)) {
stopifnot(is.numeric(`season`), length(`season`) == 1)
self$`season` <- `season`
}
if (!missing(`week`)) {
stopifnot(is.numeric(`week`), length(`week`) == 1)
self$`week` <- `week`
}
if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
if (!missing(`position`)) {
stopifnot(is.character(`position`), length(`position`) == 1)
self$`position` <- `position`
}
if (!missing(`team`)) {
stopifnot(is.character(`team`), length(`team`) == 1)
self$`team` <- `team`
}
if (!missing(`opponent`)) {
stopifnot(is.character(`opponent`), length(`opponent`) == 1)
self$`opponent` <- `opponent`
}
if (!missing(`averagePPA`)) {
stopifnot(R6::is.R6(`averagePPA`))
self$`averagePPA` <- `averagePPA`
}
},
toJSON = function() {
PlayerGamePPAObject <- list()
if (!is.null(self$`season`)) {
PlayerGamePPAObject[['season']] <- self$`season`
}
if (!is.null(self$`week`)) {
PlayerGamePPAObject[['week']] <- self$`week`
}
if (!is.null(self$`name`)) {
PlayerGamePPAObject[['name']] <- self$`name`
}
if (!is.null(self$`position`)) {
PlayerGamePPAObject[['position']] <- self$`position`
}
if (!is.null(self$`team`)) {
PlayerGamePPAObject[['team']] <- self$`team`
}
if (!is.null(self$`opponent`)) {
PlayerGamePPAObject[['opponent']] <- self$`opponent`
}
if (!is.null(self$`averagePPA`)) {
PlayerGamePPAObject[['averagePPA']] <- self$`averagePPA`$toJSON()
}
PlayerGamePPAObject
},
fromJSON = function(PlayerGamePPAJson) {
PlayerGamePPAObject <- jsonlite::fromJSON(PlayerGamePPAJson)
if (!is.null(PlayerGamePPAObject$`season`)) {
self$`season` <- PlayerGamePPAObject$`season`
}
if (!is.null(PlayerGamePPAObject$`week`)) {
self$`week` <- PlayerGamePPAObject$`week`
}
if (!is.null(PlayerGamePPAObject$`name`)) {
self$`name` <- PlayerGamePPAObject$`name`
}
if (!is.null(PlayerGamePPAObject$`position`)) {
self$`position` <- PlayerGamePPAObject$`position`
}
if (!is.null(PlayerGamePPAObject$`team`)) {
self$`team` <- PlayerGamePPAObject$`team`
}
if (!is.null(PlayerGamePPAObject$`opponent`)) {
self$`opponent` <- PlayerGamePPAObject$`opponent`
}
if (!is.null(PlayerGamePPAObject$`averagePPA`)) {
averagePPAObject <- PlayerGamePPAAveragePPA$new()
averagePPAObject$fromJSON(jsonlite::toJSON(PlayerGamePPAObject$averagePPA, auto_unbox = TRUE))
self$`averagePPA` <- averagePPAObject
}
},
toJSONString = function() {
sprintf(
'{
"season": %d,
"week": %d,
"name": %s,
"position": %s,
"team": %s,
"opponent": %s,
"averagePPA": %s
}',
self$`season`,
self$`week`,
self$`name`,
self$`position`,
self$`team`,
self$`opponent`,
self$`averagePPA`$toJSON()
)
},
fromJSONString = function(PlayerGamePPAJson) {
PlayerGamePPAObject <- jsonlite::fromJSON(PlayerGamePPAJson)
self$`season` <- PlayerGamePPAObject$`season`
self$`week` <- PlayerGamePPAObject$`week`
self$`name` <- PlayerGamePPAObject$`name`
self$`position` <- PlayerGamePPAObject$`position`
self$`team` <- PlayerGamePPAObject$`team`
self$`opponent` <- PlayerGamePPAObject$`opponent`
PlayerGamePPAAveragePPAObject <- PlayerGamePPAAveragePPA$new()
self$`averagePPA` <- PlayerGamePPAAveragePPAObject$fromJSON(jsonlite::toJSON(PlayerGamePPAObject$averagePPA, auto_unbox = TRUE))
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.