R/configuration_query.R

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

#' @docType class
#' @title ConfigurationQuery
#'
#' @description ConfigurationQuery Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field namespace  character [optional]
#'
#' @field name  character [optional]
#'
#' @field synopsis  character [optional]
#'
#' @field snapshotComment  character [optional]
#'
#' @field documentation  character [optional]
#'
#' @field payload  character [optional]
#'
#' @field entityType  character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ConfigurationQuery <- R6::R6Class(
  'ConfigurationQuery',
  public = list(
    `namespace` = NULL,
    `name` = NULL,
    `synopsis` = NULL,
    `snapshotComment` = NULL,
    `documentation` = NULL,
    `payload` = NULL,
    `entityType` = NULL,
    initialize = function(
        `namespace`='YOUR_NAMESPACE', `name`='quick-BWA-config', `synopsis`='Quick synopsis of configuration.', `snapshotComment`='Improved spline reticulation', `documentation`='Example configuration with an associated method.', `payload`='{ "methodRepoMethod": { "methodNamespace": "YOUR_NAMESPACE", "methodName": "BWA", "methodVersion": 1}}
', `entityType`='Configuration', ...
    ) {
      local.optional.var <- list(...)
      if (!is.null(`namespace`)) {
        stopifnot(is.character(`namespace`), length(`namespace`) == 1)
        self$`namespace` <- `namespace`
      }
      if (!is.null(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!is.null(`synopsis`)) {
        stopifnot(is.character(`synopsis`), length(`synopsis`) == 1)
        self$`synopsis` <- `synopsis`
      }
      if (!is.null(`snapshotComment`)) {
        stopifnot(is.character(`snapshotComment`), length(`snapshotComment`) == 1)
        self$`snapshotComment` <- `snapshotComment`
      }
      if (!is.null(`documentation`)) {
        stopifnot(is.character(`documentation`), length(`documentation`) == 1)
        self$`documentation` <- `documentation`
      }
      if (!is.null(`payload`)) {
        stopifnot(is.character(`payload`), length(`payload`) == 1)
        self$`payload` <- `payload`
      }
      if (!is.null(`entityType`)) {
        stopifnot(is.character(`entityType`), length(`entityType`) == 1)
        self$`entityType` <- `entityType`
      }
    },
    toJSON = function() {
      ConfigurationQueryObject <- list()
      if (!is.null(self$`namespace`)) {
        ConfigurationQueryObject[['namespace']] <-
          self$`namespace`
      }
      if (!is.null(self$`name`)) {
        ConfigurationQueryObject[['name']] <-
          self$`name`
      }
      if (!is.null(self$`synopsis`)) {
        ConfigurationQueryObject[['synopsis']] <-
          self$`synopsis`
      }
      if (!is.null(self$`snapshotComment`)) {
        ConfigurationQueryObject[['snapshotComment']] <-
          self$`snapshotComment`
      }
      if (!is.null(self$`documentation`)) {
        ConfigurationQueryObject[['documentation']] <-
          self$`documentation`
      }
      if (!is.null(self$`payload`)) {
        ConfigurationQueryObject[['payload']] <-
          self$`payload`
      }
      if (!is.null(self$`entityType`)) {
        ConfigurationQueryObject[['entityType']] <-
          self$`entityType`
      }

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