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


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

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