R/workflow_query_parameter.R

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

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

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