R/workflow_status_response.R

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

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

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