R/VueDataTypeDTO.r

# OpenSilex API
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 1.0.0-rc+2
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' VueDataTypeDTO Class
#'
#' @field uri 
#' @field short_uri 
#' @field input_component 
#' @field view_component 
#' @field label_key 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
VueDataTypeDTO <- R6::R6Class(
  'VueDataTypeDTO',
  public = list(
    `uri` = NULL,
    `short_uri` = NULL,
    `input_component` = NULL,
    `view_component` = NULL,
    `label_key` = NULL,
    initialize = function(`uri`, `short_uri`, `input_component`, `view_component`, `label_key`){
      if (!missing(`uri`)) {
        stopifnot(is.character(`uri`), length(`uri`) == 1)
        self$`uri` <- `uri`
      }
      if (!missing(`short_uri`)) {
        stopifnot(is.character(`short_uri`), length(`short_uri`) == 1)
        self$`short_uri` <- `short_uri`
      }
      if (!missing(`input_component`)) {
        stopifnot(is.character(`input_component`), length(`input_component`) == 1)
        self$`input_component` <- `input_component`
      }
      if (!missing(`view_component`)) {
        stopifnot(is.character(`view_component`), length(`view_component`) == 1)
        self$`view_component` <- `view_component`
      }
      if (!missing(`label_key`)) {
        stopifnot(is.character(`label_key`), length(`label_key`) == 1)
        self$`label_key` <- `label_key`
      }
    },
    toJSON = function() {
      VueDataTypeDTOObject <- list()
      if (!is.null(self$`uri`)) {
        VueDataTypeDTOObject[['uri']] <- self$`uri`
      }
      if (!is.null(self$`short_uri`)) {
        VueDataTypeDTOObject[['short_uri']] <- self$`short_uri`
      }
      if (!is.null(self$`input_component`)) {
        VueDataTypeDTOObject[['input_component']] <- self$`input_component`
      }
      if (!is.null(self$`view_component`)) {
        VueDataTypeDTOObject[['view_component']] <- self$`view_component`
      }
      if (!is.null(self$`label_key`)) {
        VueDataTypeDTOObject[['label_key']] <- self$`label_key`
      }

      VueDataTypeDTOObject
    },
    fromJSON = function(VueDataTypeDTOJson) {
      VueDataTypeDTOObject <- jsonlite::fromJSON(VueDataTypeDTOJson)
      if (!is.null(VueDataTypeDTOObject$`uri`)) {
        self$`uri` <- VueDataTypeDTOObject$`uri`
      }
      if (!is.null(VueDataTypeDTOObject$`short_uri`)) {
        self$`short_uri` <- VueDataTypeDTOObject$`short_uri`
      }
      if (!is.null(VueDataTypeDTOObject$`input_component`)) {
        self$`input_component` <- VueDataTypeDTOObject$`input_component`
      }
      if (!is.null(VueDataTypeDTOObject$`view_component`)) {
        self$`view_component` <- VueDataTypeDTOObject$`view_component`
      }
      if (!is.null(VueDataTypeDTOObject$`label_key`)) {
        self$`label_key` <- VueDataTypeDTOObject$`label_key`
      }
    },
    fromJSONObject = function(VueDataTypeDTOObject) {
      if (!is.null(VueDataTypeDTOObject$`uri`)) {
        self$`uri` <- VueDataTypeDTOObject$`uri`
      }
      if (!is.null(VueDataTypeDTOObject$`short_uri`)) {
        self$`short_uri` <- VueDataTypeDTOObject$`short_uri`
      }
      if (!is.null(VueDataTypeDTOObject$`input_component`)) {
        self$`input_component` <- VueDataTypeDTOObject$`input_component`
      }
      if (!is.null(VueDataTypeDTOObject$`view_component`)) {
        self$`view_component` <- VueDataTypeDTOObject$`view_component`
      }
      if (!is.null(VueDataTypeDTOObject$`label_key`)) {
        self$`label_key` <- VueDataTypeDTOObject$`label_key`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "uri": %s,
           "short_uri": %s,
           "input_component": %s,
           "view_component": %s,
           "label_key": %s
        }',
        ifelse(is.null(self$`uri`), "null",jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`short_uri`), "null",jsonlite::toJSON(self$`short_uri`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`input_component`), "null",jsonlite::toJSON(self$`input_component`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`view_component`), "null",jsonlite::toJSON(self$`view_component`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`label_key`), "null",jsonlite::toJSON(self$`label_key`,auto_unbox=TRUE, null = "null"))
      )
    },
    fromJSONString = function(VueDataTypeDTOJson) {
      VueDataTypeDTOObject <- jsonlite::fromJSON(VueDataTypeDTOJson)
      self$`uri` <- VueDataTypeDTOObject$`uri`
      self$`short_uri` <- VueDataTypeDTOObject$`short_uri`
      self$`input_component` <- VueDataTypeDTOObject$`input_component`
      self$`view_component` <- VueDataTypeDTOObject$`view_component`
      self$`label_key` <- VueDataTypeDTOObject$`label_key`
    }
  )
)
OpenSILEX/opensilexClientToolsR documentation built on Jan. 28, 2022, 5:03 a.m.