R/ConcernedItemDTO.r

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


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

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