R/JobInputDatumModel.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


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

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