# 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
#' DataFileGetDTO Class
#'
#' @field uri
#' @field rdf_type
#' @field date
#' @field timezone
#' @field target
#' @field provenance
#' @field metadata
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
DataFileGetDTO <- R6::R6Class(
'DataFileGetDTO',
public = list(
`uri` = NULL,
`rdf_type` = NULL,
`date` = NULL,
`timezone` = NULL,
`target` = NULL,
`provenance` = NULL,
`metadata` = NULL,
initialize = function(`uri`, `rdf_type`, `date`, `timezone`, `target`, `provenance`, `metadata`){
if (!missing(`uri`)) {
stopifnot(is.character(`uri`), length(`uri`) == 1)
self$`uri` <- `uri`
}
if (!missing(`rdf_type`)) {
stopifnot(is.character(`rdf_type`), length(`rdf_type`) == 1)
self$`rdf_type` <- `rdf_type`
}
if (!missing(`date`)) {
stopifnot(is.character(`date`), length(`date`) == 1)
self$`date` <- `date`
}
if (!missing(`timezone`)) {
stopifnot(is.character(`timezone`), length(`timezone`) == 1)
self$`timezone` <- `timezone`
}
if (!missing(`target`)) {
stopifnot(is.character(`target`), length(`target`) == 1)
self$`target` <- `target`
}
if (!missing(`provenance`)) {
stopifnot(R6::is.R6(`provenance`))
self$`provenance` <- `provenance`
}
if (!missing(`metadata`)) {
stopifnot(R6::is.R6(`metadata`))
self$`metadata` <- `metadata`
}
},
toJSON = function() {
DataFileGetDTOObject <- list()
if (!is.null(self$`uri`)) {
DataFileGetDTOObject[['uri']] <- self$`uri`
}
if (!is.null(self$`rdf_type`)) {
DataFileGetDTOObject[['rdf_type']] <- self$`rdf_type`
}
if (!is.null(self$`date`)) {
DataFileGetDTOObject[['date']] <- self$`date`
}
if (!is.null(self$`timezone`)) {
DataFileGetDTOObject[['timezone']] <- self$`timezone`
}
if (!is.null(self$`target`)) {
DataFileGetDTOObject[['target']] <- self$`target`
}
if (!is.null(self$`provenance`)) {
DataFileGetDTOObject[['provenance']] <- self$`provenance`$toJSON()
}
if (!is.null(self$`metadata`)) {
DataFileGetDTOObject[['metadata']] <- self$`metadata`$toJSON()
}
DataFileGetDTOObject
},
fromJSON = function(DataFileGetDTOJson) {
DataFileGetDTOObject <- jsonlite::fromJSON(DataFileGetDTOJson)
if (!is.null(DataFileGetDTOObject$`uri`)) {
self$`uri` <- DataFileGetDTOObject$`uri`
}
if (!is.null(DataFileGetDTOObject$`rdf_type`)) {
self$`rdf_type` <- DataFileGetDTOObject$`rdf_type`
}
if (!is.null(DataFileGetDTOObject$`date`)) {
self$`date` <- DataFileGetDTOObject$`date`
}
if (!is.null(DataFileGetDTOObject$`timezone`)) {
self$`timezone` <- DataFileGetDTOObject$`timezone`
}
if (!is.null(DataFileGetDTOObject$`target`)) {
self$`target` <- DataFileGetDTOObject$`target`
}
if (!is.null(DataFileGetDTOObject$`provenance`)) {
provenanceObject <- DataProvenanceModel$new()
provenanceObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$provenance, auto_unbox = TRUE, null = "null"))
self$`provenance` <- provenanceObject
}
if (!is.null(DataFileGetDTOObject$`metadata`)) {
metadataObject <- ObjectDTO$new()
metadataObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$metadata, auto_unbox = TRUE, null = "null"))
self$`metadata` <- metadataObject
}
},
fromJSONObject = function(DataFileGetDTOObject) {
if (!is.null(DataFileGetDTOObject$`uri`)) {
self$`uri` <- DataFileGetDTOObject$`uri`
}
if (!is.null(DataFileGetDTOObject$`rdf_type`)) {
self$`rdf_type` <- DataFileGetDTOObject$`rdf_type`
}
if (!is.null(DataFileGetDTOObject$`date`)) {
self$`date` <- DataFileGetDTOObject$`date`
}
if (!is.null(DataFileGetDTOObject$`timezone`)) {
self$`timezone` <- DataFileGetDTOObject$`timezone`
}
if (!is.null(DataFileGetDTOObject$`target`)) {
self$`target` <- DataFileGetDTOObject$`target`
}
if (!is.null(DataFileGetDTOObject$`provenance`)) {
provenanceObject <- DataProvenanceModel$new()
provenanceObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$provenance, auto_unbox = TRUE, null = "null"))
self$`provenance` <- provenanceObject
}
if (!is.null(DataFileGetDTOObject$`metadata`)) {
metadataObject <- ObjectDTO$new()
metadataObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$metadata, auto_unbox = TRUE, null = "null"))
self$`metadata` <- metadataObject
}
},
toJSONString = function() {
sprintf(
'{
"uri": %s,
"rdf_type": %s,
"date": %s,
"timezone": %s,
"target": %s,
"provenance": %s,
"metadata": %s
}',
ifelse(is.null(self$`uri`), "null",jsonlite::toJSON(self$`uri`,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$`date`), "null",jsonlite::toJSON(self$`date`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`timezone`), "null",jsonlite::toJSON(self$`timezone`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`target`), "null",jsonlite::toJSON(self$`target`,auto_unbox=TRUE, null = "null")),
jsonlite::toJSON(self$`provenance`$toJSON(),auto_unbox=TRUE, null = "null"),
jsonlite::toJSON(self$`metadata`$toJSON(),auto_unbox=TRUE, null = "null")
)
},
fromJSONString = function(DataFileGetDTOJson) {
DataFileGetDTOObject <- jsonlite::fromJSON(DataFileGetDTOJson)
self$`uri` <- DataFileGetDTOObject$`uri`
self$`rdf_type` <- DataFileGetDTOObject$`rdf_type`
self$`date` <- DataFileGetDTOObject$`date`
self$`timezone` <- DataFileGetDTOObject$`timezone`
self$`target` <- DataFileGetDTOObject$`target`
DataProvenanceModelObject <- DataProvenanceModel$new()
self$`provenance` <- DataProvenanceModelObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$provenance, auto_unbox = TRUE))
ObjectDTOObject <- ObjectDTO$new()
self$`metadata` <- ObjectDTOObject$fromJSON(jsonlite::toJSON(DataFileGetDTOObject$metadata, auto_unbox = TRUE))
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.