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


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

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