R/submissions_count_response.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title SubmissionsCountResponse
#'
#' @description SubmissionsCountResponse Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field Accepted  integer [optional]
#'
#' @field Evaluating  integer [optional]
#'
#' @field Submitting  integer [optional]
#'
#' @field Submitted  integer [optional]
#'
#' @field Aborting  integer [optional]
#'
#' @field Aborted  integer [optional]
#'
#' @field Done  integer [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SubmissionsCountResponse <- R6::R6Class(
  'SubmissionsCountResponse',
  public = list(
    `Accepted` = NULL,
    `Evaluating` = NULL,
    `Submitting` = NULL,
    `Submitted` = NULL,
    `Aborting` = NULL,
    `Aborted` = NULL,
    `Done` = NULL,
    initialize = function(
        `Accepted`=NULL, `Evaluating`=NULL, `Submitting`=NULL, `Submitted`=NULL, `Aborting`=NULL, `Aborted`=NULL, `Done`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!is.null(`Accepted`)) {
        stopifnot(is.numeric(`Accepted`), length(`Accepted`) == 1)
        self$`Accepted` <- `Accepted`
      }
      if (!is.null(`Evaluating`)) {
        stopifnot(is.numeric(`Evaluating`), length(`Evaluating`) == 1)
        self$`Evaluating` <- `Evaluating`
      }
      if (!is.null(`Submitting`)) {
        stopifnot(is.numeric(`Submitting`), length(`Submitting`) == 1)
        self$`Submitting` <- `Submitting`
      }
      if (!is.null(`Submitted`)) {
        stopifnot(is.numeric(`Submitted`), length(`Submitted`) == 1)
        self$`Submitted` <- `Submitted`
      }
      if (!is.null(`Aborting`)) {
        stopifnot(is.numeric(`Aborting`), length(`Aborting`) == 1)
        self$`Aborting` <- `Aborting`
      }
      if (!is.null(`Aborted`)) {
        stopifnot(is.numeric(`Aborted`), length(`Aborted`) == 1)
        self$`Aborted` <- `Aborted`
      }
      if (!is.null(`Done`)) {
        stopifnot(is.numeric(`Done`), length(`Done`) == 1)
        self$`Done` <- `Done`
      }
    },
    toJSON = function() {
      SubmissionsCountResponseObject <- list()
      if (!is.null(self$`Accepted`)) {
        SubmissionsCountResponseObject[['Accepted']] <-
          self$`Accepted`
      }
      if (!is.null(self$`Evaluating`)) {
        SubmissionsCountResponseObject[['Evaluating']] <-
          self$`Evaluating`
      }
      if (!is.null(self$`Submitting`)) {
        SubmissionsCountResponseObject[['Submitting']] <-
          self$`Submitting`
      }
      if (!is.null(self$`Submitted`)) {
        SubmissionsCountResponseObject[['Submitted']] <-
          self$`Submitted`
      }
      if (!is.null(self$`Aborting`)) {
        SubmissionsCountResponseObject[['Aborting']] <-
          self$`Aborting`
      }
      if (!is.null(self$`Aborted`)) {
        SubmissionsCountResponseObject[['Aborted']] <-
          self$`Aborted`
      }
      if (!is.null(self$`Done`)) {
        SubmissionsCountResponseObject[['Done']] <-
          self$`Done`
      }

      SubmissionsCountResponseObject
    },
    fromJSON = function(SubmissionsCountResponseJson) {
      SubmissionsCountResponseObject <- jsonlite::fromJSON(SubmissionsCountResponseJson)
      if (!is.null(SubmissionsCountResponseObject$`Accepted`)) {
        self$`Accepted` <- SubmissionsCountResponseObject$`Accepted`
      }
      if (!is.null(SubmissionsCountResponseObject$`Evaluating`)) {
        self$`Evaluating` <- SubmissionsCountResponseObject$`Evaluating`
      }
      if (!is.null(SubmissionsCountResponseObject$`Submitting`)) {
        self$`Submitting` <- SubmissionsCountResponseObject$`Submitting`
      }
      if (!is.null(SubmissionsCountResponseObject$`Submitted`)) {
        self$`Submitted` <- SubmissionsCountResponseObject$`Submitted`
      }
      if (!is.null(SubmissionsCountResponseObject$`Aborting`)) {
        self$`Aborting` <- SubmissionsCountResponseObject$`Aborting`
      }
      if (!is.null(SubmissionsCountResponseObject$`Aborted`)) {
        self$`Aborted` <- SubmissionsCountResponseObject$`Aborted`
      }
      if (!is.null(SubmissionsCountResponseObject$`Done`)) {
        self$`Done` <- SubmissionsCountResponseObject$`Done`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`Accepted`)) {
        sprintf(
        '"Accepted":
          %d
                ',
        self$`Accepted`
        )},
        if (!is.null(self$`Evaluating`)) {
        sprintf(
        '"Evaluating":
          %d
                ',
        self$`Evaluating`
        )},
        if (!is.null(self$`Submitting`)) {
        sprintf(
        '"Submitting":
          %d
                ',
        self$`Submitting`
        )},
        if (!is.null(self$`Submitted`)) {
        sprintf(
        '"Submitted":
          %d
                ',
        self$`Submitted`
        )},
        if (!is.null(self$`Aborting`)) {
        sprintf(
        '"Aborting":
          %d
                ',
        self$`Aborting`
        )},
        if (!is.null(self$`Aborted`)) {
        sprintf(
        '"Aborted":
          %d
                ',
        self$`Aborted`
        )},
        if (!is.null(self$`Done`)) {
        sprintf(
        '"Done":
          %d
                ',
        self$`Done`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(SubmissionsCountResponseJson) {
      SubmissionsCountResponseObject <- jsonlite::fromJSON(SubmissionsCountResponseJson)
      self$`Accepted` <- SubmissionsCountResponseObject$`Accepted`
      self$`Evaluating` <- SubmissionsCountResponseObject$`Evaluating`
      self$`Submitting` <- SubmissionsCountResponseObject$`Submitting`
      self$`Submitted` <- SubmissionsCountResponseObject$`Submitted`
      self$`Aborting` <- SubmissionsCountResponseObject$`Aborting`
      self$`Aborted` <- SubmissionsCountResponseObject$`Aborted`
      self$`Done` <- SubmissionsCountResponseObject$`Done`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.