# GraphSense API
#
# GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
#
# The version of the OpenAPI document: 1.0.1
# Contact: contact@ikna.io
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title SearchResult
#'
#' @description SearchResult Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field currencies list( \link{SearchResultByCurrency} )
#'
#' @field labels list( character )
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SearchResult <- R6::R6Class(
'SearchResult',
public = list(
`currencies` = NULL,
`labels` = NULL,
initialize = function(
`currencies`, `labels`, ...
) {
local.optional.var <- list(...)
if (!missing(`currencies`)) {
stopifnot(is.vector(`currencies`), length(`currencies`) != 0)
sapply(`currencies`, function(x) stopifnot(R6::is.R6(x)))
self$`currencies` <- `currencies`
}
if (!missing(`labels`)) {
stopifnot(is.vector(`labels`), length(`labels`) != 0)
sapply(`labels`, function(x) stopifnot(is.character(x)))
self$`labels` <- `labels`
}
},
toJSON = function() {
SearchResultObject <- list()
if (!is.null(self$`currencies`)) {
SearchResultObject[['currencies']] <-
lapply(self$`currencies`, function(x) x$toJSON())
}
if (!is.null(self$`labels`)) {
SearchResultObject[['labels']] <-
self$`labels`
}
SearchResultObject
},
fromJSON = function(SearchResultJson) {
SearchResultObject <- jsonlite::fromJSON(SearchResultJson)
if (!is.null(SearchResultObject$`currencies`)) {
self$`currencies` <- ApiClient$new()$deserializeObj(SearchResultObject$`currencies`, "array[SearchResultByCurrency]", loadNamespace("graphsense"))
}
if (!is.null(SearchResultObject$`labels`)) {
self$`labels` <- ApiClient$new()$deserializeObj(SearchResultObject$`labels`, "array[character]", loadNamespace("graphsense"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`currencies`)) {
sprintf(
'"currencies":
[%s]
',
paste(sapply(self$`currencies`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)},
if (!is.null(self$`labels`)) {
sprintf(
'"labels":
[%s]
',
paste(unlist(lapply(self$`labels`, function(x) paste0('"', x, '"'))), collapse=",")
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(SearchResultJson) {
SearchResultObject <- jsonlite::fromJSON(SearchResultJson)
self$`currencies` <- ApiClient$new()$deserializeObj(SearchResultObject$`currencies`, "array[SearchResultByCurrency]", loadNamespace("graphsense"))
self$`labels` <- ApiClient$new()$deserializeObj(SearchResultObject$`labels`, "array[character]", loadNamespace("graphsense"))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.