R/v1_field_detail.R

# HCA Matrix Service
#
# Human Cell Atlas Matrix Service API
#
# The version of the OpenAPI document: 1.0.0
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title V1FieldDetail
#' @description V1FieldDetail Class
#' @format An \code{R6Class} generator object
#' @field field_name   character  
#'
#' @field field_description   character  
#'
#' @field field_type   character  
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
V1FieldDetail <- R6::R6Class(
  'V1FieldDetail',
  public = list(
    `field_name` = NULL,
    `field_description` = NULL,
    `field_type` = NULL,
    initialize = function(`field_name`, `field_description`, `field_type`, ...){
      local.optional.var <- list(...)
      if (!missing(`field_name`)) {
        stopifnot(is.character(`field_name`), length(`field_name`) == 1)
        self$`field_name` <- `field_name`
      }
      if (!missing(`field_description`)) {
        stopifnot(is.character(`field_description`), length(`field_description`) == 1)
        self$`field_description` <- `field_description`
      }
      if (!missing(`field_type`)) {
        stopifnot(is.character(`field_type`), length(`field_type`) == 1)
        self$`field_type` <- `field_type`
      }
    },
    toJSON = function() {
      V1FieldDetailObject <- list()
      if (!is.null(self$`field_name`)) {
        V1FieldDetailObject[['field_name']] <-
          self$`field_name`
      }
      if (!is.null(self$`field_description`)) {
        V1FieldDetailObject[['field_description']] <-
          self$`field_description`
      }
      if (!is.null(self$`field_type`)) {
        V1FieldDetailObject[['field_type']] <-
          self$`field_type`
      }

      V1FieldDetailObject
    },
    fromJSON = function(V1FieldDetailJson) {
      V1FieldDetailObject <- jsonlite::fromJSON(V1FieldDetailJson)
      if (!is.null(V1FieldDetailObject$`field_name`)) {
        self$`field_name` <- V1FieldDetailObject$`field_name`
      }
      if (!is.null(V1FieldDetailObject$`field_description`)) {
        self$`field_description` <- V1FieldDetailObject$`field_description`
      }
      if (!is.null(V1FieldDetailObject$`field_type`)) {
        self$`field_type` <- V1FieldDetailObject$`field_type`
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`field_name`)) {
        sprintf(
        '"field_name":
          "%s"
                ',
        self$`field_name`
        )},
        if (!is.null(self$`field_description`)) {
        sprintf(
        '"field_description":
          "%s"
                ',
        self$`field_description`
        )},
        if (!is.null(self$`field_type`)) {
        sprintf(
        '"field_type":
          "%s"
                ',
        self$`field_type`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(V1FieldDetailJson) {
      V1FieldDetailObject <- jsonlite::fromJSON(V1FieldDetailJson)
      self$`field_name` <- V1FieldDetailObject$`field_name`
      self$`field_description` <- V1FieldDetailObject$`field_description`
      self$`field_type` <- V1FieldDetailObject$`field_type`
      self
    }
  )
)
Bioconductor/hcamatrixapi documentation built on Nov. 6, 2019, 12:10 a.m.