R/AuthModelKeycloak.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


#' AuthModelKeycloak Class
#'
#' @field username 
#' @field realm 
#' @field endpoint 
#' @field redirectURI 
#' @field clientId 
#' @field clientSecret 
#' @field updatedAt 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
AuthModelKeycloak <- R6::R6Class(
  'AuthModelKeycloak',
  public = list(
    `username` = NULL,
    `realm` = NULL,
    `endpoint` = NULL,
    `redirectURI` = NULL,
    `clientId` = NULL,
    `clientSecret` = NULL,
    `updatedAt` = NULL,
    initialize = function(`username`, `realm`, `endpoint`, `redirectURI`, `clientId`, `clientSecret`, `updatedAt`){
      if (!missing(`username`)) {
        stopifnot(is.character(`username`), length(`username`) == 1)
        self$`username` <- `username`
      }
      if (!missing(`realm`)) {
        stopifnot(is.character(`realm`), length(`realm`) == 1)
        self$`realm` <- `realm`
      }
      if (!missing(`endpoint`)) {
        stopifnot(is.character(`endpoint`), length(`endpoint`) == 1)
        self$`endpoint` <- `endpoint`
      }
      if (!missing(`redirectURI`)) {
        stopifnot(is.character(`redirectURI`), length(`redirectURI`) == 1)
        self$`redirectURI` <- `redirectURI`
      }
      if (!missing(`clientId`)) {
        stopifnot(is.character(`clientId`), length(`clientId`) == 1)
        self$`clientId` <- `clientId`
      }
      if (!missing(`clientSecret`)) {
        stopifnot(is.character(`clientSecret`), length(`clientSecret`) == 1)
        self$`clientSecret` <- `clientSecret`
      }
      if (!missing(`updatedAt`)) {
        stopifnot(is.character(`updatedAt`), length(`updatedAt`) == 1)
        self$`updatedAt` <- `updatedAt`
      }
    },
    toJSON = function() {
      AuthModelKeycloakObject <- list()
      if (!is.null(self$`username`)) {
        AuthModelKeycloakObject[['username']] <- self$`username`
      }
      if (!is.null(self$`realm`)) {
        AuthModelKeycloakObject[['realm']] <- self$`realm`
      }
      if (!is.null(self$`endpoint`)) {
        AuthModelKeycloakObject[['endpoint']] <- self$`endpoint`
      }
      if (!is.null(self$`redirectURI`)) {
        AuthModelKeycloakObject[['redirectURI']] <- self$`redirectURI`
      }
      if (!is.null(self$`clientId`)) {
        AuthModelKeycloakObject[['clientId']] <- self$`clientId`
      }
      if (!is.null(self$`clientSecret`)) {
        AuthModelKeycloakObject[['clientSecret']] <- self$`clientSecret`
      }
      if (!is.null(self$`updatedAt`)) {
        AuthModelKeycloakObject[['updatedAt']] <- self$`updatedAt`
      }

      AuthModelKeycloakObject
    },
    fromJSON = function(AuthModelKeycloakJson) {
      AuthModelKeycloakObject <- jsonlite::fromJSON(AuthModelKeycloakJson)
      if (!is.null(AuthModelKeycloakObject$`username`)) {
        self$`username` <- AuthModelKeycloakObject$`username`
      }
      if (!is.null(AuthModelKeycloakObject$`realm`)) {
        self$`realm` <- AuthModelKeycloakObject$`realm`
      }
      if (!is.null(AuthModelKeycloakObject$`endpoint`)) {
        self$`endpoint` <- AuthModelKeycloakObject$`endpoint`
      }
      if (!is.null(AuthModelKeycloakObject$`redirectURI`)) {
        self$`redirectURI` <- AuthModelKeycloakObject$`redirectURI`
      }
      if (!is.null(AuthModelKeycloakObject$`clientId`)) {
        self$`clientId` <- AuthModelKeycloakObject$`clientId`
      }
      if (!is.null(AuthModelKeycloakObject$`clientSecret`)) {
        self$`clientSecret` <- AuthModelKeycloakObject$`clientSecret`
      }
      if (!is.null(AuthModelKeycloakObject$`updatedAt`)) {
        self$`updatedAt` <- AuthModelKeycloakObject$`updatedAt`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "username": %s,
           "realm": %s,
           "endpoint": %s,
           "redirectURI": %s,
           "clientId": %s,
           "clientSecret": %s,
           "updatedAt": %s
        }',
        self$`username`,
        self$`realm`,
        self$`endpoint`,
        self$`redirectURI`,
        self$`clientId`,
        self$`clientSecret`,
        self$`updatedAt`
      )
    },
    fromJSONString = function(AuthModelKeycloakJson) {
      AuthModelKeycloakObject <- jsonlite::fromJSON(AuthModelKeycloakJson)
      self$`username` <- AuthModelKeycloakObject$`username`
      self$`realm` <- AuthModelKeycloakObject$`realm`
      self$`endpoint` <- AuthModelKeycloakObject$`endpoint`
      self$`redirectURI` <- AuthModelKeycloakObject$`redirectURI`
      self$`clientId` <- AuthModelKeycloakObject$`clientId`
      self$`clientSecret` <- AuthModelKeycloakObject$`clientSecret`
      self$`updatedAt` <- AuthModelKeycloakObject$`updatedAt`
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.