R/SensorDetailDTO.r

# sunagriAPI
#
# An instance of OpenSILEX WebService
#
# OpenAPI spec version: 3.3.0
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' SensorDetailDTO Class
#'
#' @field uri 
#' @field rdfType 
#' @field label 
#' @field brand 
#' @field model 
#' @field serialNumber 
#' @field inServiceDate 
#' @field dateOfPurchase 
#' @field dateOfLastCalibration 
#' @field personInCharge 
#' @field variables 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SensorDetailDTO <- R6::R6Class(
  'SensorDetailDTO',
  public = list(
    `uri` = NULL,
    `rdfType` = NULL,
    `label` = NULL,
    `brand` = NULL,
    `model` = NULL,
    `serialNumber` = NULL,
    `inServiceDate` = NULL,
    `dateOfPurchase` = NULL,
    `dateOfLastCalibration` = NULL,
    `personInCharge` = NULL,
    `variables` = NULL,
    initialize = function(`uri`, `rdfType`, `label`, `brand`, `model`, `serialNumber`, `inServiceDate`, `dateOfPurchase`, `dateOfLastCalibration`, `personInCharge`, `variables`){
      if (!missing(`uri`)) {
        stopifnot(is.character(`uri`), length(`uri`) == 1)
        self$`uri` <- `uri`
      }
      if (!missing(`rdfType`)) {
        stopifnot(is.character(`rdfType`), length(`rdfType`) == 1)
        self$`rdfType` <- `rdfType`
      }
      if (!missing(`label`)) {
        stopifnot(is.character(`label`), length(`label`) == 1)
        self$`label` <- `label`
      }
      if (!missing(`brand`)) {
        stopifnot(is.character(`brand`), length(`brand`) == 1)
        self$`brand` <- `brand`
      }
      if (!missing(`model`)) {
        stopifnot(is.character(`model`), length(`model`) == 1)
        self$`model` <- `model`
      }
      if (!missing(`serialNumber`)) {
        stopifnot(is.character(`serialNumber`), length(`serialNumber`) == 1)
        self$`serialNumber` <- `serialNumber`
      }
      if (!missing(`inServiceDate`)) {
        stopifnot(is.character(`inServiceDate`), length(`inServiceDate`) == 1)
        self$`inServiceDate` <- `inServiceDate`
      }
      if (!missing(`dateOfPurchase`)) {
        stopifnot(is.character(`dateOfPurchase`), length(`dateOfPurchase`) == 1)
        self$`dateOfPurchase` <- `dateOfPurchase`
      }
      if (!missing(`dateOfLastCalibration`)) {
        stopifnot(is.character(`dateOfLastCalibration`), length(`dateOfLastCalibration`) == 1)
        self$`dateOfLastCalibration` <- `dateOfLastCalibration`
      }
      if (!missing(`personInCharge`)) {
        stopifnot(is.character(`personInCharge`), length(`personInCharge`) == 1)
        self$`personInCharge` <- `personInCharge`
      }
      if (!missing(`variables`)) {
        self$`variables` <- `variables`
      }
    },
    toJSON = function() {
      SensorDetailDTOObject <- list()
      if (!is.null(self$`uri`)) {
        SensorDetailDTOObject[['uri']] <- self$`uri`
      }
      if (!is.null(self$`rdfType`)) {
        SensorDetailDTOObject[['rdfType']] <- self$`rdfType`
      }
      if (!is.null(self$`label`)) {
        SensorDetailDTOObject[['label']] <- self$`label`
      }
      if (!is.null(self$`brand`)) {
        SensorDetailDTOObject[['brand']] <- self$`brand`
      }
      if (!is.null(self$`model`)) {
        SensorDetailDTOObject[['model']] <- self$`model`
      }
      if (!is.null(self$`serialNumber`)) {
        SensorDetailDTOObject[['serialNumber']] <- self$`serialNumber`
      }
      if (!is.null(self$`inServiceDate`)) {
        SensorDetailDTOObject[['inServiceDate']] <- self$`inServiceDate`
      }
      if (!is.null(self$`dateOfPurchase`)) {
        SensorDetailDTOObject[['dateOfPurchase']] <- self$`dateOfPurchase`
      }
      if (!is.null(self$`dateOfLastCalibration`)) {
        SensorDetailDTOObject[['dateOfLastCalibration']] <- self$`dateOfLastCalibration`
      }
      if (!is.null(self$`personInCharge`)) {
        SensorDetailDTOObject[['personInCharge']] <- self$`personInCharge`
      }
      if (!is.null(self$`variables`)) {
        SensorDetailDTOObject[['variables']] <- self$`variables`
      }

      SensorDetailDTOObject
    },
    fromJSON = function(SensorDetailDTOJson) {
      SensorDetailDTOObject <- jsonlite::fromJSON(SensorDetailDTOJson)
      if (!is.null(SensorDetailDTOObject$`uri`)) {
        self$`uri` <- SensorDetailDTOObject$`uri`
      }
      if (!is.null(SensorDetailDTOObject$`rdfType`)) {
        self$`rdfType` <- SensorDetailDTOObject$`rdfType`
      }
      if (!is.null(SensorDetailDTOObject$`label`)) {
        self$`label` <- SensorDetailDTOObject$`label`
      }
      if (!is.null(SensorDetailDTOObject$`brand`)) {
        self$`brand` <- SensorDetailDTOObject$`brand`
      }
      if (!is.null(SensorDetailDTOObject$`model`)) {
        self$`model` <- SensorDetailDTOObject$`model`
      }
      if (!is.null(SensorDetailDTOObject$`serialNumber`)) {
        self$`serialNumber` <- SensorDetailDTOObject$`serialNumber`
      }
      if (!is.null(SensorDetailDTOObject$`inServiceDate`)) {
        self$`inServiceDate` <- SensorDetailDTOObject$`inServiceDate`
      }
      if (!is.null(SensorDetailDTOObject$`dateOfPurchase`)) {
        self$`dateOfPurchase` <- SensorDetailDTOObject$`dateOfPurchase`
      }
      if (!is.null(SensorDetailDTOObject$`dateOfLastCalibration`)) {
        self$`dateOfLastCalibration` <- SensorDetailDTOObject$`dateOfLastCalibration`
      }
      if (!is.null(SensorDetailDTOObject$`personInCharge`)) {
        self$`personInCharge` <- SensorDetailDTOObject$`personInCharge`
      }
      if (!is.null(SensorDetailDTOObject$`variables`)) {
        self$`variables` <- SensorDetailDTOObject$`variables`
      }
    },
    fromJSONObject = function(SensorDetailDTOObject) {
      if (!is.null(SensorDetailDTOObject$`uri`)) {
        self$`uri` <- SensorDetailDTOObject$`uri`
      }
      if (!is.null(SensorDetailDTOObject$`rdfType`)) {
        self$`rdfType` <- SensorDetailDTOObject$`rdfType`
      }
      if (!is.null(SensorDetailDTOObject$`label`)) {
        self$`label` <- SensorDetailDTOObject$`label`
      }
      if (!is.null(SensorDetailDTOObject$`brand`)) {
        self$`brand` <- SensorDetailDTOObject$`brand`
      }
      if (!is.null(SensorDetailDTOObject$`model`)) {
        self$`model` <- SensorDetailDTOObject$`model`
      }
      if (!is.null(SensorDetailDTOObject$`serialNumber`)) {
        self$`serialNumber` <- SensorDetailDTOObject$`serialNumber`
      }
      if (!is.null(SensorDetailDTOObject$`inServiceDate`)) {
        self$`inServiceDate` <- SensorDetailDTOObject$`inServiceDate`
      }
      if (!is.null(SensorDetailDTOObject$`dateOfPurchase`)) {
        self$`dateOfPurchase` <- SensorDetailDTOObject$`dateOfPurchase`
      }
      if (!is.null(SensorDetailDTOObject$`dateOfLastCalibration`)) {
        self$`dateOfLastCalibration` <- SensorDetailDTOObject$`dateOfLastCalibration`
      }
      if (!is.null(SensorDetailDTOObject$`personInCharge`)) {
        self$`personInCharge` <- SensorDetailDTOObject$`personInCharge`
      }
      if (!is.null(SensorDetailDTOObject$`variables`)) {
        self$`variables` <- SensorDetailDTOObject$`variables`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "uri": %s,
           "rdfType": %s,
           "label": %s,
           "brand": %s,
           "model": %s,
           "serialNumber": %s,
           "inServiceDate": %s,
           "dateOfPurchase": %s,
           "dateOfLastCalibration": %s,
           "personInCharge": %s,
           "variables": %s
        }',
        jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`rdfType`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`label`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`brand`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`model`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`serialNumber`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`inServiceDate`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`dateOfPurchase`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`dateOfLastCalibration`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`personInCharge`,auto_unbox=TRUE, null = "null"),
        jsonlite::toJSON(self$`variables`,auto_unbox=TRUE, null = "null")
      )
    },
    fromJSONString = function(SensorDetailDTOJson) {
      SensorDetailDTOObject <- jsonlite::fromJSON(SensorDetailDTOJson)
      self$`uri` <- SensorDetailDTOObject$`uri`
      self$`rdfType` <- SensorDetailDTOObject$`rdfType`
      self$`label` <- SensorDetailDTOObject$`label`
      self$`brand` <- SensorDetailDTOObject$`brand`
      self$`model` <- SensorDetailDTOObject$`model`
      self$`serialNumber` <- SensorDetailDTOObject$`serialNumber`
      self$`inServiceDate` <- SensorDetailDTOObject$`inServiceDate`
      self$`dateOfPurchase` <- SensorDetailDTOObject$`dateOfPurchase`
      self$`dateOfLastCalibration` <- SensorDetailDTOObject$`dateOfLastCalibration`
      self$`personInCharge` <- SensorDetailDTOObject$`personInCharge`
      self$`variables` <- SensorDetailDTOObject$`variables`
    }
  )
)
OpenSILEX/phis-ws-client-r-tool documentation built on Sept. 10, 2020, 8:42 a.m.