R/entity_tag.R

# GraphSense API
#
# GraphSense API
#
# The version of the OpenAPI document: 0.5.2
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title EntityTag
#'
#' @description EntityTag Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field abuse  character [optional]
#'
#' @field active  character 
#'
#' @field category  character [optional]
#'
#' @field currency  character 
#'
#' @field is_cluster_definer  character [optional]
#'
#' @field is_public  character [optional]
#'
#' @field label  character 
#'
#' @field lastmod  integer [optional]
#'
#' @field source  character [optional]
#'
#' @field tagpack_uri  character [optional]
#'
#' @field address  character [optional]
#'
#' @field entity  integer 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
EntityTag <- R6::R6Class(
  'EntityTag',
  public = list(
    `abuse` = NULL,
    `active` = NULL,
    `category` = NULL,
    `currency` = NULL,
    `is_cluster_definer` = NULL,
    `is_public` = NULL,
    `label` = NULL,
    `lastmod` = NULL,
    `source` = NULL,
    `tagpack_uri` = NULL,
    `address` = NULL,
    `entity` = NULL,
    initialize = function(
        `active`, `currency`, `label`, `entity`, `abuse`=NULL, `category`=NULL, `is_cluster_definer`=NULL, `is_public`=NULL, `lastmod`=NULL, `source`=NULL, `tagpack_uri`=NULL, `address`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`active`)) {
        self$`active` <- `active`
      }
      if (!missing(`currency`)) {
        stopifnot(is.character(`currency`), length(`currency`) == 1)
        self$`currency` <- `currency`
      }
      if (!missing(`label`)) {
        stopifnot(is.character(`label`), length(`label`) == 1)
        self$`label` <- `label`
      }
      if (!missing(`entity`)) {
        stopifnot(is.numeric(`entity`), length(`entity`) == 1)
        self$`entity` <- `entity`
      }
      if (!is.null(`abuse`)) {
        stopifnot(is.character(`abuse`), length(`abuse`) == 1)
        self$`abuse` <- `abuse`
      }
      if (!is.null(`category`)) {
        stopifnot(is.character(`category`), length(`category`) == 1)
        self$`category` <- `category`
      }
      if (!is.null(`is_cluster_definer`)) {
        self$`is_cluster_definer` <- `is_cluster_definer`
      }
      if (!is.null(`is_public`)) {
        self$`is_public` <- `is_public`
      }
      if (!is.null(`lastmod`)) {
        stopifnot(is.numeric(`lastmod`), length(`lastmod`) == 1)
        self$`lastmod` <- `lastmod`
      }
      if (!is.null(`source`)) {
        stopifnot(is.character(`source`), length(`source`) == 1)
        self$`source` <- `source`
      }
      if (!is.null(`tagpack_uri`)) {
        stopifnot(is.character(`tagpack_uri`), length(`tagpack_uri`) == 1)
        self$`tagpack_uri` <- `tagpack_uri`
      }
      if (!is.null(`address`)) {
        stopifnot(is.character(`address`), length(`address`) == 1)
        self$`address` <- `address`
      }
    },
    toJSON = function() {
      EntityTagObject <- list()
      if (!is.null(self$`abuse`)) {
        EntityTagObject[['abuse']] <-
          self$`abuse`
      }
      if (!is.null(self$`active`)) {
        EntityTagObject[['active']] <-
          self$`active`
      }
      if (!is.null(self$`category`)) {
        EntityTagObject[['category']] <-
          self$`category`
      }
      if (!is.null(self$`currency`)) {
        EntityTagObject[['currency']] <-
          self$`currency`
      }
      if (!is.null(self$`is_cluster_definer`)) {
        EntityTagObject[['is_cluster_definer']] <-
          self$`is_cluster_definer`
      }
      if (!is.null(self$`is_public`)) {
        EntityTagObject[['is_public']] <-
          self$`is_public`
      }
      if (!is.null(self$`label`)) {
        EntityTagObject[['label']] <-
          self$`label`
      }
      if (!is.null(self$`lastmod`)) {
        EntityTagObject[['lastmod']] <-
          self$`lastmod`
      }
      if (!is.null(self$`source`)) {
        EntityTagObject[['source']] <-
          self$`source`
      }
      if (!is.null(self$`tagpack_uri`)) {
        EntityTagObject[['tagpack_uri']] <-
          self$`tagpack_uri`
      }
      if (!is.null(self$`address`)) {
        EntityTagObject[['address']] <-
          self$`address`
      }
      if (!is.null(self$`entity`)) {
        EntityTagObject[['entity']] <-
          self$`entity`
      }

      EntityTagObject
    },
    fromJSON = function(EntityTagJson) {
      EntityTagObject <- jsonlite::fromJSON(EntityTagJson)
      if (!is.null(EntityTagObject$`abuse`)) {
        self$`abuse` <- EntityTagObject$`abuse`
      }
      if (!is.null(EntityTagObject$`active`)) {
        self$`active` <- EntityTagObject$`active`
      }
      if (!is.null(EntityTagObject$`category`)) {
        self$`category` <- EntityTagObject$`category`
      }
      if (!is.null(EntityTagObject$`currency`)) {
        self$`currency` <- EntityTagObject$`currency`
      }
      if (!is.null(EntityTagObject$`is_cluster_definer`)) {
        self$`is_cluster_definer` <- EntityTagObject$`is_cluster_definer`
      }
      if (!is.null(EntityTagObject$`is_public`)) {
        self$`is_public` <- EntityTagObject$`is_public`
      }
      if (!is.null(EntityTagObject$`label`)) {
        self$`label` <- EntityTagObject$`label`
      }
      if (!is.null(EntityTagObject$`lastmod`)) {
        self$`lastmod` <- EntityTagObject$`lastmod`
      }
      if (!is.null(EntityTagObject$`source`)) {
        self$`source` <- EntityTagObject$`source`
      }
      if (!is.null(EntityTagObject$`tagpack_uri`)) {
        self$`tagpack_uri` <- EntityTagObject$`tagpack_uri`
      }
      if (!is.null(EntityTagObject$`address`)) {
        self$`address` <- EntityTagObject$`address`
      }
      if (!is.null(EntityTagObject$`entity`)) {
        self$`entity` <- EntityTagObject$`entity`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`abuse`)) {
        sprintf(
        '"abuse":
          "%s"
                ',
        self$`abuse`
        )},
        if (!is.null(self$`active`)) {
        sprintf(
        '"active":
          "%s"
                ',
        self$`active`
        )},
        if (!is.null(self$`category`)) {
        sprintf(
        '"category":
          "%s"
                ',
        self$`category`
        )},
        if (!is.null(self$`currency`)) {
        sprintf(
        '"currency":
          "%s"
                ',
        self$`currency`
        )},
        if (!is.null(self$`is_cluster_definer`)) {
        sprintf(
        '"is_cluster_definer":
          "%s"
                ',
        self$`is_cluster_definer`
        )},
        if (!is.null(self$`is_public`)) {
        sprintf(
        '"is_public":
          "%s"
                ',
        self$`is_public`
        )},
        if (!is.null(self$`label`)) {
        sprintf(
        '"label":
          "%s"
                ',
        self$`label`
        )},
        if (!is.null(self$`lastmod`)) {
        sprintf(
        '"lastmod":
          %d
                ',
        self$`lastmod`
        )},
        if (!is.null(self$`source`)) {
        sprintf(
        '"source":
          "%s"
                ',
        self$`source`
        )},
        if (!is.null(self$`tagpack_uri`)) {
        sprintf(
        '"tagpack_uri":
          "%s"
                ',
        self$`tagpack_uri`
        )},
        if (!is.null(self$`address`)) {
        sprintf(
        '"address":
          "%s"
                ',
        self$`address`
        )},
        if (!is.null(self$`entity`)) {
        sprintf(
        '"entity":
          %d
                ',
        self$`entity`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(EntityTagJson) {
      EntityTagObject <- jsonlite::fromJSON(EntityTagJson)
      self$`abuse` <- EntityTagObject$`abuse`
      self$`active` <- EntityTagObject$`active`
      self$`category` <- EntityTagObject$`category`
      self$`currency` <- EntityTagObject$`currency`
      self$`is_cluster_definer` <- EntityTagObject$`is_cluster_definer`
      self$`is_public` <- EntityTagObject$`is_public`
      self$`label` <- EntityTagObject$`label`
      self$`lastmod` <- EntityTagObject$`lastmod`
      self$`source` <- EntityTagObject$`source`
      self$`tagpack_uri` <- EntityTagObject$`tagpack_uri`
      self$`address` <- EntityTagObject$`address`
      self$`entity` <- EntityTagObject$`entity`
      self
    }
  )
)
graphsense/rgraphsense documentation built on Sept. 2, 2022, 1:45 p.m.