R/managed_group_access_instructions.R

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

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

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