R/TeamPPAOffenseCumulative.r

# 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


#' TeamPPAOffenseCumulative Class
#'
#' @field total 
#' @field passing 
#' @field rushing 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
TeamPPAOffenseCumulative <- R6::R6Class(
  'TeamPPAOffenseCumulative',
  public = list(
    `total` = NULL,
    `passing` = NULL,
    `rushing` = NULL,
    initialize = function(`total`, `passing`, `rushing`){
      if (!missing(`total`)) {
        self$`total` <- `total`
      }
      if (!missing(`passing`)) {
        self$`passing` <- `passing`
      }
      if (!missing(`rushing`)) {
        self$`rushing` <- `rushing`
      }
    },
    toJSON = function() {
      TeamPPAOffenseCumulativeObject <- list()
      if (!is.null(self$`total`)) {
        TeamPPAOffenseCumulativeObject[['total']] <- self$`total`
      }
      if (!is.null(self$`passing`)) {
        TeamPPAOffenseCumulativeObject[['passing']] <- self$`passing`
      }
      if (!is.null(self$`rushing`)) {
        TeamPPAOffenseCumulativeObject[['rushing']] <- self$`rushing`
      }

      TeamPPAOffenseCumulativeObject
    },
    fromJSON = function(TeamPPAOffenseCumulativeJson) {
      TeamPPAOffenseCumulativeObject <- jsonlite::fromJSON(TeamPPAOffenseCumulativeJson)
      if (!is.null(TeamPPAOffenseCumulativeObject$`total`)) {
        self$`total` <- TeamPPAOffenseCumulativeObject$`total`
      }
      if (!is.null(TeamPPAOffenseCumulativeObject$`passing`)) {
        self$`passing` <- TeamPPAOffenseCumulativeObject$`passing`
      }
      if (!is.null(TeamPPAOffenseCumulativeObject$`rushing`)) {
        self$`rushing` <- TeamPPAOffenseCumulativeObject$`rushing`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "total": %s,
           "passing": %s,
           "rushing": %s
        }',
        self$`total`,
        self$`passing`,
        self$`rushing`
      )
    },
    fromJSONString = function(TeamPPAOffenseCumulativeJson) {
      TeamPPAOffenseCumulativeObject <- jsonlite::fromJSON(TeamPPAOffenseCumulativeJson)
      self$`total` <- TeamPPAOffenseCumulativeObject$`total`
      self$`passing` <- TeamPPAOffenseCumulativeObject$`passing`
      self$`rushing` <- TeamPPAOffenseCumulativeObject$`rushing`
    }
  )
)
saiemgilani/cfbd-api-R documentation built on Feb. 16, 2021, 12:07 a.m.