R/workflow_query_result.R

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

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

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