# FireCloud
#
# FireCloud API
#
# The version of the OpenAPI document: 0.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title SearchTermRef
#'
#' @description SearchTermRef Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field searchString character [optional]
#'
#' @field filters named list( \link{array[character]} ) [optional]
#'
#' @field researchPurpose \link{ResearchPurpose} [optional]
#'
#' @field fieldAggregations named list( integer ) [optional]
#'
#' @field from integer [optional]
#'
#' @field size integer [optional]
#'
#' @field sortField character [optional]
#'
#' @field sortDirection character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SearchTermRef <- R6::R6Class(
'SearchTermRef',
public = list(
`searchString` = NULL,
`filters` = NULL,
`researchPurpose` = NULL,
`fieldAggregations` = NULL,
`from` = NULL,
`size` = NULL,
`sortField` = NULL,
`sortDirection` = NULL,
initialize = function(
`searchString`=NULL, `filters`=NULL, `researchPurpose`=NULL, `fieldAggregations`=NULL, `from`=0, `size`=10, `sortField`=NULL, `sortDirection`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`searchString`)) {
stopifnot(is.character(`searchString`), length(`searchString`) == 1)
self$`searchString` <- `searchString`
}
if (!is.null(`filters`)) {
stopifnot(is.vector(`filters`), length(`filters`) != 0)
sapply(`filters`, function(x) stopifnot(R6::is.R6(x)))
self$`filters` <- `filters`
}
if (!is.null(`researchPurpose`)) {
stopifnot(R6::is.R6(`researchPurpose`))
self$`researchPurpose` <- `researchPurpose`
}
if (!is.null(`fieldAggregations`)) {
stopifnot(is.vector(`fieldAggregations`), length(`fieldAggregations`) != 0)
sapply(`fieldAggregations`, function(x) stopifnot(is.character(x)))
self$`fieldAggregations` <- `fieldAggregations`
}
if (!is.null(`from`)) {
stopifnot(is.numeric(`from`), length(`from`) == 1)
self$`from` <- `from`
}
if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size`
}
if (!is.null(`sortField`)) {
stopifnot(is.character(`sortField`), length(`sortField`) == 1)
self$`sortField` <- `sortField`
}
if (!is.null(`sortDirection`)) {
stopifnot(is.character(`sortDirection`), length(`sortDirection`) == 1)
self$`sortDirection` <- `sortDirection`
}
},
toJSON = function() {
SearchTermRefObject <- list()
if (!is.null(self$`searchString`)) {
SearchTermRefObject[['searchString']] <-
self$`searchString`
}
if (!is.null(self$`filters`)) {
SearchTermRefObject[['filters']] <-
lapply(self$`filters`, function(x) x$toJSON())
}
if (!is.null(self$`researchPurpose`)) {
SearchTermRefObject[['researchPurpose']] <-
self$`researchPurpose`$toJSON()
}
if (!is.null(self$`fieldAggregations`)) {
SearchTermRefObject[['fieldAggregations']] <-
self$`fieldAggregations`
}
if (!is.null(self$`from`)) {
SearchTermRefObject[['from']] <-
self$`from`
}
if (!is.null(self$`size`)) {
SearchTermRefObject[['size']] <-
self$`size`
}
if (!is.null(self$`sortField`)) {
SearchTermRefObject[['sortField']] <-
self$`sortField`
}
if (!is.null(self$`sortDirection`)) {
SearchTermRefObject[['sortDirection']] <-
self$`sortDirection`
}
SearchTermRefObject
},
fromJSON = function(SearchTermRefJson) {
SearchTermRefObject <- jsonlite::fromJSON(SearchTermRefJson)
if (!is.null(SearchTermRefObject$`searchString`)) {
self$`searchString` <- SearchTermRefObject$`searchString`
}
if (!is.null(SearchTermRefObject$`filters`)) {
self$`filters` <- ApiClient$new()$deserializeObj(SearchTermRefObject$`filters`, "map(array[character])", loadNamespace("openapi"))
}
if (!is.null(SearchTermRefObject$`researchPurpose`)) {
researchPurposeObject <- ResearchPurpose$new()
researchPurposeObject$fromJSON(jsonlite::toJSON(SearchTermRefObject$researchPurpose, auto_unbox = TRUE, digits = NA))
self$`researchPurpose` <- researchPurposeObject
}
if (!is.null(SearchTermRefObject$`fieldAggregations`)) {
self$`fieldAggregations` <- ApiClient$new()$deserializeObj(SearchTermRefObject$`fieldAggregations`, "map(integer)", loadNamespace("openapi"))
}
if (!is.null(SearchTermRefObject$`from`)) {
self$`from` <- SearchTermRefObject$`from`
}
if (!is.null(SearchTermRefObject$`size`)) {
self$`size` <- SearchTermRefObject$`size`
}
if (!is.null(SearchTermRefObject$`sortField`)) {
self$`sortField` <- SearchTermRefObject$`sortField`
}
if (!is.null(SearchTermRefObject$`sortDirection`)) {
self$`sortDirection` <- SearchTermRefObject$`sortDirection`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`searchString`)) {
sprintf(
'"searchString":
"%s"
',
self$`searchString`
)},
if (!is.null(self$`filters`)) {
sprintf(
'"filters":
%s
',
jsonlite::toJSON(lapply(self$`filters`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits=NA)
)},
if (!is.null(self$`researchPurpose`)) {
sprintf(
'"researchPurpose":
%s
',
jsonlite::toJSON(self$`researchPurpose`$toJSON(), auto_unbox=TRUE, digits = NA)
)},
if (!is.null(self$`fieldAggregations`)) {
sprintf(
'"fieldAggregations":
"%s"
',
jsonlite::toJSON(lapply(self$`fieldAggregations`, function(x){ x }), auto_unbox = TRUE, digits=NA)
)},
if (!is.null(self$`from`)) {
sprintf(
'"from":
%d
',
self$`from`
)},
if (!is.null(self$`size`)) {
sprintf(
'"size":
%d
',
self$`size`
)},
if (!is.null(self$`sortField`)) {
sprintf(
'"sortField":
"%s"
',
self$`sortField`
)},
if (!is.null(self$`sortDirection`)) {
sprintf(
'"sortDirection":
"%s"
',
self$`sortDirection`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(SearchTermRefJson) {
SearchTermRefObject <- jsonlite::fromJSON(SearchTermRefJson)
self$`searchString` <- SearchTermRefObject$`searchString`
self$`filters` <- ApiClient$new()$deserializeObj(SearchTermRefObject$`filters`, "map(array[character])", loadNamespace("openapi"))
self$`researchPurpose` <- ResearchPurpose$new()$fromJSON(jsonlite::toJSON(SearchTermRefObject$researchPurpose, auto_unbox = TRUE, digits = NA))
self$`fieldAggregations` <- ApiClient$new()$deserializeObj(SearchTermRefObject$`fieldAggregations`, "map(integer)", loadNamespace("openapi"))
self$`from` <- SearchTermRefObject$`from`
self$`size` <- SearchTermRefObject$`size`
self$`sortField` <- SearchTermRefObject$`sortField`
self$`sortDirection` <- SearchTermRefObject$`sortDirection`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.