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


#' URIsListPostDTO Class
#'
#' @field uris 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
URIsListPostDTO <- R6::R6Class(
  'URIsListPostDTO',
  public = list(
    `uris` = NULL,
    initialize = function(`uris`){
      if (!missing(`uris`)) {
        stopifnot(is.list(`uris`), length(`uris`) != 0)
        lapply(`uris`, function(x) stopifnot(is.character(x)))
        self$`uris` <- `uris`
      }
    },
    toJSON = function() {
      URIsListPostDTOObject <- list()
      if (!is.null(self$`uris`)) {
        URIsListPostDTOObject[['uris']] <- self$`uris`
      }

      URIsListPostDTOObject
    },
    fromJSON = function(URIsListPostDTOJson) {
      URIsListPostDTOObject <- jsonlite::fromJSON(URIsListPostDTOJson)
      if (!is.null(URIsListPostDTOObject$`uris`)) {
        self$`uris` <- URIsListPostDTOObject$`uris`
      }
    },
    fromJSONObject = function(URIsListPostDTOObject) {
      if (!is.null(URIsListPostDTOObject$`uris`)) {
        self$`uris` <- URIsListPostDTOObject$`uris`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "uris": [%s]
        }',
        ifelse(is.null(self$`uris`) || length(self$`uris`) == 0, "" ,lapply(self$`uris`, function(x) paste(paste0('"', x, '"'), sep=",")))
      )
    },
    fromJSONString = function(URIsListPostDTOJson) {
      URIsListPostDTOObject <- jsonlite::fromJSON(URIsListPostDTOJson)
      self$`uris` <- URIsListPostDTOObject$`uris`
    }
  )
)
OpenSILEX/opensilexClientToolsR documentation built on Jan. 28, 2022, 5:03 a.m.