# 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
#' AdvancedSeasonStatOffense Class
#'
#' @field plays
#' @field drives
#' @field ppa
#' @field totalPPA
#' @field successRate
#' @field explosiveness
#' @field powerSuccess
#' @field stuffRate
#' @field lineYards
#' @field lineYardsTotal
#' @field secondLevelYards
#' @field secondLevelYardsTotal
#' @field openFieldYards
#' @field openFieldYardsTotal
#' @field pointsPerOpportunity
#' @field fieldPosition
#' @field havoc
#' @field standardDowns
#' @field passingDowns
#' @field rushingPlays
#' @field passingPlays
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
AdvancedSeasonStatOffense <- R6::R6Class(
'AdvancedSeasonStatOffense',
public = list(
`plays` = NULL,
`drives` = NULL,
`ppa` = NULL,
`totalPPA` = NULL,
`successRate` = NULL,
`explosiveness` = NULL,
`powerSuccess` = NULL,
`stuffRate` = NULL,
`lineYards` = NULL,
`lineYardsTotal` = NULL,
`secondLevelYards` = NULL,
`secondLevelYardsTotal` = NULL,
`openFieldYards` = NULL,
`openFieldYardsTotal` = NULL,
`pointsPerOpportunity` = NULL,
`fieldPosition` = NULL,
`havoc` = NULL,
`standardDowns` = NULL,
`passingDowns` = NULL,
`rushingPlays` = NULL,
`passingPlays` = NULL,
initialize = function(`plays`, `drives`, `ppa`, `totalPPA`, `successRate`, `explosiveness`, `powerSuccess`, `stuffRate`, `lineYards`, `lineYardsTotal`, `secondLevelYards`, `secondLevelYardsTotal`, `openFieldYards`, `openFieldYardsTotal`, `pointsPerOpportunity`, `fieldPosition`, `havoc`, `standardDowns`, `passingDowns`, `rushingPlays`, `passingPlays`){
if (!missing(`plays`)) {
stopifnot(is.numeric(`plays`), length(`plays`) == 1)
self$`plays` <- `plays`
}
if (!missing(`drives`)) {
stopifnot(is.numeric(`drives`), length(`drives`) == 1)
self$`drives` <- `drives`
}
if (!missing(`ppa`)) {
self$`ppa` <- `ppa`
}
if (!missing(`totalPPA`)) {
self$`totalPPA` <- `totalPPA`
}
if (!missing(`successRate`)) {
self$`successRate` <- `successRate`
}
if (!missing(`explosiveness`)) {
self$`explosiveness` <- `explosiveness`
}
if (!missing(`powerSuccess`)) {
self$`powerSuccess` <- `powerSuccess`
}
if (!missing(`stuffRate`)) {
self$`stuffRate` <- `stuffRate`
}
if (!missing(`lineYards`)) {
self$`lineYards` <- `lineYards`
}
if (!missing(`lineYardsTotal`)) {
self$`lineYardsTotal` <- `lineYardsTotal`
}
if (!missing(`secondLevelYards`)) {
self$`secondLevelYards` <- `secondLevelYards`
}
if (!missing(`secondLevelYardsTotal`)) {
stopifnot(is.numeric(`secondLevelYardsTotal`), length(`secondLevelYardsTotal`) == 1)
self$`secondLevelYardsTotal` <- `secondLevelYardsTotal`
}
if (!missing(`openFieldYards`)) {
self$`openFieldYards` <- `openFieldYards`
}
if (!missing(`openFieldYardsTotal`)) {
stopifnot(is.numeric(`openFieldYardsTotal`), length(`openFieldYardsTotal`) == 1)
self$`openFieldYardsTotal` <- `openFieldYardsTotal`
}
if (!missing(`pointsPerOpportunity`)) {
self$`pointsPerOpportunity` <- `pointsPerOpportunity`
}
if (!missing(`fieldPosition`)) {
stopifnot(R6::is.R6(`fieldPosition`))
self$`fieldPosition` <- `fieldPosition`
}
if (!missing(`havoc`)) {
stopifnot(R6::is.R6(`havoc`))
self$`havoc` <- `havoc`
}
if (!missing(`standardDowns`)) {
stopifnot(R6::is.R6(`standardDowns`))
self$`standardDowns` <- `standardDowns`
}
if (!missing(`passingDowns`)) {
stopifnot(R6::is.R6(`passingDowns`))
self$`passingDowns` <- `passingDowns`
}
if (!missing(`rushingPlays`)) {
stopifnot(R6::is.R6(`rushingPlays`))
self$`rushingPlays` <- `rushingPlays`
}
if (!missing(`passingPlays`)) {
stopifnot(R6::is.R6(`passingPlays`))
self$`passingPlays` <- `passingPlays`
}
},
toJSON = function() {
AdvancedSeasonStatOffenseObject <- list()
if (!is.null(self$`plays`)) {
AdvancedSeasonStatOffenseObject[['plays']] <- self$`plays`
}
if (!is.null(self$`drives`)) {
AdvancedSeasonStatOffenseObject[['drives']] <- self$`drives`
}
if (!is.null(self$`ppa`)) {
AdvancedSeasonStatOffenseObject[['ppa']] <- self$`ppa`
}
if (!is.null(self$`totalPPA`)) {
AdvancedSeasonStatOffenseObject[['totalPPA']] <- self$`totalPPA`
}
if (!is.null(self$`successRate`)) {
AdvancedSeasonStatOffenseObject[['successRate']] <- self$`successRate`
}
if (!is.null(self$`explosiveness`)) {
AdvancedSeasonStatOffenseObject[['explosiveness']] <- self$`explosiveness`
}
if (!is.null(self$`powerSuccess`)) {
AdvancedSeasonStatOffenseObject[['powerSuccess']] <- self$`powerSuccess`
}
if (!is.null(self$`stuffRate`)) {
AdvancedSeasonStatOffenseObject[['stuffRate']] <- self$`stuffRate`
}
if (!is.null(self$`lineYards`)) {
AdvancedSeasonStatOffenseObject[['lineYards']] <- self$`lineYards`
}
if (!is.null(self$`lineYardsTotal`)) {
AdvancedSeasonStatOffenseObject[['lineYardsTotal']] <- self$`lineYardsTotal`
}
if (!is.null(self$`secondLevelYards`)) {
AdvancedSeasonStatOffenseObject[['secondLevelYards']] <- self$`secondLevelYards`
}
if (!is.null(self$`secondLevelYardsTotal`)) {
AdvancedSeasonStatOffenseObject[['secondLevelYardsTotal']] <- self$`secondLevelYardsTotal`
}
if (!is.null(self$`openFieldYards`)) {
AdvancedSeasonStatOffenseObject[['openFieldYards']] <- self$`openFieldYards`
}
if (!is.null(self$`openFieldYardsTotal`)) {
AdvancedSeasonStatOffenseObject[['openFieldYardsTotal']] <- self$`openFieldYardsTotal`
}
if (!is.null(self$`pointsPerOpportunity`)) {
AdvancedSeasonStatOffenseObject[['pointsPerOpportunity']] <- self$`pointsPerOpportunity`
}
if (!is.null(self$`fieldPosition`)) {
AdvancedSeasonStatOffenseObject[['fieldPosition']] <- self$`fieldPosition`$toJSON()
}
if (!is.null(self$`havoc`)) {
AdvancedSeasonStatOffenseObject[['havoc']] <- self$`havoc`$toJSON()
}
if (!is.null(self$`standardDowns`)) {
AdvancedSeasonStatOffenseObject[['standardDowns']] <- self$`standardDowns`$toJSON()
}
if (!is.null(self$`passingDowns`)) {
AdvancedSeasonStatOffenseObject[['passingDowns']] <- self$`passingDowns`$toJSON()
}
if (!is.null(self$`rushingPlays`)) {
AdvancedSeasonStatOffenseObject[['rushingPlays']] <- self$`rushingPlays`$toJSON()
}
if (!is.null(self$`passingPlays`)) {
AdvancedSeasonStatOffenseObject[['passingPlays']] <- self$`passingPlays`$toJSON()
}
AdvancedSeasonStatOffenseObject
},
fromJSON = function(AdvancedSeasonStatOffenseJson) {
AdvancedSeasonStatOffenseObject <- jsonlite::fromJSON(AdvancedSeasonStatOffenseJson)
if (!is.null(AdvancedSeasonStatOffenseObject$`plays`)) {
self$`plays` <- AdvancedSeasonStatOffenseObject$`plays`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`drives`)) {
self$`drives` <- AdvancedSeasonStatOffenseObject$`drives`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`ppa`)) {
self$`ppa` <- AdvancedSeasonStatOffenseObject$`ppa`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`totalPPA`)) {
self$`totalPPA` <- AdvancedSeasonStatOffenseObject$`totalPPA`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`successRate`)) {
self$`successRate` <- AdvancedSeasonStatOffenseObject$`successRate`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`explosiveness`)) {
self$`explosiveness` <- AdvancedSeasonStatOffenseObject$`explosiveness`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`powerSuccess`)) {
self$`powerSuccess` <- AdvancedSeasonStatOffenseObject$`powerSuccess`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`stuffRate`)) {
self$`stuffRate` <- AdvancedSeasonStatOffenseObject$`stuffRate`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`lineYards`)) {
self$`lineYards` <- AdvancedSeasonStatOffenseObject$`lineYards`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`lineYardsTotal`)) {
self$`lineYardsTotal` <- AdvancedSeasonStatOffenseObject$`lineYardsTotal`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`secondLevelYards`)) {
self$`secondLevelYards` <- AdvancedSeasonStatOffenseObject$`secondLevelYards`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`secondLevelYardsTotal`)) {
self$`secondLevelYardsTotal` <- AdvancedSeasonStatOffenseObject$`secondLevelYardsTotal`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`openFieldYards`)) {
self$`openFieldYards` <- AdvancedSeasonStatOffenseObject$`openFieldYards`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`openFieldYardsTotal`)) {
self$`openFieldYardsTotal` <- AdvancedSeasonStatOffenseObject$`openFieldYardsTotal`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`pointsPerOpportunity`)) {
self$`pointsPerOpportunity` <- AdvancedSeasonStatOffenseObject$`pointsPerOpportunity`
}
if (!is.null(AdvancedSeasonStatOffenseObject$`fieldPosition`)) {
fieldPositionObject <- AdvancedSeasonStatOffenseFieldPosition$new()
fieldPositionObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$fieldPosition, auto_unbox = TRUE))
self$`fieldPosition` <- fieldPositionObject
}
if (!is.null(AdvancedSeasonStatOffenseObject$`havoc`)) {
havocObject <- TeamSPRatingDefenseHavoc$new()
havocObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$havoc, auto_unbox = TRUE))
self$`havoc` <- havocObject
}
if (!is.null(AdvancedSeasonStatOffenseObject$`standardDowns`)) {
standardDownsObject <- AdvancedSeasonStatOffenseStandardDowns$new()
standardDownsObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$standardDowns, auto_unbox = TRUE))
self$`standardDowns` <- standardDownsObject
}
if (!is.null(AdvancedSeasonStatOffenseObject$`passingDowns`)) {
passingDownsObject <- AdvancedSeasonStatOffenseStandardDowns$new()
passingDownsObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$passingDowns, auto_unbox = TRUE))
self$`passingDowns` <- passingDownsObject
}
if (!is.null(AdvancedSeasonStatOffenseObject$`rushingPlays`)) {
rushingPlaysObject <- AdvancedSeasonStatOffenseRushingPlays$new()
rushingPlaysObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$rushingPlays, auto_unbox = TRUE))
self$`rushingPlays` <- rushingPlaysObject
}
if (!is.null(AdvancedSeasonStatOffenseObject$`passingPlays`)) {
passingPlaysObject <- AdvancedSeasonStatOffenseRushingPlays$new()
passingPlaysObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$passingPlays, auto_unbox = TRUE))
self$`passingPlays` <- passingPlaysObject
}
},
toJSONString = function() {
sprintf(
'{
"plays": %d,
"drives": %d,
"ppa": %s,
"totalPPA": %s,
"successRate": %s,
"explosiveness": %s,
"powerSuccess": %s,
"stuffRate": %s,
"lineYards": %s,
"lineYardsTotal": %s,
"secondLevelYards": %s,
"secondLevelYardsTotal": %d,
"openFieldYards": %s,
"openFieldYardsTotal": %d,
"pointsPerOpportunity": %s,
"fieldPosition": %s,
"havoc": %s,
"standardDowns": %s,
"passingDowns": %s,
"rushingPlays": %s,
"passingPlays": %s
}',
self$`plays`,
self$`drives`,
self$`ppa`,
self$`totalPPA`,
self$`successRate`,
self$`explosiveness`,
self$`powerSuccess`,
self$`stuffRate`,
self$`lineYards`,
self$`lineYardsTotal`,
self$`secondLevelYards`,
self$`secondLevelYardsTotal`,
self$`openFieldYards`,
self$`openFieldYardsTotal`,
self$`pointsPerOpportunity`,
self$`fieldPosition`$toJSON(),
self$`havoc`$toJSON(),
self$`standardDowns`$toJSON(),
self$`passingDowns`$toJSON(),
self$`rushingPlays`$toJSON(),
self$`passingPlays`$toJSON()
)
},
fromJSONString = function(AdvancedSeasonStatOffenseJson) {
AdvancedSeasonStatOffenseObject <- jsonlite::fromJSON(AdvancedSeasonStatOffenseJson)
self$`plays` <- AdvancedSeasonStatOffenseObject$`plays`
self$`drives` <- AdvancedSeasonStatOffenseObject$`drives`
self$`ppa` <- AdvancedSeasonStatOffenseObject$`ppa`
self$`totalPPA` <- AdvancedSeasonStatOffenseObject$`totalPPA`
self$`successRate` <- AdvancedSeasonStatOffenseObject$`successRate`
self$`explosiveness` <- AdvancedSeasonStatOffenseObject$`explosiveness`
self$`powerSuccess` <- AdvancedSeasonStatOffenseObject$`powerSuccess`
self$`stuffRate` <- AdvancedSeasonStatOffenseObject$`stuffRate`
self$`lineYards` <- AdvancedSeasonStatOffenseObject$`lineYards`
self$`lineYardsTotal` <- AdvancedSeasonStatOffenseObject$`lineYardsTotal`
self$`secondLevelYards` <- AdvancedSeasonStatOffenseObject$`secondLevelYards`
self$`secondLevelYardsTotal` <- AdvancedSeasonStatOffenseObject$`secondLevelYardsTotal`
self$`openFieldYards` <- AdvancedSeasonStatOffenseObject$`openFieldYards`
self$`openFieldYardsTotal` <- AdvancedSeasonStatOffenseObject$`openFieldYardsTotal`
self$`pointsPerOpportunity` <- AdvancedSeasonStatOffenseObject$`pointsPerOpportunity`
AdvancedSeasonStatOffenseFieldPositionObject <- AdvancedSeasonStatOffenseFieldPosition$new()
self$`fieldPosition` <- AdvancedSeasonStatOffenseFieldPositionObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$fieldPosition, auto_unbox = TRUE))
TeamSPRatingDefenseHavocObject <- TeamSPRatingDefenseHavoc$new()
self$`havoc` <- TeamSPRatingDefenseHavocObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$havoc, auto_unbox = TRUE))
AdvancedSeasonStatOffenseStandardDownsObject <- AdvancedSeasonStatOffenseStandardDowns$new()
self$`standardDowns` <- AdvancedSeasonStatOffenseStandardDownsObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$standardDowns, auto_unbox = TRUE))
AdvancedSeasonStatOffenseStandardDownsObject <- AdvancedSeasonStatOffenseStandardDowns$new()
self$`passingDowns` <- AdvancedSeasonStatOffenseStandardDownsObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$passingDowns, auto_unbox = TRUE))
AdvancedSeasonStatOffenseRushingPlaysObject <- AdvancedSeasonStatOffenseRushingPlays$new()
self$`rushingPlays` <- AdvancedSeasonStatOffenseRushingPlaysObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$rushingPlays, auto_unbox = TRUE))
AdvancedSeasonStatOffenseRushingPlaysObject <- AdvancedSeasonStatOffenseRushingPlays$new()
self$`passingPlays` <- AdvancedSeasonStatOffenseRushingPlaysObject$fromJSON(jsonlite::toJSON(AdvancedSeasonStatOffenseObject$passingPlays, auto_unbox = TRUE))
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.