# OmicIDX
#
# The OmicIDX API documentation is available in three forms: - [RapiDoc](/docs) - [OpenAPI/Swagger Interactive](/swaggerdoc) - [ReDoc (more readable in some ways)](/redoc)
#
# The version of the OpenAPI document: 0.99.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title ResponseModel
#'
#' @description ResponseModel Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field hits Hits list( object )
#'
#' @field facets Facets list( object )
#'
#' @field stats \link{ResponseStats}
#'
#' @field success Success character
#'
#' @field cursor Cursor character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ResponseModel <- R6::R6Class(
'ResponseModel',
public = list(
`hits` = NULL,
`facets` = NULL,
`stats` = NULL,
`success` = NULL,
`cursor` = NULL,
initialize = function(
`hits`, `facets`, `stats`, `success`, `cursor`=NULL, ...
) {
local.optional.var <- list(...)
if (!missing(`hits`)) {
stopifnot(is.vector(`hits`), length(`hits`) != 0)
sapply(`hits`, function(x) stopifnot(is.character(x)))
self$`hits` <- `hits`
}
if (!missing(`facets`)) {
stopifnot(is.vector(`facets`), length(`facets`) != 0)
sapply(`facets`, function(x) stopifnot(is.character(x)))
self$`facets` <- `facets`
}
if (!missing(`stats`)) {
stopifnot(R6::is.R6(`stats`))
self$`stats` <- `stats`
}
if (!missing(`success`)) {
self$`success` <- `success`
}
if (!is.null(`cursor`)) {
stopifnot(is.character(`cursor`), length(`cursor`) == 1)
self$`cursor` <- `cursor`
}
},
toJSON = function() {
ResponseModelObject <- list()
if (!is.null(self$`hits`)) {
ResponseModelObject[['hits']] <-
self$`hits`
}
if (!is.null(self$`facets`)) {
ResponseModelObject[['facets']] <-
self$`facets`
}
if (!is.null(self$`stats`)) {
ResponseModelObject[['stats']] <-
self$`stats`$toJSON()
}
if (!is.null(self$`success`)) {
ResponseModelObject[['success']] <-
self$`success`
}
if (!is.null(self$`cursor`)) {
ResponseModelObject[['cursor']] <-
self$`cursor`
}
ResponseModelObject
},
fromJSON = function(ResponseModelJson) {
ResponseModelObject <- jsonlite::fromJSON(ResponseModelJson)
if (!is.null(ResponseModelObject$`hits`)) {
self$`hits` <- ApiClient$new()$deserializeObj(ResponseModelObject$`hits`, "array[object]", loadNamespace("omicidxClientR"))
}
if (!is.null(ResponseModelObject$`facets`)) {
self$`facets` <- ApiClient$new()$deserializeObj(ResponseModelObject$`facets`, "array[object]", loadNamespace("omicidxClientR"))
}
if (!is.null(ResponseModelObject$`stats`)) {
statsObject <- ResponseStats$new()
statsObject$fromJSON(jsonlite::toJSON(ResponseModelObject$stats, auto_unbox = TRUE, digits = NA))
self$`stats` <- statsObject
}
if (!is.null(ResponseModelObject$`success`)) {
self$`success` <- ResponseModelObject$`success`
}
if (!is.null(ResponseModelObject$`cursor`)) {
self$`cursor` <- ResponseModelObject$`cursor`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`hits`)) {
sprintf(
'"hits":
[%s]
',
paste(unlist(lapply(self$`hits`, function(x) paste0('"', x, '"'))), collapse=",")
)},
if (!is.null(self$`facets`)) {
sprintf(
'"facets":
[%s]
',
paste(unlist(lapply(self$`facets`, function(x) paste0('"', x, '"'))), collapse=",")
)},
if (!is.null(self$`stats`)) {
sprintf(
'"stats":
%s
',
jsonlite::toJSON(self$`stats`$toJSON(), auto_unbox=TRUE, digits = NA)
)},
if (!is.null(self$`success`)) {
sprintf(
'"success":
"%s"
',
self$`success`
)},
if (!is.null(self$`cursor`)) {
sprintf(
'"cursor":
"%s"
',
self$`cursor`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(ResponseModelJson) {
ResponseModelObject <- jsonlite::fromJSON(ResponseModelJson)
self$`hits` <- ApiClient$new()$deserializeObj(ResponseModelObject$`hits`, "array[object]", loadNamespace("omicidxClientR"))
self$`facets` <- ApiClient$new()$deserializeObj(ResponseModelObject$`facets`, "array[object]", loadNamespace("omicidxClientR"))
self$`stats` <- ResponseStats$new()$fromJSON(jsonlite::toJSON(ResponseModelObject$stats, auto_unbox = TRUE, digits = NA))
self$`success` <- ResponseModelObject$`success`
self$`cursor` <- ResponseModelObject$`cursor`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.