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


#' RDFPropertyDTO Class
#'
#' @field uri 
#' @field name 
#' @field comment 
#' @field domain 
#' @field range 
#' @field parent 
#' @field rdf_type 
#' @field name_translations 
#' @field comment_translations 
#' @field domain_rdf_type 
#' @field range_label 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
RDFPropertyDTO <- R6::R6Class(
  'RDFPropertyDTO',
  public = list(
    `uri` = NULL,
    `name` = NULL,
    `comment` = NULL,
    `domain` = NULL,
    `range` = NULL,
    `parent` = NULL,
    `rdf_type` = NULL,
    `name_translations` = NULL,
    `comment_translations` = NULL,
    `domain_rdf_type` = NULL,
    `range_label` = NULL,
    initialize = function(`uri`, `name`, `comment`, `domain`, `range`, `parent`, `rdf_type`, `name_translations`, `comment_translations`, `domain_rdf_type`, `range_label`){
      if (!missing(`uri`)) {
        stopifnot(is.character(`uri`), length(`uri`) == 1)
        self$`uri` <- `uri`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`comment`)) {
        stopifnot(is.character(`comment`), length(`comment`) == 1)
        self$`comment` <- `comment`
      }
      if (!missing(`domain`)) {
        stopifnot(is.character(`domain`), length(`domain`) == 1)
        self$`domain` <- `domain`
      }
      if (!missing(`range`)) {
        stopifnot(is.character(`range`), length(`range`) == 1)
        self$`range` <- `range`
      }
      if (!missing(`parent`)) {
        stopifnot(is.character(`parent`), length(`parent`) == 1)
        self$`parent` <- `parent`
      }
      if (!missing(`rdf_type`)) {
        stopifnot(is.character(`rdf_type`), length(`rdf_type`) == 1)
        self$`rdf_type` <- `rdf_type`
      }
      if (!missing(`name_translations`)) {
        self$`name_translations` <- `name_translations`
      }
      if (!missing(`comment_translations`)) {
        self$`comment_translations` <- `comment_translations`
      }
      if (!missing(`domain_rdf_type`)) {
        stopifnot(is.character(`domain_rdf_type`), length(`domain_rdf_type`) == 1)
        self$`domain_rdf_type` <- `domain_rdf_type`
      }
      if (!missing(`range_label`)) {
        stopifnot(is.character(`range_label`), length(`range_label`) == 1)
        self$`range_label` <- `range_label`
      }
    },
    toJSON = function() {
      RDFPropertyDTOObject <- list()
      if (!is.null(self$`uri`)) {
        RDFPropertyDTOObject[['uri']] <- self$`uri`
      }
      if (!is.null(self$`name`)) {
        RDFPropertyDTOObject[['name']] <- self$`name`
      }
      if (!is.null(self$`comment`)) {
        RDFPropertyDTOObject[['comment']] <- self$`comment`
      }
      if (!is.null(self$`domain`)) {
        RDFPropertyDTOObject[['domain']] <- self$`domain`
      }
      if (!is.null(self$`range`)) {
        RDFPropertyDTOObject[['range']] <- self$`range`
      }
      if (!is.null(self$`parent`)) {
        RDFPropertyDTOObject[['parent']] <- self$`parent`
      }
      if (!is.null(self$`rdf_type`)) {
        RDFPropertyDTOObject[['rdf_type']] <- self$`rdf_type`
      }
      if (!is.null(self$`name_translations`)) {
        RDFPropertyDTOObject[['name_translations']] <- self$`name_translations`
      }
      if (!is.null(self$`comment_translations`)) {
        RDFPropertyDTOObject[['comment_translations']] <- self$`comment_translations`
      }
      if (!is.null(self$`domain_rdf_type`)) {
        RDFPropertyDTOObject[['domain_rdf_type']] <- self$`domain_rdf_type`
      }
      if (!is.null(self$`range_label`)) {
        RDFPropertyDTOObject[['range_label']] <- self$`range_label`
      }

      RDFPropertyDTOObject
    },
    fromJSON = function(RDFPropertyDTOJson) {
      RDFPropertyDTOObject <- jsonlite::fromJSON(RDFPropertyDTOJson)
      if (!is.null(RDFPropertyDTOObject$`uri`)) {
        self$`uri` <- RDFPropertyDTOObject$`uri`
      }
      if (!is.null(RDFPropertyDTOObject$`name`)) {
        self$`name` <- RDFPropertyDTOObject$`name`
      }
      if (!is.null(RDFPropertyDTOObject$`comment`)) {
        self$`comment` <- RDFPropertyDTOObject$`comment`
      }
      if (!is.null(RDFPropertyDTOObject$`domain`)) {
        self$`domain` <- RDFPropertyDTOObject$`domain`
      }
      if (!is.null(RDFPropertyDTOObject$`range`)) {
        self$`range` <- RDFPropertyDTOObject$`range`
      }
      if (!is.null(RDFPropertyDTOObject$`parent`)) {
        self$`parent` <- RDFPropertyDTOObject$`parent`
      }
      if (!is.null(RDFPropertyDTOObject$`rdf_type`)) {
        self$`rdf_type` <- RDFPropertyDTOObject$`rdf_type`
      }
      if (!is.null(RDFPropertyDTOObject$`name_translations`)) {
        self$`name_translations` <- RDFPropertyDTOObject$`name_translations`
      }
      if (!is.null(RDFPropertyDTOObject$`comment_translations`)) {
        self$`comment_translations` <- RDFPropertyDTOObject$`comment_translations`
      }
      if (!is.null(RDFPropertyDTOObject$`domain_rdf_type`)) {
        self$`domain_rdf_type` <- RDFPropertyDTOObject$`domain_rdf_type`
      }
      if (!is.null(RDFPropertyDTOObject$`range_label`)) {
        self$`range_label` <- RDFPropertyDTOObject$`range_label`
      }
    },
    fromJSONObject = function(RDFPropertyDTOObject) {
      if (!is.null(RDFPropertyDTOObject$`uri`)) {
        self$`uri` <- RDFPropertyDTOObject$`uri`
      }
      if (!is.null(RDFPropertyDTOObject$`name`)) {
        self$`name` <- RDFPropertyDTOObject$`name`
      }
      if (!is.null(RDFPropertyDTOObject$`comment`)) {
        self$`comment` <- RDFPropertyDTOObject$`comment`
      }
      if (!is.null(RDFPropertyDTOObject$`domain`)) {
        self$`domain` <- RDFPropertyDTOObject$`domain`
      }
      if (!is.null(RDFPropertyDTOObject$`range`)) {
        self$`range` <- RDFPropertyDTOObject$`range`
      }
      if (!is.null(RDFPropertyDTOObject$`parent`)) {
        self$`parent` <- RDFPropertyDTOObject$`parent`
      }
      if (!is.null(RDFPropertyDTOObject$`rdf_type`)) {
        self$`rdf_type` <- RDFPropertyDTOObject$`rdf_type`
      }
      if (!is.null(RDFPropertyDTOObject$`name_translations`)) {
        self$`name_translations` <- RDFPropertyDTOObject$`name_translations`
      }
      if (!is.null(RDFPropertyDTOObject$`comment_translations`)) {
        self$`comment_translations` <- RDFPropertyDTOObject$`comment_translations`
      }
      if (!is.null(RDFPropertyDTOObject$`domain_rdf_type`)) {
        self$`domain_rdf_type` <- RDFPropertyDTOObject$`domain_rdf_type`
      }
      if (!is.null(RDFPropertyDTOObject$`range_label`)) {
        self$`range_label` <- RDFPropertyDTOObject$`range_label`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "uri": %s,
           "name": %s,
           "comment": %s,
           "domain": %s,
           "range": %s,
           "parent": %s,
           "rdf_type": %s,
           "name_translations": %s,
           "comment_translations": %s,
           "domain_rdf_type": %s,
           "range_label": %s
        }',
        ifelse(is.null(self$`uri`), "null",jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`name`), "null",jsonlite::toJSON(self$`name`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`comment`), "null",jsonlite::toJSON(self$`comment`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`domain`), "null",jsonlite::toJSON(self$`domain`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`range`), "null",jsonlite::toJSON(self$`range`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`parent`), "null",jsonlite::toJSON(self$`parent`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`rdf_type`), "null",jsonlite::toJSON(self$`rdf_type`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`name_translations`), "null",jsonlite::toJSON(self$`name_translations`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`comment_translations`), "null",jsonlite::toJSON(self$`comment_translations`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`domain_rdf_type`), "null",jsonlite::toJSON(self$`domain_rdf_type`,auto_unbox=TRUE, null = "null")),
        ifelse(is.null(self$`range_label`), "null",jsonlite::toJSON(self$`range_label`,auto_unbox=TRUE, null = "null"))
      )
    },
    fromJSONString = function(RDFPropertyDTOJson) {
      RDFPropertyDTOObject <- jsonlite::fromJSON(RDFPropertyDTOJson)
      self$`uri` <- RDFPropertyDTOObject$`uri`
      self$`name` <- RDFPropertyDTOObject$`name`
      self$`comment` <- RDFPropertyDTOObject$`comment`
      self$`domain` <- RDFPropertyDTOObject$`domain`
      self$`range` <- RDFPropertyDTOObject$`range`
      self$`parent` <- RDFPropertyDTOObject$`parent`
      self$`rdf_type` <- RDFPropertyDTOObject$`rdf_type`
      self$`name_translations` <- RDFPropertyDTOObject$`name_translations`
      self$`comment_translations` <- RDFPropertyDTOObject$`comment_translations`
      self$`domain_rdf_type` <- RDFPropertyDTOObject$`domain_rdf_type`
      self$`range_label` <- RDFPropertyDTOObject$`range_label`
    }
  )
)
OpenSILEX/opensilexClientToolsR documentation built on Jan. 28, 2022, 5:03 a.m.