# 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 SearchResultLeaf
#'
#' @description SearchResultLeaf Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field matching_addresses list( \link{Address} )
#'
#' @field neighbor \link{NeighborEntity}
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SearchResultLeaf <- R6::R6Class(
'SearchResultLeaf',
public = list(
`matching_addresses` = NULL,
`neighbor` = NULL,
initialize = function(
`matching_addresses`, `neighbor`, ...
) {
local.optional.var <- list(...)
if (!missing(`matching_addresses`)) {
stopifnot(is.vector(`matching_addresses`), length(`matching_addresses`) != 0)
sapply(`matching_addresses`, function(x) stopifnot(R6::is.R6(x)))
self$`matching_addresses` <- `matching_addresses`
}
if (!missing(`neighbor`)) {
stopifnot(R6::is.R6(`neighbor`))
self$`neighbor` <- `neighbor`
}
},
toJSON = function() {
SearchResultLeafObject <- list()
if (!is.null(self$`matching_addresses`)) {
SearchResultLeafObject[['matching_addresses']] <-
lapply(self$`matching_addresses`, function(x) x$toJSON())
}
if (!is.null(self$`neighbor`)) {
SearchResultLeafObject[['neighbor']] <-
self$`neighbor`$toJSON()
}
SearchResultLeafObject
},
fromJSON = function(SearchResultLeafJson) {
SearchResultLeafObject <- jsonlite::fromJSON(SearchResultLeafJson)
if (!is.null(SearchResultLeafObject$`matching_addresses`)) {
self$`matching_addresses` <- ApiClient$new()$deserializeObj(SearchResultLeafObject$`matching_addresses`, "array[Address]", loadNamespace("graphsense"))
}
if (!is.null(SearchResultLeafObject$`neighbor`)) {
neighborObject <- NeighborEntity$new()
neighborObject$fromJSON(jsonlite::toJSON(SearchResultLeafObject$neighbor, auto_unbox = TRUE, digits = NA))
self$`neighbor` <- neighborObject
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`matching_addresses`)) {
sprintf(
'"matching_addresses":
[%s]
',
paste(sapply(self$`matching_addresses`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)},
if (!is.null(self$`neighbor`)) {
sprintf(
'"neighbor":
%s
',
jsonlite::toJSON(self$`neighbor`$toJSON(), auto_unbox=TRUE, digits = NA)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(SearchResultLeafJson) {
SearchResultLeafObject <- jsonlite::fromJSON(SearchResultLeafJson)
self$`matching_addresses` <- ApiClient$new()$deserializeObj(SearchResultLeafObject$`matching_addresses`, "array[Address]", loadNamespace("graphsense"))
self$`neighbor` <- NeighborEntity$new()$fromJSON(jsonlite::toJSON(SearchResultLeafObject$neighbor, auto_unbox = TRUE, digits = NA))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.