R/remove_attribute.R

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

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

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