R/status_response.R

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

#' @docType class
#' @title StatusResponse
#'
#' @description StatusResponse Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field serviceName  \link{StatusResponseServiceName} [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
StatusResponse <- R6::R6Class(
  'StatusResponse',
  public = list(
    `serviceName` = NULL,
    initialize = function(
        `serviceName`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!is.null(`serviceName`)) {
        stopifnot(R6::is.R6(`serviceName`))
        self$`serviceName` <- `serviceName`
      }
    },
    toJSON = function() {
      StatusResponseObject <- list()
      if (!is.null(self$`serviceName`)) {
        StatusResponseObject[['serviceName']] <-
          self$`serviceName`$toJSON()
      }

      StatusResponseObject
    },
    fromJSON = function(StatusResponseJson) {
      StatusResponseObject <- jsonlite::fromJSON(StatusResponseJson)
      if (!is.null(StatusResponseObject$`serviceName`)) {
        serviceNameObject <- StatusResponseServiceName$new()
        serviceNameObject$fromJSON(jsonlite::toJSON(StatusResponseObject$serviceName, auto_unbox = TRUE, digits = NA))
        self$`serviceName` <- serviceNameObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`serviceName`)) {
        sprintf(
        '"serviceName":
        %s
        ',
        jsonlite::toJSON(self$`serviceName`$toJSON(), auto_unbox=TRUE, digits = NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(StatusResponseJson) {
      StatusResponseObject <- jsonlite::fromJSON(StatusResponseJson)
      self$`serviceName` <- StatusResponseServiceName$new()$fromJSON(jsonlite::toJSON(StatusResponseObject$serviceName, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.