R/rawls_group_short.R

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

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

      RawlsGroupShortObject
    },
    fromJSON = function(RawlsGroupShortJson) {
      RawlsGroupShortObject <- jsonlite::fromJSON(RawlsGroupShortJson)
      if (!is.null(RawlsGroupShortObject$`groupName`)) {
        self$`groupName` <- RawlsGroupShortObject$`groupName`
      }
      if (!is.null(RawlsGroupShortObject$`groupEmail`)) {
        self$`groupEmail` <- RawlsGroupShortObject$`groupEmail`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`groupName`)) {
        sprintf(
        '"groupName":
          "%s"
                ',
        self$`groupName`
        )},
        if (!is.null(self$`groupEmail`)) {
        sprintf(
        '"groupEmail":
          "%s"
                ',
        self$`groupEmail`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(RawlsGroupShortJson) {
      RawlsGroupShortObject <- jsonlite::fromJSON(RawlsGroupShortJson)
      self$`groupName` <- RawlsGroupShortObject$`groupName`
      self$`groupEmail` <- RawlsGroupShortObject$`groupEmail`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.