R/enabled.R

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

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

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