|
| 1 | +#' OpenAPI Petstore |
| 2 | +#' |
| 3 | +#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. |
| 4 | +#' |
| 5 | +#' The version of the OpenAPI document: 1.0.0 |
| 6 | +#' Generated by: https://openapi-generator.tech |
| 7 | +#' |
| 8 | + |
| 9 | +#' @docType class |
| 10 | +#' @title Special |
| 11 | +#' |
| 12 | +#' @description Special Class |
| 13 | +#' |
| 14 | +#' @format An \code{R6Class} generator object |
| 15 | +#' |
| 16 | +#' @field item_self integer [optional] |
| 17 | +#' |
| 18 | +#' @field item_private character [optional] |
| 19 | +#' |
| 20 | +#' @field item_super character [optional] |
| 21 | +#' |
| 22 | +#' @importFrom R6 R6Class |
| 23 | +#' @importFrom jsonlite fromJSON toJSON |
| 24 | +#' @export |
| 25 | +Special <- R6::R6Class( |
| 26 | + 'Special', |
| 27 | + public = list( |
| 28 | + `item_self` = NULL, |
| 29 | + `item_private` = NULL, |
| 30 | + `item_super` = NULL, |
| 31 | + initialize = function( |
| 32 | + `item_self`=NULL, `item_private`=NULL, `item_super`=NULL, ... |
| 33 | + ) { |
| 34 | + if (!is.null(`item_self`)) { |
| 35 | + stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) |
| 36 | + self$`item_self` <- `item_self` |
| 37 | + } |
| 38 | + if (!is.null(`item_private`)) { |
| 39 | + stopifnot(is.character(`item_private`), length(`item_private`) == 1) |
| 40 | + self$`item_private` <- `item_private` |
| 41 | + } |
| 42 | + if (!is.null(`item_super`)) { |
| 43 | + stopifnot(is.character(`item_super`), length(`item_super`) == 1) |
| 44 | + self$`item_super` <- `item_super` |
| 45 | + } |
| 46 | + }, |
| 47 | + toJSON = function() { |
| 48 | + SpecialObject <- list() |
| 49 | + if (!is.null(self$`item_self`)) { |
| 50 | + SpecialObject[['self']] <- |
| 51 | + self$`item_self` |
| 52 | + } |
| 53 | + if (!is.null(self$`item_private`)) { |
| 54 | + SpecialObject[['private']] <- |
| 55 | + self$`item_private` |
| 56 | + } |
| 57 | + if (!is.null(self$`item_super`)) { |
| 58 | + SpecialObject[['super']] <- |
| 59 | + self$`item_super` |
| 60 | + } |
| 61 | + |
| 62 | + SpecialObject |
| 63 | + }, |
| 64 | + fromJSON = function(SpecialJson) { |
| 65 | + SpecialObject <- jsonlite::fromJSON(SpecialJson) |
| 66 | + if (!is.null(SpecialObject$`item_self`)) { |
| 67 | + self$`item_self` <- SpecialObject$`item_self` |
| 68 | + } |
| 69 | + if (!is.null(SpecialObject$`item_private`)) { |
| 70 | + self$`item_private` <- SpecialObject$`item_private` |
| 71 | + } |
| 72 | + if (!is.null(SpecialObject$`item_super`)) { |
| 73 | + self$`item_super` <- SpecialObject$`item_super` |
| 74 | + } |
| 75 | + self |
| 76 | + }, |
| 77 | + toJSONString = function() { |
| 78 | + jsoncontent <- c( |
| 79 | + if (!is.null(self$`item_self`)) { |
| 80 | + sprintf( |
| 81 | + '"self": |
| 82 | + %d |
| 83 | + ', |
| 84 | + self$`item_self` |
| 85 | + )}, |
| 86 | + if (!is.null(self$`item_private`)) { |
| 87 | + sprintf( |
| 88 | + '"private": |
| 89 | + "%s" |
| 90 | + ', |
| 91 | + self$`item_private` |
| 92 | + )}, |
| 93 | + if (!is.null(self$`item_super`)) { |
| 94 | + sprintf( |
| 95 | + '"super": |
| 96 | + "%s" |
| 97 | + ', |
| 98 | + self$`item_super` |
| 99 | + )} |
| 100 | + ) |
| 101 | + jsoncontent <- paste(jsoncontent, collapse = ",") |
| 102 | + paste('{', jsoncontent, '}', sep = "") |
| 103 | + }, |
| 104 | + fromJSONString = function(SpecialJson) { |
| 105 | + SpecialObject <- jsonlite::fromJSON(SpecialJson) |
| 106 | + self$`item_self` <- SpecialObject$`item_self` |
| 107 | + self$`item_private` <- SpecialObject$`item_private` |
| 108 | + self$`item_super` <- SpecialObject$`item_super` |
| 109 | + self |
| 110 | + }, |
| 111 | + validateJSON = function(input) { |
| 112 | + input_json <- jsonlite::fromJSON(input) |
| 113 | + } |
| 114 | + |
| 115 | + ) |
| 116 | +) |
| 117 | + |
0 commit comments