R/submission_request.R

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

#' @docType class
#' @title SubmissionRequest
#'
#' @description SubmissionRequest Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field methodConfigurationNamespace  character 
#'
#' @field methodConfigurationName  character 
#'
#' @field entityType  character [optional]
#'
#' @field entityName  character [optional]
#'
#' @field expression  character [optional]
#'
#' @field useCallCache  character 
#'
#' @field deleteIntermediateOutputFiles  character [optional]
#'
#' @field useReferenceDisks  character [optional]
#'
#' @field workflowFailureMode  character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SubmissionRequest <- R6::R6Class(
  'SubmissionRequest',
  public = list(
    `methodConfigurationNamespace` = NULL,
    `methodConfigurationName` = NULL,
    `entityType` = NULL,
    `entityName` = NULL,
    `expression` = NULL,
    `useCallCache` = NULL,
    `deleteIntermediateOutputFiles` = NULL,
    `useReferenceDisks` = NULL,
    `workflowFailureMode` = NULL,
    initialize = function(
        `methodConfigurationNamespace`, `methodConfigurationName`, `useCallCache`, `entityType`=NULL, `entityName`=NULL, `expression`=NULL, `deleteIntermediateOutputFiles`=NULL, `useReferenceDisks`=NULL, `workflowFailureMode`='NoNewCalls', ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`methodConfigurationNamespace`)) {
        stopifnot(is.character(`methodConfigurationNamespace`), length(`methodConfigurationNamespace`) == 1)
        self$`methodConfigurationNamespace` <- `methodConfigurationNamespace`
      }
      if (!missing(`methodConfigurationName`)) {
        stopifnot(is.character(`methodConfigurationName`), length(`methodConfigurationName`) == 1)
        self$`methodConfigurationName` <- `methodConfigurationName`
      }
      if (!missing(`useCallCache`)) {
        self$`useCallCache` <- `useCallCache`
      }
      if (!is.null(`entityType`)) {
        stopifnot(is.character(`entityType`), length(`entityType`) == 1)
        self$`entityType` <- `entityType`
      }
      if (!is.null(`entityName`)) {
        stopifnot(is.character(`entityName`), length(`entityName`) == 1)
        self$`entityName` <- `entityName`
      }
      if (!is.null(`expression`)) {
        stopifnot(is.character(`expression`), length(`expression`) == 1)
        self$`expression` <- `expression`
      }
      if (!is.null(`deleteIntermediateOutputFiles`)) {
        self$`deleteIntermediateOutputFiles` <- `deleteIntermediateOutputFiles`
      }
      if (!is.null(`useReferenceDisks`)) {
        self$`useReferenceDisks` <- `useReferenceDisks`
      }
      if (!is.null(`workflowFailureMode`)) {
        stopifnot(is.character(`workflowFailureMode`), length(`workflowFailureMode`) == 1)
        self$`workflowFailureMode` <- `workflowFailureMode`
      }
    },
    toJSON = function() {
      SubmissionRequestObject <- list()
      if (!is.null(self$`methodConfigurationNamespace`)) {
        SubmissionRequestObject[['methodConfigurationNamespace']] <-
          self$`methodConfigurationNamespace`
      }
      if (!is.null(self$`methodConfigurationName`)) {
        SubmissionRequestObject[['methodConfigurationName']] <-
          self$`methodConfigurationName`
      }
      if (!is.null(self$`entityType`)) {
        SubmissionRequestObject[['entityType']] <-
          self$`entityType`
      }
      if (!is.null(self$`entityName`)) {
        SubmissionRequestObject[['entityName']] <-
          self$`entityName`
      }
      if (!is.null(self$`expression`)) {
        SubmissionRequestObject[['expression']] <-
          self$`expression`
      }
      if (!is.null(self$`useCallCache`)) {
        SubmissionRequestObject[['useCallCache']] <-
          self$`useCallCache`
      }
      if (!is.null(self$`deleteIntermediateOutputFiles`)) {
        SubmissionRequestObject[['deleteIntermediateOutputFiles']] <-
          self$`deleteIntermediateOutputFiles`
      }
      if (!is.null(self$`useReferenceDisks`)) {
        SubmissionRequestObject[['useReferenceDisks']] <-
          self$`useReferenceDisks`
      }
      if (!is.null(self$`workflowFailureMode`)) {
        SubmissionRequestObject[['workflowFailureMode']] <-
          self$`workflowFailureMode`
      }

      SubmissionRequestObject
    },
    fromJSON = function(SubmissionRequestJson) {
      SubmissionRequestObject <- jsonlite::fromJSON(SubmissionRequestJson)
      if (!is.null(SubmissionRequestObject$`methodConfigurationNamespace`)) {
        self$`methodConfigurationNamespace` <- SubmissionRequestObject$`methodConfigurationNamespace`
      }
      if (!is.null(SubmissionRequestObject$`methodConfigurationName`)) {
        self$`methodConfigurationName` <- SubmissionRequestObject$`methodConfigurationName`
      }
      if (!is.null(SubmissionRequestObject$`entityType`)) {
        self$`entityType` <- SubmissionRequestObject$`entityType`
      }
      if (!is.null(SubmissionRequestObject$`entityName`)) {
        self$`entityName` <- SubmissionRequestObject$`entityName`
      }
      if (!is.null(SubmissionRequestObject$`expression`)) {
        self$`expression` <- SubmissionRequestObject$`expression`
      }
      if (!is.null(SubmissionRequestObject$`useCallCache`)) {
        self$`useCallCache` <- SubmissionRequestObject$`useCallCache`
      }
      if (!is.null(SubmissionRequestObject$`deleteIntermediateOutputFiles`)) {
        self$`deleteIntermediateOutputFiles` <- SubmissionRequestObject$`deleteIntermediateOutputFiles`
      }
      if (!is.null(SubmissionRequestObject$`useReferenceDisks`)) {
        self$`useReferenceDisks` <- SubmissionRequestObject$`useReferenceDisks`
      }
      if (!is.null(SubmissionRequestObject$`workflowFailureMode`)) {
        self$`workflowFailureMode` <- SubmissionRequestObject$`workflowFailureMode`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`methodConfigurationNamespace`)) {
        sprintf(
        '"methodConfigurationNamespace":
          "%s"
                ',
        self$`methodConfigurationNamespace`
        )},
        if (!is.null(self$`methodConfigurationName`)) {
        sprintf(
        '"methodConfigurationName":
          "%s"
                ',
        self$`methodConfigurationName`
        )},
        if (!is.null(self$`entityType`)) {
        sprintf(
        '"entityType":
          "%s"
                ',
        self$`entityType`
        )},
        if (!is.null(self$`entityName`)) {
        sprintf(
        '"entityName":
          "%s"
                ',
        self$`entityName`
        )},
        if (!is.null(self$`expression`)) {
        sprintf(
        '"expression":
          "%s"
                ',
        self$`expression`
        )},
        if (!is.null(self$`useCallCache`)) {
        sprintf(
        '"useCallCache":
          "%s"
                ',
        self$`useCallCache`
        )},
        if (!is.null(self$`deleteIntermediateOutputFiles`)) {
        sprintf(
        '"deleteIntermediateOutputFiles":
          "%s"
                ',
        self$`deleteIntermediateOutputFiles`
        )},
        if (!is.null(self$`useReferenceDisks`)) {
        sprintf(
        '"useReferenceDisks":
          "%s"
                ',
        self$`useReferenceDisks`
        )},
        if (!is.null(self$`workflowFailureMode`)) {
        sprintf(
        '"workflowFailureMode":
          "%s"
                ',
        self$`workflowFailureMode`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(SubmissionRequestJson) {
      SubmissionRequestObject <- jsonlite::fromJSON(SubmissionRequestJson)
      self$`methodConfigurationNamespace` <- SubmissionRequestObject$`methodConfigurationNamespace`
      self$`methodConfigurationName` <- SubmissionRequestObject$`methodConfigurationName`
      self$`entityType` <- SubmissionRequestObject$`entityType`
      self$`entityName` <- SubmissionRequestObject$`entityName`
      self$`expression` <- SubmissionRequestObject$`expression`
      self$`useCallCache` <- SubmissionRequestObject$`useCallCache`
      self$`deleteIntermediateOutputFiles` <- SubmissionRequestObject$`deleteIntermediateOutputFiles`
      self$`useReferenceDisks` <- SubmissionRequestObject$`useReferenceDisks`
      self$`workflowFailureMode` <- SubmissionRequestObject$`workflowFailureMode`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.