R/search_result_level4_all_of.R

# 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 SearchResultLevel4AllOf
#'
#' @description SearchResultLevel4AllOf Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field paths  list( \link{SearchResultLevel5} ) 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SearchResultLevel4AllOf <- R6::R6Class(
  'SearchResultLevel4AllOf',
  public = list(
    `paths` = NULL,
    initialize = function(
        `paths`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`paths`)) {
        stopifnot(is.vector(`paths`), length(`paths`) != 0)
        sapply(`paths`, function(x) stopifnot(R6::is.R6(x)))
        self$`paths` <- `paths`
      }
    },
    toJSON = function() {
      SearchResultLevel4AllOfObject <- list()
      if (!is.null(self$`paths`)) {
        SearchResultLevel4AllOfObject[['paths']] <-
          lapply(self$`paths`, function(x) x$toJSON())
      }

      SearchResultLevel4AllOfObject
    },
    fromJSON = function(SearchResultLevel4AllOfJson) {
      SearchResultLevel4AllOfObject <- jsonlite::fromJSON(SearchResultLevel4AllOfJson)
      if (!is.null(SearchResultLevel4AllOfObject$`paths`)) {
        self$`paths` <- ApiClient$new()$deserializeObj(SearchResultLevel4AllOfObject$`paths`, "array[SearchResultLevel5]", loadNamespace("graphsense"))
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`paths`)) {
        sprintf(
        '"paths":
        [%s]
',
        paste(sapply(self$`paths`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(SearchResultLevel4AllOfJson) {
      SearchResultLevel4AllOfObject <- jsonlite::fromJSON(SearchResultLevel4AllOfJson)
      self$`paths` <- ApiClient$new()$deserializeObj(SearchResultLevel4AllOfObject$`paths`, "array[SearchResultLevel5]", loadNamespace("graphsense"))
      self
    }
  )
)
graphsense/rgraphsense documentation built on Sept. 2, 2022, 1:45 p.m.