R/entity_query_parameters.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title EntityQueryParameters
#'
#' @description EntityQueryParameters Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field page  integer 
#'
#' @field pageSize  integer 
#'
#' @field sortField  character 
#'
#' @field sortDirection  character 
#'
#' @field filterTerms  character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
EntityQueryParameters <- R6::R6Class(
  'EntityQueryParameters',
  public = list(
    `page` = NULL,
    `pageSize` = NULL,
    `sortField` = NULL,
    `sortDirection` = NULL,
    `filterTerms` = NULL,
    initialize = function(
        `page`, `pageSize`, `sortField`, `sortDirection`, `filterTerms`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`page`)) {
        stopifnot(is.numeric(`page`), length(`page`) == 1)
        self$`page` <- `page`
      }
      if (!missing(`pageSize`)) {
        stopifnot(is.numeric(`pageSize`), length(`pageSize`) == 1)
        self$`pageSize` <- `pageSize`
      }
      if (!missing(`sortField`)) {
        stopifnot(is.character(`sortField`), length(`sortField`) == 1)
        self$`sortField` <- `sortField`
      }
      if (!missing(`sortDirection`)) {
        stopifnot(is.character(`sortDirection`), length(`sortDirection`) == 1)
        self$`sortDirection` <- `sortDirection`
      }
      if (!is.null(`filterTerms`)) {
        stopifnot(is.character(`filterTerms`), length(`filterTerms`) == 1)
        self$`filterTerms` <- `filterTerms`
      }
    },
    toJSON = function() {
      EntityQueryParametersObject <- list()
      if (!is.null(self$`page`)) {
        EntityQueryParametersObject[['page']] <-
          self$`page`
      }
      if (!is.null(self$`pageSize`)) {
        EntityQueryParametersObject[['pageSize']] <-
          self$`pageSize`
      }
      if (!is.null(self$`sortField`)) {
        EntityQueryParametersObject[['sortField']] <-
          self$`sortField`
      }
      if (!is.null(self$`sortDirection`)) {
        EntityQueryParametersObject[['sortDirection']] <-
          self$`sortDirection`
      }
      if (!is.null(self$`filterTerms`)) {
        EntityQueryParametersObject[['filterTerms']] <-
          self$`filterTerms`
      }

      EntityQueryParametersObject
    },
    fromJSON = function(EntityQueryParametersJson) {
      EntityQueryParametersObject <- jsonlite::fromJSON(EntityQueryParametersJson)
      if (!is.null(EntityQueryParametersObject$`page`)) {
        self$`page` <- EntityQueryParametersObject$`page`
      }
      if (!is.null(EntityQueryParametersObject$`pageSize`)) {
        self$`pageSize` <- EntityQueryParametersObject$`pageSize`
      }
      if (!is.null(EntityQueryParametersObject$`sortField`)) {
        self$`sortField` <- EntityQueryParametersObject$`sortField`
      }
      if (!is.null(EntityQueryParametersObject$`sortDirection`)) {
        self$`sortDirection` <- EntityQueryParametersObject$`sortDirection`
      }
      if (!is.null(EntityQueryParametersObject$`filterTerms`)) {
        self$`filterTerms` <- EntityQueryParametersObject$`filterTerms`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`page`)) {
        sprintf(
        '"page":
          %d
                ',
        self$`page`
        )},
        if (!is.null(self$`pageSize`)) {
        sprintf(
        '"pageSize":
          %d
                ',
        self$`pageSize`
        )},
        if (!is.null(self$`sortField`)) {
        sprintf(
        '"sortField":
          "%s"
                ',
        self$`sortField`
        )},
        if (!is.null(self$`sortDirection`)) {
        sprintf(
        '"sortDirection":
          "%s"
                ',
        self$`sortDirection`
        )},
        if (!is.null(self$`filterTerms`)) {
        sprintf(
        '"filterTerms":
          "%s"
                ',
        self$`filterTerms`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(EntityQueryParametersJson) {
      EntityQueryParametersObject <- jsonlite::fromJSON(EntityQueryParametersJson)
      self$`page` <- EntityQueryParametersObject$`page`
      self$`pageSize` <- EntityQueryParametersObject$`pageSize`
      self$`sortField` <- EntityQueryParametersObject$`sortField`
      self$`sortDirection` <- EntityQueryParametersObject$`sortDirection`
      self$`filterTerms` <- EntityQueryParametersObject$`filterTerms`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.