R/copy_configuration_ingest.R

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

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

      CopyConfigurationIngestObject
    },
    fromJSON = function(CopyConfigurationIngestJson) {
      CopyConfigurationIngestObject <- jsonlite::fromJSON(CopyConfigurationIngestJson)
      if (!is.null(CopyConfigurationIngestObject$`configurationNamespace`)) {
        self$`configurationNamespace` <- CopyConfigurationIngestObject$`configurationNamespace`
      }
      if (!is.null(CopyConfigurationIngestObject$`configurationName`)) {
        self$`configurationName` <- CopyConfigurationIngestObject$`configurationName`
      }
      if (!is.null(CopyConfigurationIngestObject$`configurationSnapshotId`)) {
        self$`configurationSnapshotId` <- CopyConfigurationIngestObject$`configurationSnapshotId`
      }
      if (!is.null(CopyConfigurationIngestObject$`destinationNamespace`)) {
        self$`destinationNamespace` <- CopyConfigurationIngestObject$`destinationNamespace`
      }
      if (!is.null(CopyConfigurationIngestObject$`destinationName`)) {
        self$`destinationName` <- CopyConfigurationIngestObject$`destinationName`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`configurationNamespace`)) {
        sprintf(
        '"configurationNamespace":
          "%s"
                ',
        self$`configurationNamespace`
        )},
        if (!is.null(self$`configurationName`)) {
        sprintf(
        '"configurationName":
          "%s"
                ',
        self$`configurationName`
        )},
        if (!is.null(self$`configurationSnapshotId`)) {
        sprintf(
        '"configurationSnapshotId":
          %d
                ',
        self$`configurationSnapshotId`
        )},
        if (!is.null(self$`destinationNamespace`)) {
        sprintf(
        '"destinationNamespace":
          "%s"
                ',
        self$`destinationNamespace`
        )},
        if (!is.null(self$`destinationName`)) {
        sprintf(
        '"destinationName":
          "%s"
                ',
        self$`destinationName`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(CopyConfigurationIngestJson) {
      CopyConfigurationIngestObject <- jsonlite::fromJSON(CopyConfigurationIngestJson)
      self$`configurationNamespace` <- CopyConfigurationIngestObject$`configurationNamespace`
      self$`configurationName` <- CopyConfigurationIngestObject$`configurationName`
      self$`configurationSnapshotId` <- CopyConfigurationIngestObject$`configurationSnapshotId`
      self$`destinationNamespace` <- CopyConfigurationIngestObject$`destinationNamespace`
      self$`destinationName` <- CopyConfigurationIngestObject$`destinationName`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.