R/add_list_member_all_of.R

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

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

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