R/ArtifactVolume.r

# Dkube api server
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 2.2.1.11
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' ArtifactVolume Class
#'
#' @field name 
#' @field artifact_type 
#' @field artifact_name 
#' @field artifact_version 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ArtifactVolume <- R6::R6Class(
  'ArtifactVolume',
  public = list(
    `name` = NULL,
    `artifact_type` = NULL,
    `artifact_name` = NULL,
    `artifact_version` = NULL,
    initialize = function(`name`, `artifact_type`, `artifact_name`, `artifact_version`){
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`artifact_type`)) {
        stopifnot(is.character(`artifact_type`), length(`artifact_type`) == 1)
        self$`artifact_type` <- `artifact_type`
      }
      if (!missing(`artifact_name`)) {
        stopifnot(is.character(`artifact_name`), length(`artifact_name`) == 1)
        self$`artifact_name` <- `artifact_name`
      }
      if (!missing(`artifact_version`)) {
        stopifnot(is.character(`artifact_version`), length(`artifact_version`) == 1)
        self$`artifact_version` <- `artifact_version`
      }
    },
    toJSON = function() {
      ArtifactVolumeObject <- list()
      if (!is.null(self$`name`)) {
        ArtifactVolumeObject[['name']] <- self$`name`
      }
      if (!is.null(self$`artifact_type`)) {
        ArtifactVolumeObject[['artifact_type']] <- self$`artifact_type`
      }
      if (!is.null(self$`artifact_name`)) {
        ArtifactVolumeObject[['artifact_name']] <- self$`artifact_name`
      }
      if (!is.null(self$`artifact_version`)) {
        ArtifactVolumeObject[['artifact_version']] <- self$`artifact_version`
      }

      ArtifactVolumeObject
    },
    fromJSON = function(ArtifactVolumeJson) {
      ArtifactVolumeObject <- jsonlite::fromJSON(ArtifactVolumeJson)
      if (!is.null(ArtifactVolumeObject$`name`)) {
        self$`name` <- ArtifactVolumeObject$`name`
      }
      if (!is.null(ArtifactVolumeObject$`artifact_type`)) {
        self$`artifact_type` <- ArtifactVolumeObject$`artifact_type`
      }
      if (!is.null(ArtifactVolumeObject$`artifact_name`)) {
        self$`artifact_name` <- ArtifactVolumeObject$`artifact_name`
      }
      if (!is.null(ArtifactVolumeObject$`artifact_version`)) {
        self$`artifact_version` <- ArtifactVolumeObject$`artifact_version`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "name": %s,
           "artifact_type": %s,
           "artifact_name": %s,
           "artifact_version": %s
        }',
        self$`name`,
        self$`artifact_type`,
        self$`artifact_name`,
        self$`artifact_version`
      )
    },
    fromJSONString = function(ArtifactVolumeJson) {
      ArtifactVolumeObject <- jsonlite::fromJSON(ArtifactVolumeJson)
      self$`name` <- ArtifactVolumeObject$`name`
      self$`artifact_type` <- ArtifactVolumeObject$`artifact_type`
      self$`artifact_name` <- ArtifactVolumeObject$`artifact_name`
      self$`artifact_version` <- ArtifactVolumeObject$`artifact_version`
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.