R/attribute_entity_reference.R

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

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

      AttributeEntityReferenceObject
    },
    fromJSON = function(AttributeEntityReferenceJson) {
      AttributeEntityReferenceObject <- jsonlite::fromJSON(AttributeEntityReferenceJson)
      if (!is.null(AttributeEntityReferenceObject$`entityType`)) {
        self$`entityType` <- AttributeEntityReferenceObject$`entityType`
      }
      if (!is.null(AttributeEntityReferenceObject$`entityName`)) {
        self$`entityName` <- AttributeEntityReferenceObject$`entityName`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`entityType`)) {
        sprintf(
        '"entityType":
          "%s"
                ',
        self$`entityType`
        )},
        if (!is.null(self$`entityName`)) {
        sprintf(
        '"entityName":
          "%s"
                ',
        self$`entityName`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(AttributeEntityReferenceJson) {
      AttributeEntityReferenceObject <- jsonlite::fromJSON(AttributeEntityReferenceJson)
      self$`entityType` <- AttributeEntityReferenceObject$`entityType`
      self$`entityName` <- AttributeEntityReferenceObject$`entityName`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.