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


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

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