# sunagriAPI
#
# An instance of OpenSILEX WebService
#
# OpenAPI spec version: 3.3.0
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' SensorPostDTO Class
#'
#' @field rdfType
#' @field label
#' @field brand
#' @field model
#' @field serialNumber
#' @field inServiceDate
#' @field dateOfPurchase
#' @field dateOfLastCalibration
#' @field personInCharge
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SensorPostDTO <- R6::R6Class(
'SensorPostDTO',
public = list(
`rdfType` = NULL,
`label` = NULL,
`brand` = NULL,
`model` = NULL,
`serialNumber` = NULL,
`inServiceDate` = NULL,
`dateOfPurchase` = NULL,
`dateOfLastCalibration` = NULL,
`personInCharge` = NULL,
initialize = function(`rdfType`, `label`, `brand`, `model`, `serialNumber`, `inServiceDate`, `dateOfPurchase`, `dateOfLastCalibration`, `personInCharge`){
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`
}
},
toJSON = function() {
SensorPostDTOObject <- list()
if (!is.null(self$`rdfType`)) {
SensorPostDTOObject[['rdfType']] <- self$`rdfType`
}
if (!is.null(self$`label`)) {
SensorPostDTOObject[['label']] <- self$`label`
}
if (!is.null(self$`brand`)) {
SensorPostDTOObject[['brand']] <- self$`brand`
}
if (!is.null(self$`model`)) {
SensorPostDTOObject[['model']] <- self$`model`
}
if (!is.null(self$`serialNumber`)) {
SensorPostDTOObject[['serialNumber']] <- self$`serialNumber`
}
if (!is.null(self$`inServiceDate`)) {
SensorPostDTOObject[['inServiceDate']] <- self$`inServiceDate`
}
if (!is.null(self$`dateOfPurchase`)) {
SensorPostDTOObject[['dateOfPurchase']] <- self$`dateOfPurchase`
}
if (!is.null(self$`dateOfLastCalibration`)) {
SensorPostDTOObject[['dateOfLastCalibration']] <- self$`dateOfLastCalibration`
}
if (!is.null(self$`personInCharge`)) {
SensorPostDTOObject[['personInCharge']] <- self$`personInCharge`
}
SensorPostDTOObject
},
fromJSON = function(SensorPostDTOJson) {
SensorPostDTOObject <- jsonlite::fromJSON(SensorPostDTOJson)
if (!is.null(SensorPostDTOObject$`rdfType`)) {
self$`rdfType` <- SensorPostDTOObject$`rdfType`
}
if (!is.null(SensorPostDTOObject$`label`)) {
self$`label` <- SensorPostDTOObject$`label`
}
if (!is.null(SensorPostDTOObject$`brand`)) {
self$`brand` <- SensorPostDTOObject$`brand`
}
if (!is.null(SensorPostDTOObject$`model`)) {
self$`model` <- SensorPostDTOObject$`model`
}
if (!is.null(SensorPostDTOObject$`serialNumber`)) {
self$`serialNumber` <- SensorPostDTOObject$`serialNumber`
}
if (!is.null(SensorPostDTOObject$`inServiceDate`)) {
self$`inServiceDate` <- SensorPostDTOObject$`inServiceDate`
}
if (!is.null(SensorPostDTOObject$`dateOfPurchase`)) {
self$`dateOfPurchase` <- SensorPostDTOObject$`dateOfPurchase`
}
if (!is.null(SensorPostDTOObject$`dateOfLastCalibration`)) {
self$`dateOfLastCalibration` <- SensorPostDTOObject$`dateOfLastCalibration`
}
if (!is.null(SensorPostDTOObject$`personInCharge`)) {
self$`personInCharge` <- SensorPostDTOObject$`personInCharge`
}
},
fromJSONObject = function(SensorPostDTOObject) {
if (!is.null(SensorPostDTOObject$`rdfType`)) {
self$`rdfType` <- SensorPostDTOObject$`rdfType`
}
if (!is.null(SensorPostDTOObject$`label`)) {
self$`label` <- SensorPostDTOObject$`label`
}
if (!is.null(SensorPostDTOObject$`brand`)) {
self$`brand` <- SensorPostDTOObject$`brand`
}
if (!is.null(SensorPostDTOObject$`model`)) {
self$`model` <- SensorPostDTOObject$`model`
}
if (!is.null(SensorPostDTOObject$`serialNumber`)) {
self$`serialNumber` <- SensorPostDTOObject$`serialNumber`
}
if (!is.null(SensorPostDTOObject$`inServiceDate`)) {
self$`inServiceDate` <- SensorPostDTOObject$`inServiceDate`
}
if (!is.null(SensorPostDTOObject$`dateOfPurchase`)) {
self$`dateOfPurchase` <- SensorPostDTOObject$`dateOfPurchase`
}
if (!is.null(SensorPostDTOObject$`dateOfLastCalibration`)) {
self$`dateOfLastCalibration` <- SensorPostDTOObject$`dateOfLastCalibration`
}
if (!is.null(SensorPostDTOObject$`personInCharge`)) {
self$`personInCharge` <- SensorPostDTOObject$`personInCharge`
}
},
toJSONString = function() {
sprintf(
'{
"rdfType": %s,
"label": %s,
"brand": %s,
"model": %s,
"serialNumber": %s,
"inServiceDate": %s,
"dateOfPurchase": %s,
"dateOfLastCalibration": %s,
"personInCharge": %s
}',
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")
)
},
fromJSONString = function(SensorPostDTOJson) {
SensorPostDTOObject <- jsonlite::fromJSON(SensorPostDTOJson)
self$`rdfType` <- SensorPostDTOObject$`rdfType`
self$`label` <- SensorPostDTOObject$`label`
self$`brand` <- SensorPostDTOObject$`brand`
self$`model` <- SensorPostDTOObject$`model`
self$`serialNumber` <- SensorPostDTOObject$`serialNumber`
self$`inServiceDate` <- SensorPostDTOObject$`inServiceDate`
self$`dateOfPurchase` <- SensorPostDTOObject$`dateOfPurchase`
self$`dateOfLastCalibration` <- SensorPostDTOObject$`dateOfLastCalibration`
self$`personInCharge` <- SensorPostDTOObject$`personInCharge`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.