R/user_import_permission.R

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

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

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