R/AuthModelLdapAdvanced.r

# Dkube api server
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 2.2.1.11
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' AuthModelLdapAdvanced Class
#'
#' @field name 
#' @field dataProfile 
#' @field superuserProfile 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
AuthModelLdapAdvanced <- R6::R6Class(
  'AuthModelLdapAdvanced',
  public = list(
    `name` = NULL,
    `dataProfile` = NULL,
    `superuserProfile` = NULL,
    initialize = function(`name`, `dataProfile`, `superuserProfile`){
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`dataProfile`)) {
        stopifnot(is.character(`dataProfile`), length(`dataProfile`) == 1)
        self$`dataProfile` <- `dataProfile`
      }
      if (!missing(`superuserProfile`)) {
        stopifnot(is.character(`superuserProfile`), length(`superuserProfile`) == 1)
        self$`superuserProfile` <- `superuserProfile`
      }
    },
    toJSON = function() {
      AuthModelLdapAdvancedObject <- list()
      if (!is.null(self$`name`)) {
        AuthModelLdapAdvancedObject[['name']] <- self$`name`
      }
      if (!is.null(self$`dataProfile`)) {
        AuthModelLdapAdvancedObject[['dataProfile']] <- self$`dataProfile`
      }
      if (!is.null(self$`superuserProfile`)) {
        AuthModelLdapAdvancedObject[['superuserProfile']] <- self$`superuserProfile`
      }

      AuthModelLdapAdvancedObject
    },
    fromJSON = function(AuthModelLdapAdvancedJson) {
      AuthModelLdapAdvancedObject <- jsonlite::fromJSON(AuthModelLdapAdvancedJson)
      if (!is.null(AuthModelLdapAdvancedObject$`name`)) {
        self$`name` <- AuthModelLdapAdvancedObject$`name`
      }
      if (!is.null(AuthModelLdapAdvancedObject$`dataProfile`)) {
        self$`dataProfile` <- AuthModelLdapAdvancedObject$`dataProfile`
      }
      if (!is.null(AuthModelLdapAdvancedObject$`superuserProfile`)) {
        self$`superuserProfile` <- AuthModelLdapAdvancedObject$`superuserProfile`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "name": %s,
           "dataProfile": %s,
           "superuserProfile": %s
        }',
        self$`name`,
        self$`dataProfile`,
        self$`superuserProfile`
      )
    },
    fromJSONString = function(AuthModelLdapAdvancedJson) {
      AuthModelLdapAdvancedObject <- jsonlite::fromJSON(AuthModelLdapAdvancedJson)
      self$`name` <- AuthModelLdapAdvancedObject$`name`
      self$`dataProfile` <- AuthModelLdapAdvancedObject$`dataProfile`
      self$`superuserProfile` <- AuthModelLdapAdvancedObject$`superuserProfile`
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.