R/PropertyPostDTO.r

# sunagriAPI
#
# An instance of OpenSILEX WebService
#
# OpenAPI spec version: 3.3.0
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


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

      PropertyPostDTOObject
    },
    fromJSON = function(PropertyPostDTOJson) {
      PropertyPostDTOObject <- jsonlite::fromJSON(PropertyPostDTOJson)
      if (!is.null(PropertyPostDTOObject$`rdfType`)) {
        self$`rdfType` <- PropertyPostDTOObject$`rdfType`
      }
      if (!is.null(PropertyPostDTOObject$`relation`)) {
        self$`relation` <- PropertyPostDTOObject$`relation`
      }
      if (!is.null(PropertyPostDTOObject$`value`)) {
        self$`value` <- PropertyPostDTOObject$`value`
      }
    },
    fromJSONObject = function(PropertyPostDTOObject) {
      if (!is.null(PropertyPostDTOObject$`rdfType`)) {
        self$`rdfType` <- PropertyPostDTOObject$`rdfType`
      }
      if (!is.null(PropertyPostDTOObject$`relation`)) {
        self$`relation` <- PropertyPostDTOObject$`relation`
      }
      if (!is.null(PropertyPostDTOObject$`value`)) {
        self$`value` <- PropertyPostDTOObject$`value`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "rdfType": %s,
           "relation": %s,
           "value": %s
        }',
        jsonlite::toJSON(self$`rdfType`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`relation`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`value`,auto_unbox=TRUE, null = "null")
      )
    },
    fromJSONString = function(PropertyPostDTOJson) {
      PropertyPostDTOObject <- jsonlite::fromJSON(PropertyPostDTOJson)
      self$`rdfType` <- PropertyPostDTOObject$`rdfType`
      self$`relation` <- PropertyPostDTOObject$`relation`
      self$`value` <- PropertyPostDTOObject$`value`
    }
  )
)
OpenSILEX/phis-ws-client-r-tool documentation built on Sept. 10, 2020, 8:42 a.m.