R/QueryParameter.r

# REST API
#
# Rockset's REST API allows for creating and managing all resources in Rockset. Each supported endpoint is documented below.  All requests must be authorized with a Rockset API key, which can be created in the [Rockset console](https://console.rockset.com). The API key must be provided as `ApiKey <api_key>` in the `Authorization` request header. For example: ``` Authorization: ApiKey aB35kDjg93J5nsf4GjwMeErAVd832F7ad4vhsW1S02kfZiab42sTsfW5Sxt25asT ```  All endpoints are only accessible via https.  Build something awesome!
#
# OpenAPI spec version: v1
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


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

      QueryParameterObject
    },
    fromJSON = function(QueryParameterJson) {
      QueryParameterObject <- jsonlite::fromJSON(QueryParameterJson)
      if (!is.null(QueryParameterObject$`name`)) {
        self$`name` <- QueryParameterObject$`name`
      }
      if (!is.null(QueryParameterObject$`type`)) {
        self$`type` <- QueryParameterObject$`type`
      }
      if (!is.null(QueryParameterObject$`value`)) {
        self$`value` <- QueryParameterObject$`value`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "name": "%s",
           "type": "%s",
           "value": "%s"
        }',
        self$`name`,
        self$`type`,
        self$`value`
      )
    },
    fromJSONString = function(QueryParameterJson) {
      QueryParameterObject <- jsonlite::fromJSON(QueryParameterJson)
      self$`name` <- QueryParameterObject$`name`
      self$`type` <- QueryParameterObject$`type`
      self$`value` <- QueryParameterObject$`value`
    }
  )
)
rockset/RRockset documentation built on June 20, 2019, 2:51 p.m.