# 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
#' ConferenceSPRating Class
#'
#' @field year
#' @field conference
#' @field rating
#' @field secondOrderWins
#' @field sos
#' @field offense
#' @field defense
#' @field specialTeams
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ConferenceSPRating <- R6::R6Class(
'ConferenceSPRating',
public = list(
`year` = NULL,
`conference` = NULL,
`rating` = NULL,
`secondOrderWins` = NULL,
`sos` = NULL,
`offense` = NULL,
`defense` = NULL,
`specialTeams` = NULL,
initialize = function(`year`, `conference`, `rating`, `secondOrderWins`, `sos`, `offense`, `defense`, `specialTeams`){
if (!missing(`year`)) {
stopifnot(is.numeric(`year`), length(`year`) == 1)
self$`year` <- `year`
}
if (!missing(`conference`)) {
stopifnot(is.character(`conference`), length(`conference`) == 1)
self$`conference` <- `conference`
}
if (!missing(`rating`)) {
self$`rating` <- `rating`
}
if (!missing(`secondOrderWins`)) {
self$`secondOrderWins` <- `secondOrderWins`
}
if (!missing(`sos`)) {
self$`sos` <- `sos`
}
if (!missing(`offense`)) {
stopifnot(R6::is.R6(`offense`))
self$`offense` <- `offense`
}
if (!missing(`defense`)) {
stopifnot(R6::is.R6(`defense`))
self$`defense` <- `defense`
}
if (!missing(`specialTeams`)) {
stopifnot(R6::is.R6(`specialTeams`))
self$`specialTeams` <- `specialTeams`
}
},
toJSON = function() {
ConferenceSPRatingObject <- list()
if (!is.null(self$`year`)) {
ConferenceSPRatingObject[['year']] <- self$`year`
}
if (!is.null(self$`conference`)) {
ConferenceSPRatingObject[['conference']] <- self$`conference`
}
if (!is.null(self$`rating`)) {
ConferenceSPRatingObject[['rating']] <- self$`rating`
}
if (!is.null(self$`secondOrderWins`)) {
ConferenceSPRatingObject[['secondOrderWins']] <- self$`secondOrderWins`
}
if (!is.null(self$`sos`)) {
ConferenceSPRatingObject[['sos']] <- self$`sos`
}
if (!is.null(self$`offense`)) {
ConferenceSPRatingObject[['offense']] <- self$`offense`$toJSON()
}
if (!is.null(self$`defense`)) {
ConferenceSPRatingObject[['defense']] <- self$`defense`$toJSON()
}
if (!is.null(self$`specialTeams`)) {
ConferenceSPRatingObject[['specialTeams']] <- self$`specialTeams`$toJSON()
}
ConferenceSPRatingObject
},
fromJSON = function(ConferenceSPRatingJson) {
ConferenceSPRatingObject <- jsonlite::fromJSON(ConferenceSPRatingJson)
if (!is.null(ConferenceSPRatingObject$`year`)) {
self$`year` <- ConferenceSPRatingObject$`year`
}
if (!is.null(ConferenceSPRatingObject$`conference`)) {
self$`conference` <- ConferenceSPRatingObject$`conference`
}
if (!is.null(ConferenceSPRatingObject$`rating`)) {
self$`rating` <- ConferenceSPRatingObject$`rating`
}
if (!is.null(ConferenceSPRatingObject$`secondOrderWins`)) {
self$`secondOrderWins` <- ConferenceSPRatingObject$`secondOrderWins`
}
if (!is.null(ConferenceSPRatingObject$`sos`)) {
self$`sos` <- ConferenceSPRatingObject$`sos`
}
if (!is.null(ConferenceSPRatingObject$`offense`)) {
offenseObject <- ConferenceSPRatingOffense$new()
offenseObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$offense, auto_unbox = TRUE))
self$`offense` <- offenseObject
}
if (!is.null(ConferenceSPRatingObject$`defense`)) {
defenseObject <- ConferenceSPRatingDefense$new()
defenseObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$defense, auto_unbox = TRUE))
self$`defense` <- defenseObject
}
if (!is.null(ConferenceSPRatingObject$`specialTeams`)) {
specialTeamsObject <- TeamSPRatingSpecialTeams$new()
specialTeamsObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$specialTeams, auto_unbox = TRUE))
self$`specialTeams` <- specialTeamsObject
}
},
toJSONString = function() {
sprintf(
'{
"year": %d,
"conference": %s,
"rating": %s,
"secondOrderWins": %s,
"sos": %s,
"offense": %s,
"defense": %s,
"specialTeams": %s
}',
self$`year`,
self$`conference`,
self$`rating`,
self$`secondOrderWins`,
self$`sos`,
self$`offense`$toJSON(),
self$`defense`$toJSON(),
self$`specialTeams`$toJSON()
)
},
fromJSONString = function(ConferenceSPRatingJson) {
ConferenceSPRatingObject <- jsonlite::fromJSON(ConferenceSPRatingJson)
self$`year` <- ConferenceSPRatingObject$`year`
self$`conference` <- ConferenceSPRatingObject$`conference`
self$`rating` <- ConferenceSPRatingObject$`rating`
self$`secondOrderWins` <- ConferenceSPRatingObject$`secondOrderWins`
self$`sos` <- ConferenceSPRatingObject$`sos`
ConferenceSPRatingOffenseObject <- ConferenceSPRatingOffense$new()
self$`offense` <- ConferenceSPRatingOffenseObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$offense, auto_unbox = TRUE))
ConferenceSPRatingDefenseObject <- ConferenceSPRatingDefense$new()
self$`defense` <- ConferenceSPRatingDefenseObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$defense, auto_unbox = TRUE))
TeamSPRatingSpecialTeamsObject <- TeamSPRatingSpecialTeams$new()
self$`specialTeams` <- TeamSPRatingSpecialTeamsObject$fromJSON(jsonlite::toJSON(ConferenceSPRatingObject$specialTeams, auto_unbox = TRUE))
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.