[R] Update R6 object documentation (#19679)

* Remove @export and titles from R6 methods

* Remove redundant methods docs from R api.mustache

* Build project
This commit is contained in:
Luke Zappia 2024-09-26 07:56:22 +02:00 committed by GitHub
parent a6581e8e4c
commit 29c3b020e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
125 changed files with 1450 additions and 6122 deletions

View File

@ -17,8 +17,7 @@ ApiResponse <- R6::R6Class(
status_code = NULL,
status_code_desc = NULL,
headers = NULL,
#' Initialize a new ApiResponse class.
#'
#' @description
#' Initialize a new ApiResponse class.
#'
@ -27,7 +26,6 @@ ApiResponse <- R6::R6Class(
#' @param status_code The HTTP response status code.
#' @param status_code_desc The brief description of the HTTP response status code.
#' @param headers The HTTP response headers.
#' @export
initialize = function(content = NULL,
response = NULL,
status_code = NULL,
@ -40,15 +38,13 @@ ApiResponse <- R6::R6Class(
self$headers <- headers
},
#' Return the response as text
#'
#' @description
#' The response is stored as a raw vector. Use this to access the response after
#' converting it to text. If the response is not coercible to text NA is returned.
#'
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
if (is.null(self$response)) {
self$response <- charToRaw(jsonlite::toJSON("NULL"))

View File

@ -6,79 +6,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
{{! Adding the below changes for generating documentation for the api methods. }}
#' \describe{
{{#operation}}
#' \strong{ {{operationId}} } \emph{ {{#lambdaRdocEscape}}{{summary}}{{/lambdaRdocEscape}} }
{{#notes}}
#' {{#lambdaRdocEscape}}{{{.}}}{{/lambdaRdocEscape}}
{{/notes}}
#'
#' \itemize{
{{#allParams}}
{{#isEnum}}
#' \item \emph{ @param } {{paramName}} Enum < {{#allowableValues}}{{values}}{{/allowableValues}} >
{{/isEnum}}
{{^isEnum}}
{{#isContainer}}
{{#isArray}}
{{#items}}
{{#isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} list( {{dataType}} )
{{/isPrimitiveType}}
{{^isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} list( \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%> )
{{/isPrimitiveType}}
{{/items}}
{{/isArray}}
{{#isMap}}
{{#isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} named list( {{dataType}} )
{{/isPrimitiveType}}
{{^isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} named list( \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%> )
{{/isPrimitiveType}}
{{/isMap}}
{{/isContainer}}
{{^isContainer}}
{{#isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} {{dataType}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
#' \item \emph{ @param } {{paramName}} \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%>
{{/isPrimitiveType}}
{{/isContainer}}
{{/isEnum}}
{{/allParams}}
{{#returnType}}
{{^returnTypeIsPrimitive}}
#' \item \emph{ @returnType } {{#returnContainer}}{{#isArray}}list( {{/isArray}}{{#isMap}}named list( {{/isMap}}{{/returnContainer}}\link{{=<% %>=}}{<%#returnContainer%><%={{ }}=%>{{returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{returnType}}{{=<% %>=}}<%/returnContainer%>}<%={{ }}=%>{{#returnContainer}}{{#isArray}} ){{/isArray}}{{#isMap}} ){{/isMap}}{{/returnContainer}} \cr
{{/returnTypeIsPrimitive}}
{{/returnType}}
#'
{{#useRlangExceptionHandling}}
#' \item On encountering errors, an error of subclass ApiException will be thrown.
{{/useRlangExceptionHandling}}
#'
{{#responses}}
#' \item status code : {{code}} | {{{message}}}
#'
#'{{#dataType}} \item return type : {{{.}}}{{/dataType}}
#' \item response headers :
#'
#' \tabular{ll}{
{{#headers}}
#' {{name}} \tab {{{description}}} \cr
{{/headers}}
#' }
{{/responses}}
#' }
#'
{{/operation}}
#' }
#'
#'
#' @examples
#' \dontrun{
{{#operation}}
@ -185,13 +112,11 @@
"{{classname}}",
public = list(
api_client = NULL,
#' Initialize a new {{{classname}}}.
#'
#' @description
#' Initialize a new {{{classname}}}.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -200,8 +125,7 @@
}
},
{{#operation}}
#' {{{summary}}}
#'
#' @description
#' {{{description}}}{{^description}}{{{summary}}}{{/description}}
#'
@ -218,8 +142,8 @@
#' @param data_file (optional) name of the data file to save the result
{{/returnType}}
#' @param ... Other optional arguments
#'
#' @return {{{returnType}}}{{^returnType}}void{{/returnType}}
#' @export
{{{operationId}}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) {
local_var_response <- self${{{operationId}}}{{WithHttpInfo}}({{#allParams}}{{paramName}}, {{/allParams}}{{#vendorExtensions.x-streaming}}stream_callback = stream_callback, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = data_file, {{/returnType}}...)
{{#vendorExtensions.x-streaming}}
@ -238,8 +162,7 @@
local_var_response
}
},
#' {{{summary}}}
#'
#' @description
#' {{{description}}}{{^description}}{{{summary}}}{{/description}}
#'
@ -256,8 +179,8 @@
#' @param data_file (optional) name of the data file to save the result
{{/returnType}}
#' @param ... Other optional arguments
#'
#' @return API response ({{{returnType}}}{{^returnType}}void{{/returnType}}) with additional information such as HTTP status code, headers
#' @export
{{{operationId}}}{{WithHttpInfo}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) {
args <- list(...)
query_params <- list()

View File

@ -158,8 +158,7 @@ ApiClient <- R6::R6Class(
self$max_retry_attempts <- max_retry_attempts
}
},
#' Prepare to make an API call with the retry logic.
#'
#' @description
#' Prepare to make an API call with the retry logic.
#'
@ -174,8 +173,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process the data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
CallApi = function(url, method, query_params, header_params, form_params,
file_params, accepts, content_types,
body, stream_callback = NULL, ...) {
@ -205,8 +204,7 @@ ApiClient <- R6::R6Class(
resp
},
#' Make an API call
#'
#' @description
#' Make an API call
#'
@ -221,8 +219,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
Execute = function(url, method, query_params, header_params,
form_params, file_params,
accepts, content_types,
@ -316,7 +314,7 @@ ApiClient <- R6::R6Class(
# return ApiResponse
api_response <- ApiResponse$new()
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code_desc <- httr::http_status(httr_response)$reason
api_response$response <- httr::content(httr_response, "raw")
api_response$headers <- httr::headers(httr_response)
@ -324,32 +322,31 @@ ApiClient <- R6::R6Class(
api_response
}
},
#' Deserialize the content of API response to the given type.
#'
#' @description
#' Deserialize the content of API response to the given type.
#'
#' @param raw_response Raw response.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserialize = function(raw_response, return_type, pkg_env) {
resp_obj <- jsonlite::fromJSON(raw_response)
self$deserializeObj(resp_obj, return_type, pkg_env)
},
#' Deserialize the response from jsonlite object based on the given type
#'
#' @description
#' Deserialize the response from jsonlite object based on the given type
#' by handling complex and nested types by iterating recursively
#' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.,
#' Example return_types will be like "array[integer]", "map(Pet)",
#' "array[map(Tag)]", etc.,
#'
#' @param obj Response object.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserializeObj = function(obj, return_type, pkg_env) {
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
@ -411,15 +408,14 @@ ApiClient <- R6::R6Class(
}
return_obj
},
#' Return a property header (for accept or content-type).
#'
#' @description
#' Return a property header (for accept or content-type). If JSON-related MIME is found,
#' return it. Otherwise, return the first one, if any.
#'
#' @param headers A list of headers
#'
#' @return A header (e.g. 'application/json')
#' @export
select_header = function(headers) {
if (length(headers) == 0) {
return(invisible(NULL))

View File

@ -22,15 +22,13 @@ ApiException <- R6::R6Class(
{{#errorObjectType}}
error_object = NULL,
{{/errorObjectType}}
#' Initialize a new ApiException class.
#'
#' @description
#' Initialize a new ApiExceptino class.
#' Initialize a new ApiException class.
#'
#' @param status HTTP status.
#' @param reason Reason of the ApiException.
#' @param http_response HTTP response object.
#' @export
initialize = function(status = NULL, reason = NULL, http_response = NULL) {
if (!is.null(http_response)) {
self$status <- http_response$status_code
@ -54,13 +52,11 @@ ApiException <- R6::R6Class(
{{/errorObjectType}}
}
},
#' Returns the string format of ApiException.
#'
#' @description
#' Returns the string format of ApiException.
#'
#' @return the string format of ApiException.
#' @export
toString = function() {
errorMsg <- ""
errorMsg <- paste("status : ", self$status, "\n", sep = "")

View File

@ -17,13 +17,11 @@
actual_type = NULL,
#' @field any_of a list of object types defined in the anyOf schema.
any_of = list({{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}}),
#' Initialize a new {{{classname}}}.
#'
#' @description
#' Initialize a new {{{classname}}}.
#'
#' @param instance an instance of the object defined in the anyOf schemas: {{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}}
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -35,26 +33,24 @@
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}.
#' An alias to the method `fromJSON`.
#'
#' @param input The input JSON.
#'
#' @return An instance of {{{classname}}}.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @param input The input JSON.
#'
#' @return An instance of {{{classname}}}.
#' @export
fromJSON = function(input) {
error_messages <- list()
@ -88,13 +84,11 @@
stop(paste("No match found when deserializing the input into {{{classname}}} with anyOf schemas {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: >>",
paste(error_messages, collapse = " >> ")))
},
#' Serialize {{{classname}}} to JSON string.
#'
#' @description
#' Serialize {{{classname}}} to JSON string.
#'
#' @return JSON string representation of the {{{classname}}}.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify((self$actual_instance$toJSONString())))
@ -102,13 +96,11 @@
NULL
}
},
#' Serialize {{{classname}}} to JSON.
#'
#' @description
#' Serialize {{{classname}}} to JSON.
#'
#' @return JSON representation of the {{{classname}}}.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -116,14 +108,12 @@
NULL
}
},
#' Validate the input JSON with respect to {{{classname}}}.
#'
#' @description
#' Validate the input JSON with respect to {{{classname}}} and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -136,13 +126,11 @@
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -152,12 +140,9 @@
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -9,13 +9,11 @@
{{classname}} <- R6::R6Class(
"{{classname}}",
public = list(
#' Initialize a new {{{classname}}} class.
#'
#' @description
#' Initialize a new {{{classname}}} class.
#'
#' @param ... Optional arguments.
#' @export
initialize = function(...) {
local.optional.var <- list(...)
val <- unlist(local.optional.var)
@ -38,48 +36,42 @@
}
private$value <- val
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return {{{classname}}} in JSON format
#' @export
toJSON = function() {
jsonlite::toJSON(private$value, auto_unbox = TRUE)
},
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @param input_json the JSON input
#'
#' @return the instance of {{{classname}}}
#' @export
fromJSON = function(input_json) {
private$value <- jsonlite::fromJSON(input_json,
simplifyVector = FALSE)
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return {{{classname}}} in JSON format
#' @export
toJSONString = function() {
as.character(jsonlite::toJSON(private$value,
auto_unbox = TRUE))
},
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @param input_json the JSON input
#'
#' @return the instance of {{{classname}}}
#' @export
fromJSONString = function(input_json) {
private$value <- jsonlite::fromJSON(input_json,
simplifyVector = FALSE)

View File

@ -34,8 +34,7 @@
`_discriminator_property_name` = '{{discriminator.propertyName}}',
{{#discriminator.mappedModels}}{{#-first}}`_discriminator_mapping_name` = c({{/-first}}'{{mappingName}}' = '{{modelName}}'{{^-last}}, {{/-last}}{{#-last}}),{{/-last}}{{/discriminator.mappedModels}}
{{/discriminator}}
#' Initialize a new {{{classname}}} class.
#'
#' @description
#' Initialize a new {{{classname}}} class.
#'
@ -49,7 +48,6 @@
#' @param additional_properties additional properties (optional)
{{/isAdditionalPropertiesTrue}}
#' @param ... Other optional arguments.
#' @export
initialize = function({{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...) {
{{#requiredVars}}
if (!missing(`{{name}}`)) {
@ -203,13 +201,11 @@
}
{{/isAdditionalPropertiesTrue}}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return {{{classname}}} in JSON format
#' @export
toJSON = function() {
{{classname}}Object <- list()
{{#vars}}
@ -251,14 +247,12 @@
{{/isAdditionalPropertiesTrue}}
{{classname}}Object
},
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @param input_json the JSON input
#' @return the instance of {{{classname}}}
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
{{#vars}}
@ -307,13 +301,11 @@
{{/isAdditionalPropertiesTrue}}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return {{{classname}}} in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
{{#vars}}
@ -383,14 +375,12 @@
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
{{/isAdditionalPropertiesTrue}}
},
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}
#'
#' @param input_json the JSON input
#' @return the instance of {{{classname}}}
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
{{#vars}}
@ -436,13 +426,11 @@
{{/isAdditionalPropertiesTrue}}
self
},
#' Validate JSON input with respect to {{classname}}
#'
#' @description
#' Validate JSON input with respect to {{classname}} and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
{{#requiredVars}}
@ -515,23 +503,19 @@
}
{{/requiredVars}}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of {{{classname}}}
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
{{#allVars}}
{{^isNullable}}
@ -590,13 +574,11 @@
{{/allVars}}
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
{{#allVars}}
@ -656,12 +638,9 @@
{{/allVars}}
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list({{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}),
#' Initialize a new {{{classname}}}.
#'
#' @description
#' Initialize a new {{{classname}}}.
#'
#' @param instance an instance of the object defined in the oneOf schemas: {{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -35,26 +33,24 @@
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of {{{classname}}}.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @description
#' Deserialize JSON string into an instance of {{{classname}}}.
#'
#' @param input The input JSON.
#'
#' @return An instance of {{{classname}}}.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -140,13 +136,11 @@
self
},
#' Serialize {{{classname}}} to JSON string.
#'
#' @description
#' Serialize {{{classname}}} to JSON string.
#'
#' @return JSON string representation of the {{{classname}}}.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -154,13 +148,11 @@
NULL
}
},
#' Serialize {{{classname}}} to JSON.
#'
#' @description
#' Serialize {{{classname}}} to JSON.
#'
#' @return JSON representation of the {{{classname}}}.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -168,14 +160,12 @@
NULL
}
},
#' Validate the input JSON with respect to {{{classname}}}.
#'
#' @description
#' Validate the input JSON with respect to {{{classname}}} and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -188,13 +178,11 @@
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -204,12 +192,9 @@
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -125,8 +125,7 @@ ApiClient <- R6::R6Class(
self$max_retry_attempts <- max_retry_attempts
}
},
#' Prepare to make an API call with the retry logic.
#'
#' @description
#' Prepare to make an API call with the retry logic.
#'
@ -141,8 +140,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process the data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
CallApi = function(url, method, query_params, header_params, form_params,
file_params, accepts, content_types,
body, stream_callback = NULL, ...) {
@ -172,8 +171,7 @@ ApiClient <- R6::R6Class(
resp
},
#' Make an API call
#'
#' @description
#' Make an API call
#'
@ -188,8 +186,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
Execute = function(url, method, query_params, header_params,
form_params, file_params,
accepts, content_types,
@ -268,7 +266,7 @@ ApiClient <- R6::R6Class(
# return ApiResponse
api_response <- ApiResponse$new()
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code_desc <- httr::http_status(httr_response)$reason
api_response$response <- httr::content(httr_response, "raw")
api_response$headers <- httr::headers(httr_response)
@ -276,32 +274,31 @@ ApiClient <- R6::R6Class(
api_response
}
},
#' Deserialize the content of API response to the given type.
#'
#' @description
#' Deserialize the content of API response to the given type.
#'
#' @param raw_response Raw response.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserialize = function(raw_response, return_type, pkg_env) {
resp_obj <- jsonlite::fromJSON(raw_response)
self$deserializeObj(resp_obj, return_type, pkg_env)
},
#' Deserialize the response from jsonlite object based on the given type
#'
#' @description
#' Deserialize the response from jsonlite object based on the given type
#' by handling complex and nested types by iterating recursively
#' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.,
#' Example return_types will be like "array[integer]", "map(Pet)",
#' "array[map(Tag)]", etc.,
#'
#' @param obj Response object.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserializeObj = function(obj, return_type, pkg_env) {
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
@ -363,15 +360,14 @@ ApiClient <- R6::R6Class(
}
return_obj
},
#' Return a property header (for accept or content-type).
#'
#' @description
#' Return a property header (for accept or content-type). If JSON-related MIME is found,
#' return it. Otherwise, return the first one, if any.
#'
#' @param headers A list of headers
#'
#' @return A header (e.g. 'application/json')
#' @export
select_header = function(headers) {
if (length(headers) == 0) {
return(invisible(NULL))

View File

@ -24,8 +24,7 @@ ApiResponse <- R6::R6Class(
status_code = NULL,
status_code_desc = NULL,
headers = NULL,
#' Initialize a new ApiResponse class.
#'
#' @description
#' Initialize a new ApiResponse class.
#'
@ -34,7 +33,6 @@ ApiResponse <- R6::R6Class(
#' @param status_code The HTTP response status code.
#' @param status_code_desc The brief description of the HTTP response status code.
#' @param headers The HTTP response headers.
#' @export
initialize = function(content = NULL,
response = NULL,
status_code = NULL,
@ -47,15 +45,13 @@ ApiResponse <- R6::R6Class(
self$headers <- headers
},
#' Return the response as text
#'
#' @description
#' The response is stored as a raw vector. Use this to access the response after
#' converting it to text. If the response is not coercible to text NA is returned.
#'
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
if (is.null(self$response)) {
self$response <- charToRaw(jsonlite::toJSON("NULL"))

View File

@ -12,41 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestAuthHttpBasic } \emph{ To test HTTP basic authentication }
#' To test HTTP basic authentication
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestAuthHttpBearer } \emph{ To test HTTP bearer authentication }
#' To test HTTP bearer authentication
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestAuthHttpBasic ####################
@ -90,13 +55,11 @@ AuthApi <- R6::R6Class(
"AuthApi",
public = list(
api_client = NULL,
#' Initialize a new AuthApi.
#'
#' @description
#' Initialize a new AuthApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -104,15 +67,14 @@ AuthApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' To test HTTP basic authentication
#'
#' @description
#' To test HTTP basic authentication
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestAuthHttpBasic = function(data_file = NULL, ...) {
local_var_response <- self$TestAuthHttpBasicWithHttpInfo(data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -125,15 +87,14 @@ AuthApi <- R6::R6Class(
local_var_response
}
},
#' To test HTTP basic authentication
#'
#' @description
#' To test HTTP basic authentication
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestAuthHttpBasicWithHttpInfo = function(data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -194,15 +155,14 @@ AuthApi <- R6::R6Class(
local_var_resp
}
},
#' To test HTTP bearer authentication
#'
#' @description
#' To test HTTP bearer authentication
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestAuthHttpBearer = function(data_file = NULL, ...) {
local_var_response <- self$TestAuthHttpBearerWithHttpInfo(data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -215,15 +175,14 @@ AuthApi <- R6::R6Class(
local_var_response
}
},
#' To test HTTP bearer authentication
#'
#' @description
#' To test HTTP bearer authentication
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestAuthHttpBearerWithHttpInfo = function(data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -17,15 +17,13 @@ Bird <- R6::R6Class(
public = list(
`size` = NULL,
`color` = NULL,
#' Initialize a new Bird class.
#'
#' @description
#' Initialize a new Bird class.
#'
#' @param size size
#' @param color color
#' @param ... Other optional arguments.
#' @export
initialize = function(`size` = NULL, `color` = NULL, ...) {
if (!is.null(`size`)) {
if (!(is.character(`size`) && length(`size`) == 1)) {
@ -40,13 +38,11 @@ Bird <- R6::R6Class(
self$`color` <- `color`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Bird in JSON format
#' @export
toJSON = function() {
BirdObject <- list()
if (!is.null(self$`size`)) {
@ -59,14 +55,12 @@ Bird <- R6::R6Class(
}
BirdObject
},
#' Deserialize JSON string into an instance of Bird
#'
#' @description
#' Deserialize JSON string into an instance of Bird
#'
#' @param input_json the JSON input
#' @return the instance of Bird
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`size`)) {
@ -77,13 +71,11 @@ Bird <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Bird in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`size`)) {
@ -106,67 +98,54 @@ Bird <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Bird
#'
#' @description
#' Deserialize JSON string into an instance of Bird
#'
#' @param input_json the JSON input
#' @return the instance of Bird
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`size` <- this_object$`size`
self$`color` <- this_object$`color`
self
},
#' Validate JSON input with respect to Bird
#'
#' @description
#' Validate JSON input with respect to Bird and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Bird
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -12,173 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestBinaryGif } \emph{ Test binary (gif) response body }
#' Test binary (gif) response body
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : data.frame
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestBodyApplicationOctetstreamBinary } \emph{ Test body parameter(s) }
#' Test body parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } body data.frame
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestBodyMultipartFormdataArrayOfBinary } \emph{ Test array of binary in multipart mime }
#' Test array of binary in multipart mime
#'
#' \itemize{
#' \item \emph{ @param } files list( data.frame )
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestBodyMultipartFormdataSingleBinary } \emph{ Test single binary in multipart mime }
#' Test single binary in multipart mime
#'
#' \itemize{
#' \item \emph{ @param } my_file data.frame
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyAllOfPet } \emph{ Test body parameter(s) }
#' Test body parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyFreeFormObjectResponseString } \emph{ Test free form object }
#' Test free form object
#'
#' \itemize{
#' \item \emph{ @param } body object
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyPet } \emph{ Test body parameter(s) }
#' Test body parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyPetResponseString } \emph{ Test empty response body }
#' Test empty response body
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyStringEnum } \emph{ Test string enum response body }
#' Test string enum response body
#'
#' \itemize{
#' \item \emph{ @param } body character
#' \item \emph{ @returnType } \link{StringEnumRef} \cr
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : StringEnumRef
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestEchoBodyTagResponseString } \emph{ Test empty json (request body) }
#' Test empty json (request body)
#'
#' \itemize{
#' \item \emph{ @param } tag \link{Tag}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestBinaryGif ####################
@ -328,13 +161,11 @@ BodyApi <- R6::R6Class(
"BodyApi",
public = list(
api_client = NULL,
#' Initialize a new BodyApi.
#'
#' @description
#' Initialize a new BodyApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -342,15 +173,14 @@ BodyApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Test binary (gif) response body
#'
#' @description
#' Test binary (gif) response body
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return data.frame
#' @export
TestBinaryGif = function(data_file = NULL, ...) {
local_var_response <- self$TestBinaryGifWithHttpInfo(data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -363,15 +193,14 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test binary (gif) response body
#'
#' @description
#' Test binary (gif) response body
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (data.frame) with additional information such as HTTP status code, headers
#' @export
TestBinaryGifWithHttpInfo = function(data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -428,16 +257,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param body (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestBodyApplicationOctetstreamBinary = function(body = NULL, data_file = NULL, ...) {
local_var_response <- self$TestBodyApplicationOctetstreamBinaryWithHttpInfo(body, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -450,16 +278,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param body (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestBodyApplicationOctetstreamBinaryWithHttpInfo = function(body = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -523,16 +350,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test array of binary in multipart mime
#'
#' @description
#' Test array of binary in multipart mime
#'
#' @param files
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestBodyMultipartFormdataArrayOfBinary = function(files, data_file = NULL, ...) {
local_var_response <- self$TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -545,16 +371,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test array of binary in multipart mime
#'
#' @description
#' Test array of binary in multipart mime
#'
#' @param files
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo = function(files, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -617,16 +442,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test single binary in multipart mime
#'
#' @description
#' Test single binary in multipart mime
#'
#' @param my_file (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestBodyMultipartFormdataSingleBinary = function(my_file = NULL, data_file = NULL, ...) {
local_var_response <- self$TestBodyMultipartFormdataSingleBinaryWithHttpInfo(my_file, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -639,16 +463,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test single binary in multipart mime
#'
#' @description
#' Test single binary in multipart mime
#'
#' @param my_file (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestBodyMultipartFormdataSingleBinaryWithHttpInfo = function(my_file = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -707,16 +530,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
TestEchoBodyAllOfPet = function(pet = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyAllOfPetWithHttpInfo(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -729,16 +551,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyAllOfPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -802,16 +623,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test free form object
#'
#' @description
#' Test free form object
#'
#' @param body (optional) Free form object
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestEchoBodyFreeFormObjectResponseString = function(body = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyFreeFormObjectResponseStringWithHttpInfo(body, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -824,16 +644,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test free form object
#'
#' @description
#' Test free form object
#'
#' @param body (optional) Free form object
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyFreeFormObjectResponseStringWithHttpInfo = function(body = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -897,16 +716,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
TestEchoBodyPet = function(pet = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyPetWithHttpInfo(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -919,16 +737,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test body parameter(s)
#'
#' @description
#' Test body parameter(s)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -992,16 +809,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test empty response body
#'
#' @description
#' Test empty response body
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestEchoBodyPetResponseString = function(pet = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyPetResponseStringWithHttpInfo(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1014,16 +830,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test empty response body
#'
#' @description
#' Test empty response body
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyPetResponseStringWithHttpInfo = function(pet = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1087,16 +902,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test string enum response body
#'
#' @description
#' Test string enum response body
#'
#' @param body (optional) String enum
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return StringEnumRef
#' @export
TestEchoBodyStringEnum = function(body = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyStringEnumWithHttpInfo(body, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1109,16 +923,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test string enum response body
#'
#' @description
#' Test string enum response body
#'
#' @param body (optional) String enum
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (StringEnumRef) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyStringEnumWithHttpInfo = function(body = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1182,16 +995,15 @@ BodyApi <- R6::R6Class(
local_var_resp
}
},
#' Test empty json (request body)
#'
#' @description
#' Test empty json (request body)
#'
#' @param tag (optional) Tag object
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestEchoBodyTagResponseString = function(tag = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEchoBodyTagResponseStringWithHttpInfo(tag, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1204,16 +1016,15 @@ BodyApi <- R6::R6Class(
local_var_response
}
},
#' Test empty json (request body)
#'
#' @description
#' Test empty json (request body)
#'
#' @param tag (optional) Tag object
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestEchoBodyTagResponseStringWithHttpInfo = function(tag = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -17,15 +17,13 @@ Category <- R6::R6Class(
public = list(
`id` = NULL,
`name` = NULL,
#' Initialize a new Category class.
#'
#' @description
#' Initialize a new Category class.
#'
#' @param id id
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -40,13 +38,11 @@ Category <- R6::R6Class(
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSON = function() {
CategoryObject <- list()
if (!is.null(self$`id`)) {
@ -59,14 +55,12 @@ Category <- R6::R6Class(
}
CategoryObject
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -77,13 +71,11 @@ Category <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -106,67 +98,54 @@ Category <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to Category
#'
#' @description
#' Validate JSON input with respect to Category and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Category
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -24,8 +24,7 @@ DataQuery <- R6::R6Class(
`suffix` = NULL,
`text` = NULL,
`date` = NULL,
#' Initialize a new DataQuery class.
#'
#' @description
#' Initialize a new DataQuery class.
#'
@ -35,7 +34,6 @@ DataQuery <- R6::R6Class(
#' @param text Some text containing white spaces
#' @param date A date
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `outcomes` = [SUCCESS, FAILURE], `suffix` = NULL, `text` = NULL, `date` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -67,13 +65,11 @@ DataQuery <- R6::R6Class(
self$`date` <- `date`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DataQuery in JSON format
#' @export
toJSON = function() {
DataQueryObject <- list()
if (!is.null(self$`id`)) {
@ -98,14 +94,12 @@ DataQuery <- R6::R6Class(
}
DataQueryObject
},
#' Deserialize JSON string into an instance of DataQuery
#'
#' @description
#' Deserialize JSON string into an instance of DataQuery
#'
#' @param input_json the JSON input
#' @return the instance of DataQuery
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -125,13 +119,11 @@ DataQuery <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DataQuery in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -178,14 +170,12 @@ DataQuery <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of DataQuery
#'
#' @description
#' Deserialize JSON string into an instance of DataQuery
#'
#' @param input_json the JSON input
#' @return the instance of DataQuery
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -195,53 +185,42 @@ DataQuery <- R6::R6Class(
self$`date` <- this_object$`date`
self
},
#' Validate JSON input with respect to DataQuery
#'
#' @description
#' Validate JSON input with respect to DataQuery and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DataQuery
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -29,8 +29,7 @@ DefaultValue <- R6::R6Class(
`array_string_nullable` = NULL,
`array_string_extension_nullable` = NULL,
`string_nullable` = NULL,
#' Initialize a new DefaultValue class.
#'
#' @description
#' Initialize a new DefaultValue class.
#'
@ -43,7 +42,6 @@ DefaultValue <- R6::R6Class(
#' @param array_string_extension_nullable array_string_extension_nullable
#' @param string_nullable string_nullable
#' @param ... Other optional arguments.
#' @export
initialize = function(`array_string_enum_ref_default` = ["success","failure"], `array_string_enum_default` = ["success","failure"], `array_string_default` = ["failure","skipped"], `array_integer_default` = [1,3], `array_string` = NULL, `array_string_nullable` = NULL, `array_string_extension_nullable` = NULL, `string_nullable` = NULL, ...) {
if (!is.null(`array_string_enum_ref_default`)) {
stopifnot(is.vector(`array_string_enum_ref_default`), length(`array_string_enum_ref_default`) != 0)
@ -87,13 +85,11 @@ DefaultValue <- R6::R6Class(
self$`string_nullable` <- `string_nullable`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DefaultValue in JSON format
#' @export
toJSON = function() {
DefaultValueObject <- list()
if (!is.null(self$`array_string_enum_ref_default`)) {
@ -130,14 +126,12 @@ DefaultValue <- R6::R6Class(
}
DefaultValueObject
},
#' Deserialize JSON string into an instance of DefaultValue
#'
#' @description
#' Deserialize JSON string into an instance of DefaultValue
#'
#' @param input_json the JSON input
#' @return the instance of DefaultValue
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`array_string_enum_ref_default`)) {
@ -166,13 +160,11 @@ DefaultValue <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DefaultValue in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`array_string_enum_ref_default`)) {
@ -243,14 +235,12 @@ DefaultValue <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of DefaultValue
#'
#' @description
#' Deserialize JSON string into an instance of DefaultValue
#'
#' @param input_json the JSON input
#' @return the instance of DefaultValue
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`array_string_enum_ref_default` <- ApiClient$new()$deserializeObj(this_object$`array_string_enum_ref_default`, "array[StringEnumRef]", loadNamespace("openapi"))
@ -263,53 +253,42 @@ DefaultValue <- R6::R6Class(
self$`string_nullable` <- this_object$`string_nullable`
self
},
#' Validate JSON input with respect to DefaultValue
#'
#' @description
#' Validate JSON input with respect to DefaultValue and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DefaultValue
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -12,66 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestFormIntegerBooleanString } \emph{ Test form parameter(s) }
#' Test form parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } integer_form integer
#' \item \emph{ @param } boolean_form character
#' \item \emph{ @param } string_form character
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestFormObjectMultipart } \emph{ Test form parameter(s) for multipart schema }
#' Test form parameter(s) for multipart schema
#'
#' \itemize{
#' \item \emph{ @param } marker \link{TestFormObjectMultipartRequestMarker}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestFormOneof } \emph{ Test form parameter(s) for oneOf schema }
#' Test form parameter(s) for oneOf schema
#'
#' \itemize{
#' \item \emph{ @param } form1 character
#' \item \emph{ @param } form2 integer
#' \item \emph{ @param } form3 character
#' \item \emph{ @param } form4 character
#' \item \emph{ @param } id integer
#' \item \emph{ @param } name character
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestFormIntegerBooleanString ####################
@ -131,13 +71,11 @@ FormApi <- R6::R6Class(
"FormApi",
public = list(
api_client = NULL,
#' Initialize a new FormApi.
#'
#' @description
#' Initialize a new FormApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -145,8 +83,7 @@ FormApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Test form parameter(s)
#'
#' @description
#' Test form parameter(s)
#'
@ -155,8 +92,8 @@ FormApi <- R6::R6Class(
#' @param string_form (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestFormIntegerBooleanString = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ...) {
local_var_response <- self$TestFormIntegerBooleanStringWithHttpInfo(integer_form, boolean_form, string_form, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -169,8 +106,7 @@ FormApi <- R6::R6Class(
local_var_response
}
},
#' Test form parameter(s)
#'
#' @description
#' Test form parameter(s)
#'
@ -179,8 +115,8 @@ FormApi <- R6::R6Class(
#' @param string_form (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestFormIntegerBooleanStringWithHttpInfo = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -243,16 +179,15 @@ FormApi <- R6::R6Class(
local_var_resp
}
},
#' Test form parameter(s) for multipart schema
#'
#' @description
#' Test form parameter(s) for multipart schema
#'
#' @param marker
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestFormObjectMultipart = function(marker, data_file = NULL, ...) {
local_var_response <- self$TestFormObjectMultipartWithHttpInfo(marker, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -265,16 +200,15 @@ FormApi <- R6::R6Class(
local_var_response
}
},
#' Test form parameter(s) for multipart schema
#'
#' @description
#' Test form parameter(s) for multipart schema
#'
#' @param marker
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestFormObjectMultipartWithHttpInfo = function(marker, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -337,8 +271,7 @@ FormApi <- R6::R6Class(
local_var_resp
}
},
#' Test form parameter(s) for oneOf schema
#'
#' @description
#' Test form parameter(s) for oneOf schema
#'
@ -350,8 +283,8 @@ FormApi <- R6::R6Class(
#' @param name (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestFormOneof = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ...) {
local_var_response <- self$TestFormOneofWithHttpInfo(form1, form2, form3, form4, id, name, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -364,8 +297,7 @@ FormApi <- R6::R6Class(
local_var_response
}
},
#' Test form parameter(s) for oneOf schema
#'
#' @description
#' Test form parameter(s) for oneOf schema
#'
@ -377,8 +309,8 @@ FormApi <- R6::R6Class(
#' @param name (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestFormOneofWithHttpInfo = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -12,31 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestHeaderIntegerBooleanStringEnums } \emph{ Test header parameter(s) }
#' Test header parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } integer_header integer
#' \item \emph{ @param } boolean_header character
#' \item \emph{ @param } string_header character
#' \item \emph{ @param } enum_nonref_string_header Enum < [success, failure, unclassified] >
#' \item \emph{ @param } enum_ref_string_header \link{StringEnumRef}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestHeaderIntegerBooleanStringEnums ####################
@ -65,13 +40,11 @@ HeaderApi <- R6::R6Class(
"HeaderApi",
public = list(
api_client = NULL,
#' Initialize a new HeaderApi.
#'
#' @description
#' Initialize a new HeaderApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -79,8 +52,7 @@ HeaderApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Test header parameter(s)
#'
#' @description
#' Test header parameter(s)
#'
@ -91,8 +63,8 @@ HeaderApi <- R6::R6Class(
#' @param enum_ref_string_header (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestHeaderIntegerBooleanStringEnums = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ...) {
local_var_response <- self$TestHeaderIntegerBooleanStringEnumsWithHttpInfo(integer_header, boolean_header, string_header, enum_nonref_string_header, enum_ref_string_header, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -105,8 +77,7 @@ HeaderApi <- R6::R6Class(
local_var_response
}
},
#' Test header parameter(s)
#'
#' @description
#' Test header parameter(s)
#'
@ -117,8 +88,8 @@ HeaderApi <- R6::R6Class(
#' @param enum_ref_string_header (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestHeaderIntegerBooleanStringEnumsWithHttpInfo = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -19,8 +19,7 @@ NumberPropertiesOnly <- R6::R6Class(
`number` = NULL,
`float` = NULL,
`double` = NULL,
#' Initialize a new NumberPropertiesOnly class.
#'
#' @description
#' Initialize a new NumberPropertiesOnly class.
#'
@ -28,7 +27,6 @@ NumberPropertiesOnly <- R6::R6Class(
#' @param float float
#' @param double double
#' @param ... Other optional arguments.
#' @export
initialize = function(`number` = NULL, `float` = NULL, `double` = NULL, ...) {
if (!is.null(`number`)) {
self$`number` <- `number`
@ -46,13 +44,11 @@ NumberPropertiesOnly <- R6::R6Class(
self$`double` <- `double`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NumberPropertiesOnly in JSON format
#' @export
toJSON = function() {
NumberPropertiesOnlyObject <- list()
if (!is.null(self$`number`)) {
@ -69,14 +65,12 @@ NumberPropertiesOnly <- R6::R6Class(
}
NumberPropertiesOnlyObject
},
#' Deserialize JSON string into an instance of NumberPropertiesOnly
#'
#' @description
#' Deserialize JSON string into an instance of NumberPropertiesOnly
#'
#' @param input_json the JSON input
#' @return the instance of NumberPropertiesOnly
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`number`)) {
@ -90,13 +84,11 @@ NumberPropertiesOnly <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NumberPropertiesOnly in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`number`)) {
@ -127,14 +119,12 @@ NumberPropertiesOnly <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of NumberPropertiesOnly
#'
#' @description
#' Deserialize JSON string into an instance of NumberPropertiesOnly
#'
#' @param input_json the JSON input
#' @return the instance of NumberPropertiesOnly
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`number` <- this_object$`number`
@ -142,33 +132,27 @@ NumberPropertiesOnly <- R6::R6Class(
self$`double` <- this_object$`double`
self
},
#' Validate JSON input with respect to NumberPropertiesOnly
#'
#' @description
#' Validate JSON input with respect to NumberPropertiesOnly and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of NumberPropertiesOnly
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
if (self$`double` > 50.2) {
return(FALSE)
@ -179,13 +163,11 @@ NumberPropertiesOnly <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
if (self$`double` > 50.2) {
@ -197,12 +179,9 @@ NumberPropertiesOnly <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -12,30 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath } \emph{ Test path parameter(s) }
#' Test path parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } path_string character
#' \item \emph{ @param } path_integer integer
#' \item \emph{ @param } enum_nonref_string_path Enum < [success, failure, unclassified] >
#' \item \emph{ @param } enum_ref_string_path \link{StringEnumRef}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath ####################
@ -63,13 +39,11 @@ PathApi <- R6::R6Class(
"PathApi",
public = list(
api_client = NULL,
#' Initialize a new PathApi.
#'
#' @description
#' Initialize a new PathApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -77,8 +51,7 @@ PathApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Test path parameter(s)
#'
#' @description
#' Test path parameter(s)
#'
@ -88,8 +61,8 @@ PathApi <- R6::R6Class(
#' @param enum_ref_string_path
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ...) {
local_var_response <- self$TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -102,8 +75,7 @@ PathApi <- R6::R6Class(
local_var_response
}
},
#' Test path parameter(s)
#'
#' @description
#' Test path parameter(s)
#'
@ -113,8 +85,8 @@ PathApi <- R6::R6Class(
#' @param enum_ref_string_path
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -25,8 +25,7 @@ Pet <- R6::R6Class(
`photoUrls` = NULL,
`tags` = NULL,
`status` = NULL,
#' Initialize a new Pet class.
#'
#' @description
#' Initialize a new Pet class.
#'
@ -37,7 +36,6 @@ Pet <- R6::R6Class(
#' @param tags tags
#' @param status pet status in the store
#' @param ... Other optional arguments.
#' @export
initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) {
if (!missing(`name`)) {
if (!(is.character(`name`) && length(`name`) == 1)) {
@ -75,13 +73,11 @@ Pet <- R6::R6Class(
self$`status` <- `status`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSON = function() {
PetObject <- list()
if (!is.null(self$`id`)) {
@ -110,14 +106,12 @@ Pet <- R6::R6Class(
}
PetObject
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -145,13 +139,11 @@ Pet <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -206,14 +198,12 @@ Pet <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -227,13 +217,11 @@ Pet <- R6::R6Class(
self$`status` <- this_object$`status`
self
},
#' Validate JSON input with respect to Pet
#'
#' @description
#' Validate JSON input with respect to Pet and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `name`
@ -252,23 +240,19 @@ Pet <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Pet
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `name` is null
if (is.null(self$`name`)) {
@ -282,13 +266,11 @@ Pet <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `name` is null
@ -303,12 +285,9 @@ Pet <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ Query <- R6::R6Class(
public = list(
`id` = NULL,
`outcomes` = NULL,
#' Initialize a new Query class.
#'
#' @description
#' Initialize a new Query class.
#'
#' @param id Query
#' @param outcomes outcomes. Default to ["SUCCESS","FAILURE"].
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `outcomes` = ["SUCCESS","FAILURE"], ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -39,13 +37,11 @@ Query <- R6::R6Class(
self$`outcomes` <- `outcomes`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Query in JSON format
#' @export
toJSON = function() {
QueryObject <- list()
if (!is.null(self$`id`)) {
@ -58,14 +54,12 @@ Query <- R6::R6Class(
}
QueryObject
},
#' Deserialize JSON string into an instance of Query
#'
#' @description
#' Deserialize JSON string into an instance of Query
#'
#' @param input_json the JSON input
#' @return the instance of Query
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -76,13 +70,11 @@ Query <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Query in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -105,67 +97,54 @@ Query <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Query
#'
#' @description
#' Deserialize JSON string into an instance of Query
#'
#' @param input_json the JSON input
#' @return the instance of Query
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
self$`outcomes` <- ApiClient$new()$deserializeObj(this_object$`outcomes`, "array[character]", loadNamespace("openapi"))
self
},
#' Validate JSON input with respect to Query
#'
#' @description
#' Validate JSON input with respect to Query and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Query
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -12,176 +12,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ TestEnumRefString } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } enum_nonref_string_query Enum < [success, failure, unclassified] >
#' \item \emph{ @param } enum_ref_string_query \link{StringEnumRef}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryDatetimeDateString } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } datetime_query character
#' \item \emph{ @param } date_query character
#' \item \emph{ @param } string_query character
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryIntegerBooleanString } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } integer_query integer
#' \item \emph{ @param } boolean_query character
#' \item \emph{ @param } string_query character
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleDeepObjectExplodeTrueObject } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object \link{Pet}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleDeepObjectExplodeTrueObjectAllOf } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object \link{TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleFormExplodeFalseArrayInteger } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object list( integer )
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleFormExplodeFalseArrayString } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object list( character )
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleFormExplodeTrueArrayString } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object \link{TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleFormExplodeTrueObject } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object \link{Pet}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TestQueryStyleFormExplodeTrueObjectAllOf } \emph{ Test query parameter(s) }
#' Test query parameter(s)
#'
#' \itemize{
#' \item \emph{ @param } query_object \link{DataQuery}
#'
#'
#' \item status code : 200 | Successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### TestEnumRefString ####################
@ -337,13 +167,11 @@ QueryApi <- R6::R6Class(
"QueryApi",
public = list(
api_client = NULL,
#' Initialize a new QueryApi.
#'
#' @description
#' Initialize a new QueryApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -351,8 +179,7 @@ QueryApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -360,8 +187,8 @@ QueryApi <- R6::R6Class(
#' @param enum_ref_string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestEnumRefString = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ...) {
local_var_response <- self$TestEnumRefStringWithHttpInfo(enum_nonref_string_query, enum_ref_string_query, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -374,8 +201,7 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -383,8 +209,8 @@ QueryApi <- R6::R6Class(
#' @param enum_ref_string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestEnumRefStringWithHttpInfo = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -450,8 +276,7 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -460,8 +285,8 @@ QueryApi <- R6::R6Class(
#' @param string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryDatetimeDateString = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryDatetimeDateStringWithHttpInfo(datetime_query, date_query, string_query, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -474,8 +299,7 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -484,8 +308,8 @@ QueryApi <- R6::R6Class(
#' @param string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryDatetimeDateStringWithHttpInfo = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -551,8 +375,7 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -561,8 +384,8 @@ QueryApi <- R6::R6Class(
#' @param string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryIntegerBooleanString = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryIntegerBooleanStringWithHttpInfo(integer_query, boolean_query, string_query, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -575,8 +398,7 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
@ -585,8 +407,8 @@ QueryApi <- R6::R6Class(
#' @param string_query (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryIntegerBooleanStringWithHttpInfo = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -652,16 +474,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleDeepObjectExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -674,16 +495,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -743,16 +563,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleDeepObjectExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -765,16 +584,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -834,16 +652,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleFormExplodeFalseArrayInteger = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -856,16 +673,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -926,16 +742,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleFormExplodeFalseArrayString = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -948,16 +763,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1018,16 +832,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleFormExplodeTrueArrayString = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1040,16 +853,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1109,16 +921,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleFormExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleFormExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1131,16 +942,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleFormExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1200,16 +1010,15 @@ QueryApi <- R6::R6Class(
local_var_resp
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
TestQueryStyleFormExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) {
local_var_response <- self$TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1222,16 +1031,15 @@ QueryApi <- R6::R6Class(
local_var_response
}
},
#' Test query parameter(s)
#'
#' @description
#' Test query parameter(s)
#'
#' @param query_object (optional) No description
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -8,13 +8,11 @@
StringEnumRef <- R6::R6Class(
"StringEnumRef",
public = list(
#' Initialize a new StringEnumRef class.
#'
#' @description
#' Initialize a new StringEnumRef class.
#'
#' @param ... Optional arguments.
#' @export
initialize = function(...) {
local.optional.var <- list(...)
val <- unlist(local.optional.var)
@ -37,48 +35,42 @@ StringEnumRef <- R6::R6Class(
}
private$value <- val
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return StringEnumRef in JSON format
#' @export
toJSON = function() {
jsonlite::toJSON(private$value, auto_unbox = TRUE)
},
#' Deserialize JSON string into an instance of StringEnumRef
#'
#' @description
#' Deserialize JSON string into an instance of StringEnumRef
#'
#' @param input_json the JSON input
#'
#' @return the instance of StringEnumRef
#' @export
fromJSON = function(input_json) {
private$value <- jsonlite::fromJSON(input_json,
simplifyVector = FALSE)
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return StringEnumRef in JSON format
#' @export
toJSONString = function() {
as.character(jsonlite::toJSON(private$value,
auto_unbox = TRUE))
},
#' Deserialize JSON string into an instance of StringEnumRef
#'
#' @description
#' Deserialize JSON string into an instance of StringEnumRef
#'
#' @param input_json the JSON input
#'
#' @return the instance of StringEnumRef
#' @export
fromJSONString = function(input_json) {
private$value <- jsonlite::fromJSON(input_json,
simplifyVector = FALSE)

View File

@ -17,15 +17,13 @@ Tag <- R6::R6Class(
public = list(
`id` = NULL,
`name` = NULL,
#' Initialize a new Tag class.
#'
#' @description
#' Initialize a new Tag class.
#'
#' @param id id
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -40,13 +38,11 @@ Tag <- R6::R6Class(
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSON = function() {
TagObject <- list()
if (!is.null(self$`id`)) {
@ -59,14 +55,12 @@ Tag <- R6::R6Class(
}
TagObject
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -77,13 +71,11 @@ Tag <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -106,67 +98,54 @@ Tag <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to Tag
#'
#' @description
#' Validate JSON input with respect to Tag and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Tag
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -15,14 +15,12 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class(
"TestFormObjectMultipartRequestMarker",
public = list(
`name` = NULL,
#' Initialize a new TestFormObjectMultipartRequestMarker class.
#'
#' @description
#' Initialize a new TestFormObjectMultipartRequestMarker class.
#'
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`name` = NULL, ...) {
if (!is.null(`name`)) {
if (!(is.character(`name`) && length(`name`) == 1)) {
@ -31,13 +29,11 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class(
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestFormObjectMultipartRequestMarker in JSON format
#' @export
toJSON = function() {
TestFormObjectMultipartRequestMarkerObject <- list()
if (!is.null(self$`name`)) {
@ -46,14 +42,12 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class(
}
TestFormObjectMultipartRequestMarkerObject
},
#' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker
#'
#' @description
#' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker
#'
#' @param input_json the JSON input
#' @return the instance of TestFormObjectMultipartRequestMarker
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`name`)) {
@ -61,13 +55,11 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestFormObjectMultipartRequestMarker in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`name`)) {
@ -82,66 +74,53 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker
#'
#' @description
#' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker
#'
#' @param input_json the JSON input
#' @return the instance of TestFormObjectMultipartRequestMarker
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to TestFormObjectMultipartRequestMarker
#'
#' @description
#' Validate JSON input with respect to TestFormObjectMultipartRequestMarker and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of TestFormObjectMultipartRequestMarker
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
`color` = NULL,
`id` = NULL,
`name` = NULL,
#' Initialize a new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter class.
#'
#' @description
#' Initialize a new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter class.
#'
@ -31,7 +30,6 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
#' @param id id
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`size` = NULL, `color` = NULL, `id` = NULL, `name` = NULL, ...) {
if (!is.null(`size`)) {
if (!(is.character(`size`) && length(`size`) == 1)) {
@ -58,13 +56,11 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format
#' @export
toJSON = function() {
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject <- list()
if (!is.null(self$`size`)) {
@ -85,14 +81,12 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
}
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject
},
#' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#'
#' @description
#' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#'
#' @param input_json the JSON input
#' @return the instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`size`)) {
@ -109,13 +103,11 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`size`)) {
@ -154,14 +146,12 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#'
#' @description
#' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#'
#' @param input_json the JSON input
#' @return the instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`size` <- this_object$`size`
@ -170,53 +160,42 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#'
#' @description
#' Validate JSON input with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -15,14 +15,12 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class(
"TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter",
public = list(
`values` = NULL,
#' Initialize a new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter class.
#'
#' @description
#' Initialize a new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter class.
#'
#' @param values values
#' @param ... Other optional arguments.
#' @export
initialize = function(`values` = NULL, ...) {
if (!is.null(`values`)) {
stopifnot(is.vector(`values`), length(`values`) != 0)
@ -30,13 +28,11 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class(
self$`values` <- `values`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format
#' @export
toJSON = function() {
TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject <- list()
if (!is.null(self$`values`)) {
@ -45,14 +41,12 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class(
}
TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject
},
#' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#'
#' @description
#' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#'
#' @param input_json the JSON input
#' @return the instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`values`)) {
@ -60,13 +54,11 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`values`)) {
@ -81,66 +73,53 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#'
#' @description
#' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#'
#' @param input_json the JSON input
#' @return the instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`values` <- ApiClient$new()$deserializeObj(this_object$`values`, "array[character]", loadNamespace("openapi"))
self
},
#' Validate JSON input with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#'
#' @description
#' Validate JSON input with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -27,8 +27,7 @@ AllofTagApiResponse <- R6::R6Class(
`message` = NULL,
`_field_list` = c("id", "name", "code", "type", "message"),
`additional_properties` = list(),
#' Initialize a new AllofTagApiResponse class.
#'
#' @description
#' Initialize a new AllofTagApiResponse class.
#'
@ -39,7 +38,6 @@ AllofTagApiResponse <- R6::R6Class(
#' @param message message
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -77,13 +75,11 @@ AllofTagApiResponse <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSON = function() {
AllofTagApiResponseObject <- list()
if (!is.null(self$`id`)) {
@ -112,14 +108,12 @@ AllofTagApiResponse <- R6::R6Class(
AllofTagApiResponseObject
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -146,13 +140,11 @@ AllofTagApiResponse <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -204,14 +196,12 @@ AllofTagApiResponse <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -228,53 +218,42 @@ AllofTagApiResponse <- R6::R6Class(
self
},
#' Validate JSON input with respect to AllofTagApiResponse
#'
#' @description
#' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of AllofTagApiResponse
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,8 +23,7 @@ Animal <- R6::R6Class(
`additional_properties` = list(),
`_discriminator_property_name` = 'className',
`_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'),
#' Initialize a new Animal class.
#'
#' @description
#' Initialize a new Animal class.
#'
@ -32,7 +31,6 @@ Animal <- R6::R6Class(
#' @param color color. Default to "red".
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -52,13 +50,11 @@ Animal <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSON = function() {
AnimalObject <- list()
if (!is.null(self$`className`)) {
@ -75,14 +71,12 @@ Animal <- R6::R6Class(
AnimalObject
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -100,13 +94,11 @@ Animal <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -134,14 +126,12 @@ Animal <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -155,13 +145,11 @@ Animal <- R6::R6Class(
self
},
#' Validate JSON input with respect to Animal
#'
#' @description
#' Validate JSON input with respect to Animal and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -173,23 +161,19 @@ Animal <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Animal
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -198,13 +182,11 @@ Animal <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -214,12 +196,9 @@ Animal <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class(
actual_type = NULL,
#' @field any_of a list of object types defined in the anyOf schema.
any_of = list("BasquePig", "DanishPig"),
#' Initialize a new AnyOfPig.
#'
#' @description
#' Initialize a new AnyOfPig.
#'
#' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#' An alias to the method `fromJSON`.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSON = function(input) {
error_messages <- list()
@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class(
stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>",
paste(error_messages, collapse = " >> ")))
},
#' Serialize AnyOfPig to JSON string.
#'
#' @description
#' Serialize AnyOfPig to JSON string.
#'
#' @return JSON string representation of the AnyOfPig.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify((self$actual_instance$toJSONString())))
@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPig to JSON.
#'
#' @description
#' Serialize AnyOfPig to JSON.
#'
#' @return JSON representation of the AnyOfPig.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPig.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPig and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("character", "integer"),
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @description
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self
},
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,15 +23,13 @@ ApiException <- R6::R6Class(
body = NULL,
headers = NULL,
error_object = NULL,
#' Initialize a new ApiException class.
#'
#' @description
#' Initialize a new ApiExceptino class.
#' Initialize a new ApiException class.
#'
#' @param status HTTP status.
#' @param reason Reason of the ApiException.
#' @param http_response HTTP response object.
#' @export
initialize = function(status = NULL, reason = NULL, http_response = NULL) {
if (!is.null(http_response)) {
self$status <- http_response$status_code
@ -51,13 +49,11 @@ ApiException <- R6::R6Class(
self$error_object <- NULL
}
},
#' Returns the string format of ApiException.
#'
#' @description
#' Returns the string format of ApiException.
#'
#' @return the string format of ApiException.
#' @export
toString = function() {
errorMsg <- ""
errorMsg <- paste("status : ", self$status, "\n", sep = "")

View File

@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class(
status_code = NULL,
status_code_desc = NULL,
headers = NULL,
#' Initialize a new ApiResponse class.
#'
#' @description
#' Initialize a new ApiResponse class.
#'
@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class(
#' @param status_code The HTTP response status code.
#' @param status_code_desc The brief description of the HTTP response status code.
#' @param headers The HTTP response headers.
#' @export
initialize = function(content = NULL,
response = NULL,
status_code = NULL,
@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class(
self$headers <- headers
},
#' Return the response as text
#'
#' @description
#' The response is stored as a raw vector. Use this to access the response after
#' converting it to text. If the response is not coercible to text NA is returned.
#'
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
if (is.null(self$response)) {
self$response <- charToRaw(jsonlite::toJSON("NULL"))

View File

@ -21,8 +21,7 @@ BasquePig <- R6::R6Class(
`color` = NULL,
`_field_list` = c("className", "color"),
`additional_properties` = list(),
#' Initialize a new BasquePig class.
#'
#' @description
#' Initialize a new BasquePig class.
#'
@ -30,7 +29,6 @@ BasquePig <- R6::R6Class(
#' @param color color
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color`, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -50,13 +48,11 @@ BasquePig <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSON = function() {
BasquePigObject <- list()
if (!is.null(self$`className`)) {
@ -73,14 +69,12 @@ BasquePig <- R6::R6Class(
BasquePigObject
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -98,13 +92,11 @@ BasquePig <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -132,14 +124,12 @@ BasquePig <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -153,13 +143,11 @@ BasquePig <- R6::R6Class(
self
},
#' Validate JSON input with respect to BasquePig
#'
#' @description
#' Validate JSON input with respect to BasquePig and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -179,23 +167,19 @@ BasquePig <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of BasquePig
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -209,13 +193,11 @@ BasquePig <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -230,12 +212,9 @@ BasquePig <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -24,8 +24,7 @@ Cat <- R6::R6Class(
`declawed` = NULL,
`_field_list` = c("className", "color", "declawed"),
`additional_properties` = list(),
#' Initialize a new Cat class.
#'
#' @description
#' Initialize a new Cat class.
#'
@ -34,7 +33,6 @@ Cat <- R6::R6Class(
#' @param declawed declawed
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -60,13 +58,11 @@ Cat <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Cat in JSON format
#' @export
toJSON = function() {
CatObject <- list()
if (!is.null(self$`className`)) {
@ -87,14 +83,12 @@ Cat <- R6::R6Class(
CatObject
},
#' Deserialize JSON string into an instance of Cat
#'
#' @description
#' Deserialize JSON string into an instance of Cat
#'
#' @param input_json the JSON input
#' @return the instance of Cat
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -115,13 +109,11 @@ Cat <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Cat in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -157,14 +149,12 @@ Cat <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Cat
#'
#' @description
#' Deserialize JSON string into an instance of Cat
#'
#' @param input_json the JSON input
#' @return the instance of Cat
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -179,13 +169,11 @@ Cat <- R6::R6Class(
self
},
#' Validate JSON input with respect to Cat
#'
#' @description
#' Validate JSON input with respect to Cat and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -197,23 +185,19 @@ Cat <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Cat
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -222,13 +206,11 @@ Cat <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -238,12 +220,9 @@ Cat <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ Category <- R6::R6Class(
`name` = NULL,
`_field_list` = c("id", "name"),
`additional_properties` = list(),
#' Initialize a new Category class.
#'
#' @description
#' Initialize a new Category class.
#'
@ -30,7 +29,6 @@ Category <- R6::R6Class(
#' @param name name
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -50,13 +48,11 @@ Category <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSON = function() {
CategoryObject <- list()
if (!is.null(self$`id`)) {
@ -73,14 +69,12 @@ Category <- R6::R6Class(
CategoryObject
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -98,13 +92,11 @@ Category <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -132,14 +124,12 @@ Category <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -153,33 +143,27 @@ Category <- R6::R6Class(
self
},
#' Validate JSON input with respect to Category
#'
#' @description
#' Validate JSON input with respect to Category and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Category
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
return(FALSE)
@ -187,13 +171,11 @@ Category <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
@ -202,12 +184,9 @@ Category <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ DanishPig <- R6::R6Class(
`size` = NULL,
`_field_list` = c("className", "size"),
`additional_properties` = list(),
#' Initialize a new DanishPig class.
#'
#' @description
#' Initialize a new DanishPig class.
#'
@ -30,7 +29,6 @@ DanishPig <- R6::R6Class(
#' @param size size
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `size`, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -50,13 +48,11 @@ DanishPig <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DanishPig in JSON format
#' @export
toJSON = function() {
DanishPigObject <- list()
if (!is.null(self$`className`)) {
@ -73,14 +69,12 @@ DanishPig <- R6::R6Class(
DanishPigObject
},
#' Deserialize JSON string into an instance of DanishPig
#'
#' @description
#' Deserialize JSON string into an instance of DanishPig
#'
#' @param input_json the JSON input
#' @return the instance of DanishPig
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -98,13 +92,11 @@ DanishPig <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DanishPig in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -132,14 +124,12 @@ DanishPig <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of DanishPig
#'
#' @description
#' Deserialize JSON string into an instance of DanishPig
#'
#' @param input_json the JSON input
#' @return the instance of DanishPig
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -153,13 +143,11 @@ DanishPig <- R6::R6Class(
self
},
#' Validate JSON input with respect to DanishPig
#'
#' @description
#' Validate JSON input with respect to DanishPig and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -179,23 +167,19 @@ DanishPig <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DanishPig
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -209,13 +193,11 @@ DanishPig <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -230,12 +212,9 @@ DanishPig <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,8 +23,7 @@ Date <- R6::R6Class(
`url_property` = NULL,
`_field_list` = c("className", "percent_description", "url_property"),
`additional_properties` = list(),
#' Initialize a new Date class.
#'
#' @description
#' Initialize a new Date class.
#'
@ -33,7 +32,6 @@ Date <- R6::R6Class(
#' @param percent_description using \% in the description
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -63,13 +61,11 @@ Date <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Date in JSON format
#' @export
toJSON = function() {
DateObject <- list()
if (!is.null(self$`className`)) {
@ -90,14 +86,12 @@ Date <- R6::R6Class(
DateObject
},
#' Deserialize JSON string into an instance of Date
#'
#' @description
#' Deserialize JSON string into an instance of Date
#'
#' @param input_json the JSON input
#' @return the instance of Date
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -122,13 +116,11 @@ Date <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Date in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -164,14 +156,12 @@ Date <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Date
#'
#' @description
#' Deserialize JSON string into an instance of Date
#'
#' @param input_json the JSON input
#' @return the instance of Date
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -190,13 +180,11 @@ Date <- R6::R6Class(
self
},
#' Validate JSON input with respect to Date
#'
#' @description
#' Validate JSON input with respect to Date and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -220,23 +208,19 @@ Date <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Date
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -250,13 +234,11 @@ Date <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -271,12 +253,9 @@ Date <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -24,8 +24,7 @@ Dog <- R6::R6Class(
`breed` = NULL,
`_field_list` = c("className", "color", "breed"),
`additional_properties` = list(),
#' Initialize a new Dog class.
#'
#' @description
#' Initialize a new Dog class.
#'
@ -34,7 +33,6 @@ Dog <- R6::R6Class(
#' @param breed breed
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -60,13 +58,11 @@ Dog <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Dog in JSON format
#' @export
toJSON = function() {
DogObject <- list()
if (!is.null(self$`className`)) {
@ -87,14 +83,12 @@ Dog <- R6::R6Class(
DogObject
},
#' Deserialize JSON string into an instance of Dog
#'
#' @description
#' Deserialize JSON string into an instance of Dog
#'
#' @param input_json the JSON input
#' @return the instance of Dog
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -115,13 +109,11 @@ Dog <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Dog in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -157,14 +149,12 @@ Dog <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Dog
#'
#' @description
#' Deserialize JSON string into an instance of Dog
#'
#' @param input_json the JSON input
#' @return the instance of Dog
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -179,13 +169,11 @@ Dog <- R6::R6Class(
self
},
#' Validate JSON input with respect to Dog
#'
#' @description
#' Validate JSON input with respect to Dog and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -197,23 +185,19 @@ Dog <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Dog
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -222,13 +206,11 @@ Dog <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -238,12 +220,9 @@ Dog <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -19,15 +19,13 @@ DummyModel <- R6::R6Class(
`property` = NULL,
`_field_list` = c("property"),
`additional_properties` = list(),
#' Initialize a new DummyModel class.
#'
#' @description
#' Initialize a new DummyModel class.
#'
#' @param property property
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`property` = NULL, additional_properties = NULL, ...) {
if (!is.null(`property`)) {
if (!(is.character(`property`) && length(`property`) == 1)) {
@ -41,13 +39,11 @@ DummyModel <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DummyModel in JSON format
#' @export
toJSON = function() {
DummyModelObject <- list()
if (!is.null(self$`property`)) {
@ -60,14 +56,12 @@ DummyModel <- R6::R6Class(
DummyModelObject
},
#' Deserialize JSON string into an instance of DummyModel
#'
#' @description
#' Deserialize JSON string into an instance of DummyModel
#'
#' @param input_json the JSON input
#' @return the instance of DummyModel
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`property`)) {
@ -82,13 +76,11 @@ DummyModel <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DummyModel in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`property`)) {
@ -108,14 +100,12 @@ DummyModel <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of DummyModel
#'
#' @description
#' Deserialize JSON string into an instance of DummyModel
#'
#' @param input_json the JSON input
#' @return the instance of DummyModel
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`property` <- this_object$`property`
@ -128,53 +118,42 @@ DummyModel <- R6::R6Class(
self
},
#' Validate JSON input with respect to DummyModel
#'
#' @description
#' Validate JSON input with respect to DummyModel and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DummyModel
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,107 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ add_pet_optional } \emph{ Add a new pet to the store (optional body) }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_data_file } \emph{ test data_file to ensure it&#39;s escaped correctly }
#'
#'
#' \itemize{
#' \item \emph{ @param } dummy character
#' \item \emph{ @param } var_data_file character
#' \item \emph{ @returnType } \link{User} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : User
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_path_array } \emph{ test array parameter in path }
#'
#'
#' \itemize{
#' \item \emph{ @param } path_array list( character )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_regular_expression } \emph{ test regular expression to ensure no exception }
#'
#'
#' \itemize{
#' \item \emph{ @param } reg_exp_test character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_set_query } \emph{ test set query parameter }
#'
#'
#' \itemize{
#' \item \emph{ @param } set_dummy list( character )
#' \item \emph{ @param } array_dummy list( character )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### add_pet_optional ####################
@ -270,13 +169,11 @@ FakeApi <- R6::R6Class(
"FakeApi",
public = list(
api_client = NULL,
#' Initialize a new FakeApi.
#'
#' @description
#' Initialize a new FakeApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -284,16 +181,15 @@ FakeApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Add a new pet to the store (optional body)
#'
#' @description
#' Add a new pet to the store (optional body)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
add_pet_optional = function(pet = NULL, data_file = NULL, ...) {
local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -306,16 +202,15 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' Add a new pet to the store (optional body)
#'
#' @description
#' Add a new pet to the store (optional body)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -400,8 +295,7 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test data_file to ensure it's escaped correctly
#'
#' @description
#' test data_file to ensure it's escaped correctly
#'
@ -409,8 +303,8 @@ FakeApi <- R6::R6Class(
#' @param var_data_file (optional) header data file
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return User
#' @export
fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -423,8 +317,7 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test data_file to ensure it's escaped correctly
#'
#' @description
#' test data_file to ensure it's escaped correctly
#'
@ -432,8 +325,8 @@ FakeApi <- R6::R6Class(
#' @param var_data_file (optional) header data file
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (User) with additional information such as HTTP status code, headers
#' @export
fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -520,15 +413,14 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test array parameter in path
#'
#' @description
#' test array parameter in path
#'
#' @param path_array dummy path parameter
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_path_array = function(path_array, ...) {
local_var_response <- self$fake_path_array_with_http_info(path_array, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -541,15 +433,14 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test array parameter in path
#'
#' @description
#' test array parameter in path
#'
#' @param path_array dummy path parameter
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_path_array_with_http_info = function(path_array, ...) {
args <- list(...)
query_params <- list()
@ -622,15 +513,14 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test regular expression to ensure no exception
#'
#' @description
#' test regular expression to ensure no exception
#'
#' @param reg_exp_test dummy required parameter
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_regular_expression = function(reg_exp_test, ...) {
local_var_response <- self$fake_regular_expression_with_http_info(reg_exp_test, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -643,15 +533,14 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test regular expression to ensure no exception
#'
#' @description
#' test regular expression to ensure no exception
#'
#' @param reg_exp_test dummy required parameter
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_regular_expression_with_http_info = function(reg_exp_test, ...) {
args <- list(...)
query_params <- list()
@ -728,16 +617,15 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test set query parameter
#'
#' @description
#' test set query parameter
#'
#' @param set_dummy set query
#' @param array_dummy array query
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_set_query = function(set_dummy, array_dummy, ...) {
local_var_response <- self$fake_set_query_with_http_info(set_dummy, array_dummy, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -750,16 +638,15 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test set query parameter
#'
#' @description
#' test set query parameter
#'
#' @param set_dummy set query
#' @param array_dummy array query
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_set_query_with_http_info = function(set_dummy, array_dummy, ...) {
args <- list(...)
query_params <- list()

View File

@ -47,8 +47,7 @@ FormatTest <- R6::R6Class(
`pattern_with_digits_and_delimiter` = NULL,
`_field_list` = c("integer", "int32", "int64", "number", "float", "double", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"),
`additional_properties` = list(),
#' Initialize a new FormatTest class.
#'
#' @description
#' Initialize a new FormatTest class.
#'
@ -69,7 +68,6 @@ FormatTest <- R6::R6Class(
#' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, additional_properties = NULL, ...) {
if (!missing(`number`)) {
self$`number` <- `number`
@ -158,13 +156,11 @@ FormatTest <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return FormatTest in JSON format
#' @export
toJSON = function() {
FormatTestObject <- list()
if (!is.null(self$`integer`)) {
@ -233,14 +229,12 @@ FormatTest <- R6::R6Class(
FormatTestObject
},
#' Deserialize JSON string into an instance of FormatTest
#'
#' @description
#' Deserialize JSON string into an instance of FormatTest
#'
#' @param input_json the JSON input
#' @return the instance of FormatTest
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`integer`)) {
@ -297,13 +291,11 @@ FormatTest <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return FormatTest in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`integer`)) {
@ -435,14 +427,12 @@ FormatTest <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of FormatTest
#'
#' @description
#' Deserialize JSON string into an instance of FormatTest
#'
#' @param input_json the JSON input
#' @return the instance of FormatTest
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`integer` <- this_object$`integer`
@ -469,13 +459,11 @@ FormatTest <- R6::R6Class(
self
},
#' Validate JSON input with respect to FormatTest
#'
#' @description
#' Validate JSON input with respect to FormatTest and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `number`
@ -505,23 +493,19 @@ FormatTest <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of FormatTest
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
if (self$`integer` > 100) {
return(FALSE)
@ -599,13 +583,11 @@ FormatTest <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
if (self$`integer` > 100) {
@ -684,12 +666,9 @@ FormatTest <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ Mammal <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("Whale", "Zebra"),
#' Initialize a new Mammal.
#'
#' @description
#' Initialize a new Mammal.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "Whale", "Zebra"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ Mammal <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of Mammal.
#'
#' @description
#' Deserialize JSON string into an instance of Mammal.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of Mammal.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of Mammal.
#'
#' @description
#' Deserialize JSON string into an instance of Mammal.
#'
#' @param input The input JSON.
#'
#' @return An instance of Mammal.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -136,13 +132,11 @@ Mammal <- R6::R6Class(
self
},
#' Serialize Mammal to JSON string.
#'
#' @description
#' Serialize Mammal to JSON string.
#'
#' @return JSON string representation of the Mammal.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -150,13 +144,11 @@ Mammal <- R6::R6Class(
NULL
}
},
#' Serialize Mammal to JSON.
#'
#' @description
#' Serialize Mammal to JSON.
#'
#' @return JSON representation of the Mammal.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -164,14 +156,12 @@ Mammal <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to Mammal.
#'
#' @description
#' Validate the input JSON with respect to Mammal and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -184,13 +174,11 @@ Mammal <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -200,12 +188,9 @@ Mammal <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,8 +23,7 @@ ModelApiResponse <- R6::R6Class(
`message` = NULL,
`_field_list` = c("code", "type", "message"),
`additional_properties` = list(),
#' Initialize a new ModelApiResponse class.
#'
#' @description
#' Initialize a new ModelApiResponse class.
#'
@ -33,7 +32,6 @@ ModelApiResponse <- R6::R6Class(
#' @param message message
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
if (!is.null(`code`)) {
if (!(is.numeric(`code`) && length(`code`) == 1)) {
@ -59,13 +57,11 @@ ModelApiResponse <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return ModelApiResponse in JSON format
#' @export
toJSON = function() {
ModelApiResponseObject <- list()
if (!is.null(self$`code`)) {
@ -86,14 +82,12 @@ ModelApiResponse <- R6::R6Class(
ModelApiResponseObject
},
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of ModelApiResponse
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`code`)) {
@ -114,13 +108,11 @@ ModelApiResponse <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return ModelApiResponse in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`code`)) {
@ -156,14 +148,12 @@ ModelApiResponse <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of ModelApiResponse
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`code` <- this_object$`code`
@ -178,53 +168,42 @@ ModelApiResponse <- R6::R6Class(
self
},
#' Validate JSON input with respect to ModelApiResponse
#'
#' @description
#' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of ModelApiResponse
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ NestedOneOf <- R6::R6Class(
`nested_pig` = NULL,
`_field_list` = c("size", "nested_pig"),
`additional_properties` = list(),
#' Initialize a new NestedOneOf class.
#'
#' @description
#' Initialize a new NestedOneOf class.
#'
@ -30,7 +29,6 @@ NestedOneOf <- R6::R6Class(
#' @param nested_pig nested_pig
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) {
if (!is.null(`size`)) {
if (!(is.numeric(`size`) && length(`size`) == 1)) {
@ -48,13 +46,11 @@ NestedOneOf <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NestedOneOf in JSON format
#' @export
toJSON = function() {
NestedOneOfObject <- list()
if (!is.null(self$`size`)) {
@ -71,14 +67,12 @@ NestedOneOf <- R6::R6Class(
NestedOneOfObject
},
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @description
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @param input_json the JSON input
#' @return the instance of NestedOneOf
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`size`)) {
@ -98,13 +92,11 @@ NestedOneOf <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NestedOneOf in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`size`)) {
@ -132,14 +124,12 @@ NestedOneOf <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @description
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @param input_json the JSON input
#' @return the instance of NestedOneOf
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`size` <- this_object$`size`
@ -153,53 +143,42 @@ NestedOneOf <- R6::R6Class(
self
},
#' Validate JSON input with respect to NestedOneOf
#'
#' @description
#' Validate JSON input with respect to NestedOneOf and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of NestedOneOf
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("character", "integer"),
#' Initialize a new OneOfPrimitiveTypeTest.
#'
#' @description
#' Initialize a new OneOfPrimitiveTypeTest.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of OneOfPrimitiveTypeTest.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @param input The input JSON.
#'
#' @return An instance of OneOfPrimitiveTypeTest.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -112,13 +108,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
self
},
#' Serialize OneOfPrimitiveTypeTest to JSON string.
#'
#' @description
#' Serialize OneOfPrimitiveTypeTest to JSON string.
#'
#' @return JSON string representation of the OneOfPrimitiveTypeTest.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -126,13 +120,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Serialize OneOfPrimitiveTypeTest to JSON.
#'
#' @description
#' Serialize OneOfPrimitiveTypeTest to JSON.
#'
#' @return JSON representation of the OneOfPrimitiveTypeTest.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -140,14 +132,12 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest.
#'
#' @description
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -160,13 +150,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -176,12 +164,9 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -29,8 +29,7 @@ Order <- R6::R6Class(
`complete` = NULL,
`_field_list` = c("id", "petId", "quantity", "shipDate", "status", "complete"),
`additional_properties` = list(),
#' Initialize a new Order class.
#'
#' @description
#' Initialize a new Order class.
#'
@ -42,7 +41,6 @@ Order <- R6::R6Class(
#' @param complete complete. Default to FALSE.
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -89,13 +87,11 @@ Order <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Order in JSON format
#' @export
toJSON = function() {
OrderObject <- list()
if (!is.null(self$`id`)) {
@ -128,14 +124,12 @@ Order <- R6::R6Class(
OrderObject
},
#' Deserialize JSON string into an instance of Order
#'
#' @description
#' Deserialize JSON string into an instance of Order
#'
#' @param input_json the JSON input
#' @return the instance of Order
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -168,13 +162,11 @@ Order <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Order in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -234,14 +226,12 @@ Order <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Order
#'
#' @description
#' Deserialize JSON string into an instance of Order
#'
#' @param input_json the JSON input
#' @return the instance of Order
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -262,53 +252,42 @@ Order <- R6::R6Class(
self
},
#' Validate JSON input with respect to Order
#'
#' @description
#' Validate JSON input with respect to Order and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Order
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -29,8 +29,7 @@ Pet <- R6::R6Class(
`status` = NULL,
`_field_list` = c("id", "category", "name", "photoUrls", "tags", "status"),
`additional_properties` = list(),
#' Initialize a new Pet class.
#'
#' @description
#' Initialize a new Pet class.
#'
@ -42,7 +41,6 @@ Pet <- R6::R6Class(
#' @param status pet status in the store
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) {
if (!missing(`name`)) {
if (!(is.character(`name`) && length(`name`) == 1)) {
@ -85,13 +83,11 @@ Pet <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSON = function() {
PetObject <- list()
if (!is.null(self$`id`)) {
@ -124,14 +120,12 @@ Pet <- R6::R6Class(
PetObject
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -166,13 +160,11 @@ Pet <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -232,14 +224,12 @@ Pet <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -260,13 +250,11 @@ Pet <- R6::R6Class(
self
},
#' Validate JSON input with respect to Pet
#'
#' @description
#' Validate JSON input with respect to Pet and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `name`
@ -285,23 +273,19 @@ Pet <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Pet
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `name` is null
if (is.null(self$`name`)) {
@ -315,13 +299,11 @@ Pet <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `name` is null
@ -336,12 +318,9 @@ Pet <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,278 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ add_pet } \emph{ Add a new pet to the store }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ delete_pet } \emph{ Deletes a pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } api_key character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid pet value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ find_pets_by_status } \emph{ Finds Pets by status }
#' Multiple status values can be provided with comma separated strings
#'
#' \itemize{
#' \item \emph{ @param } status Enum < [available, pending, sold] >
#' \item \emph{ @returnType } list( \link{Pet} ) \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : array[Pet]
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid status value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ find_pets_by_tags } \emph{ Finds Pets by tags }
#' Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
#'
#' \itemize{
#' \item \emph{ @param } tags list( character )
#' \item \emph{ @returnType } list( \link{Pet} ) \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : array[Pet]
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid tag value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_pet_by_id } \emph{ Find pet by ID }
#' Returns a single pet
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_pet_by_id_streaming } \emph{ Find pet by ID (streaming) }
#' Returns a single pet
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ test_header } \emph{ Header test }
#' Header test
#'
#' \itemize{
#' \item \emph{ @param } header_test_int integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_pet } \emph{ Update an existing pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Validation exception
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_pet_with_form } \emph{ Updates a pet in the store with form data }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } name character
#' \item \emph{ @param } status character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ upload_file } \emph{ uploads an image }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } additional_metadata character
#' \item \emph{ @param } file data.frame
#' \item \emph{ @returnType } \link{ModelApiResponse} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : ModelApiResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### add_pet ####################
@ -644,13 +372,11 @@ PetApi <- R6::R6Class(
"PetApi",
public = list(
api_client = NULL,
#' Initialize a new PetApi.
#'
#' @description
#' Initialize a new PetApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -658,16 +384,15 @@ PetApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Add a new pet to the store
#'
#' @description
#' Add a new pet to the store
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
add_pet = function(pet, data_file = NULL, ...) {
local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -680,16 +405,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Add a new pet to the store
#'
#' @description
#' Add a new pet to the store
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
add_pet_with_http_info = function(pet, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -781,16 +505,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Deletes a pet
#'
#' @description
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_pet = function(pet_id, api_key = NULL, ...) {
local_var_response <- self$delete_pet_with_http_info(pet_id, api_key, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -803,16 +526,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Deletes a pet
#'
#' @description
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_pet_with_http_info = function(pet_id, api_key = NULL, ...) {
args <- list(...)
query_params <- list()
@ -891,16 +613,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Finds Pets by status
#'
#' @description
#' Finds Pets by status
#'
#' @param status Status values that need to be considered for filter
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return array[Pet]
#' @export
find_pets_by_status = function(status, data_file = NULL, ...) {
local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -913,16 +634,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Finds Pets by status
#'
#' @description
#' Finds Pets by status
#'
#' @param status Status values that need to be considered for filter
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (array[Pet]) with additional information such as HTTP status code, headers
#' @export
find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1019,16 +739,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Finds Pets by tags
#'
#' @description
#' Finds Pets by tags
#'
#' @param tags Tags to filter by
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return array[Pet]
#' @export
find_pets_by_tags = function(tags, data_file = NULL, ...) {
local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1041,16 +760,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Finds Pets by tags
#'
#' @description
#' Finds Pets by tags
#'
#' @param tags Tags to filter by
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (array[Pet]) with additional information such as HTTP status code, headers
#' @export
find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1135,16 +853,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find pet by ID
#'
#' @description
#' Find pet by ID
#'
#' @param pet_id ID of pet to return
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
get_pet_by_id = function(pet_id, data_file = NULL, ...) {
local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1157,16 +874,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Find pet by ID
#'
#' @description
#' Find pet by ID
#'
#' @param pet_id ID of pet to return
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1256,8 +972,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find pet by ID (streaming)
#'
#' @description
#' Find pet by ID (streaming)
#'
@ -1265,8 +980,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) {
local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ...)
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
@ -1283,8 +998,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Find pet by ID (streaming)
#'
#' @description
#' Find pet by ID (streaming)
#'
@ -1292,8 +1006,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1388,8 +1102,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Header test
#'
#' @description
#' Header test
#'
@ -1397,8 +1110,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) {
local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ...)
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
@ -1415,8 +1128,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Header test
#'
#' @description
#' Header test
#'
@ -1424,8 +1136,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1518,16 +1230,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Update an existing pet
#'
#' @description
#' Update an existing pet
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
update_pet = function(pet, data_file = NULL, ...) {
local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1540,16 +1251,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Update an existing pet
#'
#' @description
#' Update an existing pet
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
update_pet_with_http_info = function(pet, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1640,8 +1350,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Updates a pet in the store with form data
#'
#' @description
#' Updates a pet in the store with form data
#'
@ -1649,8 +1358,8 @@ PetApi <- R6::R6Class(
#' @param name (optional) Updated name of the pet
#' @param status (optional) Updated status of the pet
#' @param ... Other optional arguments
#'
#' @return void
#' @export
update_pet_with_form = function(pet_id, name = NULL, status = NULL, ...) {
local_var_response <- self$update_pet_with_form_with_http_info(pet_id, name, status, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1663,8 +1372,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Updates a pet in the store with form data
#'
#' @description
#' Updates a pet in the store with form data
#'
@ -1672,8 +1380,8 @@ PetApi <- R6::R6Class(
#' @param name (optional) Updated name of the pet
#' @param status (optional) Updated status of the pet
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
update_pet_with_form_with_http_info = function(pet_id, name = NULL, status = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1750,8 +1458,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' uploads an image
#'
#' @description
#' uploads an image
#'
@ -1760,8 +1467,8 @@ PetApi <- R6::R6Class(
#' @param file (optional) file to upload
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return ModelApiResponse
#' @export
upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) {
local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1774,8 +1481,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' uploads an image
#'
#' @description
#' uploads an image
#'
@ -1784,8 +1490,8 @@ PetApi <- R6::R6Class(
#' @param file (optional) file to upload
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers
#' @export
upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -19,15 +19,13 @@ PetMap <- R6::R6Class(
`pet` = NULL,
`_field_list` = c("pet"),
`additional_properties` = list(),
#' Initialize a new PetMap class.
#'
#' @description
#' Initialize a new PetMap class.
#'
#' @param pet pet
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`pet` = NULL, additional_properties = NULL, ...) {
if (!is.null(`pet`)) {
stopifnot(is.vector(`pet`), length(`pet`) != 0)
@ -40,13 +38,11 @@ PetMap <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return PetMap in JSON format
#' @export
toJSON = function() {
PetMapObject <- list()
if (!is.null(self$`pet`)) {
@ -59,14 +55,12 @@ PetMap <- R6::R6Class(
PetMapObject
},
#' Deserialize JSON string into an instance of PetMap
#'
#' @description
#' Deserialize JSON string into an instance of PetMap
#'
#' @param input_json the JSON input
#' @return the instance of PetMap
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`pet`)) {
@ -81,13 +75,11 @@ PetMap <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return PetMap in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`pet`)) {
@ -107,14 +99,12 @@ PetMap <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of PetMap
#'
#' @description
#' Deserialize JSON string into an instance of PetMap
#'
#' @param input_json the JSON input
#' @return the instance of PetMap
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`pet` <- ApiClient$new()$deserializeObj(this_object$`pet`, "map(character)", loadNamespace("petstore"))
@ -127,53 +117,42 @@ PetMap <- R6::R6Class(
self
},
#' Validate JSON input with respect to PetMap
#'
#' @description
#' Validate JSON input with respect to PetMap and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of PetMap
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ Pig <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("BasquePig", "DanishPig"),
#' Initialize a new Pig.
#'
#' @description
#' Initialize a new Pig.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ Pig <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of Pig.
#'
#' @description
#' Deserialize JSON string into an instance of Pig.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of Pig.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of Pig.
#'
#' @description
#' Deserialize JSON string into an instance of Pig.
#'
#' @param input The input JSON.
#'
#' @return An instance of Pig.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -136,13 +132,11 @@ Pig <- R6::R6Class(
self
},
#' Serialize Pig to JSON string.
#'
#' @description
#' Serialize Pig to JSON string.
#'
#' @return JSON string representation of the Pig.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -150,13 +144,11 @@ Pig <- R6::R6Class(
NULL
}
},
#' Serialize Pig to JSON.
#'
#' @description
#' Serialize Pig to JSON.
#'
#' @return JSON representation of the Pig.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -164,14 +156,12 @@ Pig <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to Pig.
#'
#' @description
#' Validate the input JSON with respect to Pig and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -184,13 +174,11 @@ Pig <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -200,12 +188,9 @@ Pig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -31,8 +31,7 @@ Special <- R6::R6Class(
`empty_string` = NULL,
`_field_list` = c("set_test", "item_self", "item_private", "item_super", "123_number", "array[test]", "empty_string"),
`additional_properties` = list(),
#' Initialize a new Special class.
#'
#' @description
#' Initialize a new Special class.
#'
@ -45,7 +44,6 @@ Special <- R6::R6Class(
#' @param empty_string empty_string
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, additional_properties = NULL, ...) {
if (!is.null(`set_test`)) {
stopifnot(is.vector(`set_test`), length(`set_test`) != 0)
@ -97,13 +95,11 @@ Special <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Special in JSON format
#' @export
toJSON = function() {
SpecialObject <- list()
if (!is.null(self$`set_test`)) {
@ -140,14 +136,12 @@ Special <- R6::R6Class(
SpecialObject
},
#' Deserialize JSON string into an instance of Special
#'
#' @description
#' Deserialize JSON string into an instance of Special
#'
#' @param input_json the JSON input
#' @return the instance of Special
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`set_test`)) {
@ -183,13 +177,11 @@ Special <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Special in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`set_test`)) {
@ -257,14 +249,12 @@ Special <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Special
#'
#' @description
#' Deserialize JSON string into an instance of Special
#'
#' @param input_json the JSON input
#' @return the instance of Special
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`set_test` <- ApiClient$new()$deserializeObj(this_object$`set_test`, "set[character]", loadNamespace("petstore"))
@ -286,55 +276,44 @@ Special <- R6::R6Class(
self
},
#' Validate JSON input with respect to Special
#'
#' @description
#' Validate JSON input with respect to Special and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Special
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,108 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ delete_order } \emph{ Delete purchase order by ID }
#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
#'
#' \itemize{
#' \item \emph{ @param } order_id character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Order not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_inventory } \emph{ Returns pet inventories by status }
#' Returns a map of status codes to quantities
#'
#' \itemize{
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : map(integer)
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_order_by_id } \emph{ Find purchase order by ID }
#' For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
#'
#' \itemize{
#' \item \emph{ @param } order_id integer
#' \item \emph{ @returnType } \link{Order} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Order
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Order not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ place_order } \emph{ Place an order for a pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } order \link{Order}
#' \item \emph{ @returnType } \link{Order} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Order
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid Order
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### delete_order ####################
@ -250,13 +148,11 @@ StoreApi <- R6::R6Class(
"StoreApi",
public = list(
api_client = NULL,
#' Initialize a new StoreApi.
#'
#' @description
#' Initialize a new StoreApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -264,15 +160,14 @@ StoreApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Delete purchase order by ID
#'
#' @description
#' Delete purchase order by ID
#'
#' @param order_id ID of the order that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_order = function(order_id, ...) {
local_var_response <- self$delete_order_with_http_info(order_id, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -285,15 +180,14 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Delete purchase order by ID
#'
#' @description
#' Delete purchase order by ID
#'
#' @param order_id ID of the order that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_order_with_http_info = function(order_id, ...) {
args <- list(...)
query_params <- list()
@ -366,15 +260,14 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Returns pet inventories by status
#'
#' @description
#' Returns pet inventories by status
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return map(integer)
#' @export
get_inventory = function(data_file = NULL, ...) {
local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -387,15 +280,14 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Returns pet inventories by status
#'
#' @description
#' Returns pet inventories by status
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (map(integer)) with additional information such as HTTP status code, headers
#' @export
get_inventory_with_http_info = function(data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -473,16 +365,15 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find purchase order by ID
#'
#' @description
#' Find purchase order by ID
#'
#' @param order_id ID of pet that needs to be fetched
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Order
#' @export
get_order_by_id = function(order_id, data_file = NULL, ...) {
local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -495,16 +386,15 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Find purchase order by ID
#'
#' @description
#' Find purchase order by ID
#'
#' @param order_id ID of pet that needs to be fetched
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Order) with additional information such as HTTP status code, headers
#' @export
get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -602,16 +492,15 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Place an order for a pet
#'
#' @description
#' Place an order for a pet
#'
#' @param order order placed for purchasing the pet
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Order
#' @export
place_order = function(order, data_file = NULL, ...) {
local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -624,16 +513,15 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Place an order for a pet
#'
#' @description
#' Place an order for a pet
#'
#' @param order order placed for purchasing the pet
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Order) with additional information such as HTTP status code, headers
#' @export
place_order_with_http_info = function(order, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -21,8 +21,7 @@ Tag <- R6::R6Class(
`name` = NULL,
`_field_list` = c("id", "name"),
`additional_properties` = list(),
#' Initialize a new Tag class.
#'
#' @description
#' Initialize a new Tag class.
#'
@ -30,7 +29,6 @@ Tag <- R6::R6Class(
#' @param name name
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -50,13 +48,11 @@ Tag <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSON = function() {
TagObject <- list()
if (!is.null(self$`id`)) {
@ -73,14 +69,12 @@ Tag <- R6::R6Class(
TagObject
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -98,13 +92,11 @@ Tag <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -132,14 +124,12 @@ Tag <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -153,53 +143,42 @@ Tag <- R6::R6Class(
self
},
#' Validate JSON input with respect to Tag
#'
#' @description
#' Validate JSON input with respect to Tag and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Tag
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ UpdatePetRequest <- R6::R6Class(
`binaryDataN2Information` = NULL,
`_field_list` = c("jsonData", "binaryDataN2Information"),
`additional_properties` = list(),
#' Initialize a new UpdatePetRequest class.
#'
#' @description
#' Initialize a new UpdatePetRequest class.
#'
@ -30,7 +29,6 @@ UpdatePetRequest <- R6::R6Class(
#' @param binaryDataN2Information binaryDataN2Information
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) {
if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`))
@ -45,13 +43,11 @@ UpdatePetRequest <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return UpdatePetRequest in JSON format
#' @export
toJSON = function() {
UpdatePetRequestObject <- list()
if (!is.null(self$`jsonData`)) {
@ -68,14 +64,12 @@ UpdatePetRequest <- R6::R6Class(
UpdatePetRequestObject
},
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @description
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @param input_json the JSON input
#' @return the instance of UpdatePetRequest
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`jsonData`)) {
@ -95,13 +89,11 @@ UpdatePetRequest <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return UpdatePetRequest in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`jsonData`)) {
@ -129,14 +121,12 @@ UpdatePetRequest <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @description
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @param input_json the JSON input
#' @return the instance of UpdatePetRequest
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA))
@ -150,53 +140,42 @@ UpdatePetRequest <- R6::R6Class(
self
},
#' Validate JSON input with respect to UpdatePetRequest
#'
#' @description
#' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of UpdatePetRequest
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -33,8 +33,7 @@ User <- R6::R6Class(
`userStatus` = NULL,
`_field_list` = c("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"),
`additional_properties` = list(),
#' Initialize a new User class.
#'
#' @description
#' Initialize a new User class.
#'
@ -48,7 +47,6 @@ User <- R6::R6Class(
#' @param userStatus User Status
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -104,13 +102,11 @@ User <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return User in JSON format
#' @export
toJSON = function() {
UserObject <- list()
if (!is.null(self$`id`)) {
@ -151,14 +147,12 @@ User <- R6::R6Class(
UserObject
},
#' Deserialize JSON string into an instance of User
#'
#' @description
#' Deserialize JSON string into an instance of User
#'
#' @param input_json the JSON input
#' @return the instance of User
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -194,13 +188,11 @@ User <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return User in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -276,14 +268,12 @@ User <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of User
#'
#' @description
#' Deserialize JSON string into an instance of User
#'
#' @param input_json the JSON input
#' @return the instance of User
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -303,53 +293,42 @@ User <- R6::R6Class(
self
},
#' Validate JSON input with respect to User
#'
#' @description
#' Validate JSON input with respect to User and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of User
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,187 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ create_user } \emph{ Create user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } user \link{User}
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ create_users_with_array_input } \emph{ Creates list of users with given input array }
#'
#'
#' \itemize{
#' \item \emph{ @param } user list( \link{User} )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ create_users_with_list_input } \emph{ Creates list of users with given input array }
#'
#'
#' \itemize{
#' \item \emph{ @param } user list( \link{User} )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ delete_user } \emph{ Delete user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } username character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid username supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_user_by_name } \emph{ Get user by user name }
#'
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @returnType } \link{User} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : User
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid username supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ login_user } \emph{ Logs user into the system }
#'
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @param } password character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
#' X-Rate-Limit \tab calls per hour allowed by the user \cr
#' X-Expires-After \tab date in UTC when token expires \cr
#' }
#' \item status code : 400 | Invalid username/password supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ logout_user } \emph{ Logs out current logged in user session }
#'
#'
#' \itemize{
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_user } \emph{ Updated user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @param } user \link{User}
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid user supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### create_user ####################
@ -438,13 +257,11 @@ UserApi <- R6::R6Class(
"UserApi",
public = list(
api_client = NULL,
#' Initialize a new UserApi.
#'
#' @description
#' Initialize a new UserApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -452,15 +269,14 @@ UserApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Create user
#'
#' @description
#' Create user
#'
#' @param user Created user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_user = function(user, ...) {
local_var_response <- self$create_user_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -473,15 +289,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Create user
#'
#' @description
#' Create user
#'
#' @param user Created user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_user_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -560,15 +375,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_users_with_array_input = function(user, ...) {
local_var_response <- self$create_users_with_array_input_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -581,15 +395,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_users_with_array_input_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -671,15 +484,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_users_with_list_input = function(user, ...) {
local_var_response <- self$create_users_with_list_input_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -692,15 +504,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_users_with_list_input_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -782,15 +593,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Delete user
#'
#' @description
#' Delete user
#'
#' @param username The name that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_user = function(username, ...) {
local_var_response <- self$delete_user_with_http_info(username, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -803,15 +613,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Delete user
#'
#' @description
#' Delete user
#'
#' @param username The name that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_user_with_http_info = function(username, ...) {
args <- list(...)
query_params <- list()
@ -888,16 +697,15 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Get user by user name
#'
#' @description
#' Get user by user name
#'
#' @param username The name that needs to be fetched. Use user1 for testing.
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return User
#' @export
get_user_by_name = function(username, data_file = NULL, ...) {
local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -910,16 +718,15 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Get user by user name
#'
#' @description
#' Get user by user name
#'
#' @param username The name that needs to be fetched. Use user1 for testing.
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (User) with additional information such as HTTP status code, headers
#' @export
get_user_by_name_with_http_info = function(username, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1005,8 +812,7 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Logs user into the system
#'
#' @description
#' Logs user into the system
#'
@ -1014,8 +820,8 @@ UserApi <- R6::R6Class(
#' @param password The password for login in clear text
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
login_user = function(username, password, data_file = NULL, ...) {
local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1028,8 +834,7 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Logs user into the system
#'
#' @description
#' Logs user into the system
#'
@ -1037,8 +842,8 @@ UserApi <- R6::R6Class(
#' @param password The password for login in clear text
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
login_user_with_http_info = function(username, password, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1138,14 +943,13 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Logs out current logged in user session
#'
#' @description
#' Logs out current logged in user session
#'
#' @param ... Other optional arguments
#'
#' @return void
#' @export
logout_user = function(...) {
local_var_response <- self$logout_user_with_http_info(...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1158,14 +962,13 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Logs out current logged in user session
#'
#' @description
#' Logs out current logged in user session
#'
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
logout_user_with_http_info = function(...) {
args <- list(...)
query_params <- list()
@ -1230,16 +1033,15 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Updated user
#'
#' @description
#' Updated user
#'
#' @param username name that need to be deleted
#' @param user Updated user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
update_user = function(username, user, ...) {
local_var_response <- self$update_user_with_http_info(username, user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1252,16 +1054,15 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Updated user
#'
#' @description
#' Updated user
#'
#' @param username name that need to be deleted
#' @param user Updated user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
update_user_with_http_info = function(username, user, ...) {
args <- list(...)
query_params <- list()

View File

@ -23,8 +23,7 @@ Whale <- R6::R6Class(
`className` = NULL,
`_field_list` = c("hasBaleen", "hasTeeth", "className"),
`additional_properties` = list(),
#' Initialize a new Whale class.
#'
#' @description
#' Initialize a new Whale class.
#'
@ -33,7 +32,6 @@ Whale <- R6::R6Class(
#' @param hasTeeth hasTeeth
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -59,13 +57,11 @@ Whale <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Whale in JSON format
#' @export
toJSON = function() {
WhaleObject <- list()
if (!is.null(self$`hasBaleen`)) {
@ -86,14 +82,12 @@ Whale <- R6::R6Class(
WhaleObject
},
#' Deserialize JSON string into an instance of Whale
#'
#' @description
#' Deserialize JSON string into an instance of Whale
#'
#' @param input_json the JSON input
#' @return the instance of Whale
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`hasBaleen`)) {
@ -114,13 +108,11 @@ Whale <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Whale in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`hasBaleen`)) {
@ -156,14 +148,12 @@ Whale <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Whale
#'
#' @description
#' Deserialize JSON string into an instance of Whale
#'
#' @param input_json the JSON input
#' @return the instance of Whale
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`hasBaleen` <- this_object$`hasBaleen`
@ -178,13 +168,11 @@ Whale <- R6::R6Class(
self
},
#' Validate JSON input with respect to Whale
#'
#' @description
#' Validate JSON input with respect to Whale and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -196,23 +184,19 @@ Whale <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Whale
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -221,13 +205,11 @@ Whale <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -237,12 +219,9 @@ Whale <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -21,8 +21,7 @@ Zebra <- R6::R6Class(
`className` = NULL,
`_field_list` = c("type", "className"),
`additional_properties` = list(),
#' Initialize a new Zebra class.
#'
#' @description
#' Initialize a new Zebra class.
#'
@ -30,7 +29,6 @@ Zebra <- R6::R6Class(
#' @param type type
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -53,13 +51,11 @@ Zebra <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Zebra in JSON format
#' @export
toJSON = function() {
ZebraObject <- list()
if (!is.null(self$`type`)) {
@ -76,14 +72,12 @@ Zebra <- R6::R6Class(
ZebraObject
},
#' Deserialize JSON string into an instance of Zebra
#'
#' @description
#' Deserialize JSON string into an instance of Zebra
#'
#' @param input_json the JSON input
#' @return the instance of Zebra
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`type`)) {
@ -104,13 +98,11 @@ Zebra <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Zebra in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`type`)) {
@ -138,14 +130,12 @@ Zebra <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Zebra
#'
#' @description
#' Deserialize JSON string into an instance of Zebra
#'
#' @param input_json the JSON input
#' @return the instance of Zebra
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`type`) && !(this_object$`type` %in% c("plains", "mountain", "grevys"))) {
@ -162,13 +152,11 @@ Zebra <- R6::R6Class(
self
},
#' Validate JSON input with respect to Zebra
#'
#' @description
#' Validate JSON input with respect to Zebra and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -180,23 +168,19 @@ Zebra <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Zebra
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -205,13 +189,11 @@ Zebra <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -221,12 +203,9 @@ Zebra <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,8 +23,7 @@ AllofTagApiResponse <- R6::R6Class(
`code` = NULL,
`type` = NULL,
`message` = NULL,
#' Initialize a new AllofTagApiResponse class.
#'
#' @description
#' Initialize a new AllofTagApiResponse class.
#'
@ -34,7 +33,6 @@ AllofTagApiResponse <- R6::R6Class(
#' @param type type
#' @param message message
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -67,13 +65,11 @@ AllofTagApiResponse <- R6::R6Class(
self$`message` <- `message`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSON = function() {
AllofTagApiResponseObject <- list()
if (!is.null(self$`id`)) {
@ -98,14 +94,12 @@ AllofTagApiResponse <- R6::R6Class(
}
AllofTagApiResponseObject
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -125,13 +119,11 @@ AllofTagApiResponse <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -178,14 +170,12 @@ AllofTagApiResponse <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -195,53 +185,42 @@ AllofTagApiResponse <- R6::R6Class(
self$`message` <- this_object$`message`
self
},
#' Validate JSON input with respect to AllofTagApiResponse
#'
#' @description
#' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of AllofTagApiResponse
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -19,15 +19,13 @@ Animal <- R6::R6Class(
`color` = NULL,
`_discriminator_property_name` = 'className',
`_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'),
#' Initialize a new Animal class.
#'
#' @description
#' Initialize a new Animal class.
#'
#' @param className className
#' @param color color. Default to "red".
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -42,13 +40,11 @@ Animal <- R6::R6Class(
self$`color` <- `color`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSON = function() {
AnimalObject <- list()
if (!is.null(self$`className`)) {
@ -61,14 +57,12 @@ Animal <- R6::R6Class(
}
AnimalObject
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -79,13 +73,11 @@ Animal <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -108,27 +100,23 @@ Animal <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
self$`color` <- this_object$`color`
self
},
#' Validate JSON input with respect to Animal
#'
#' @description
#' Validate JSON input with respect to Animal and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -140,23 +128,19 @@ Animal <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Animal
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -165,13 +149,11 @@ Animal <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -181,12 +163,9 @@ Animal <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class(
actual_type = NULL,
#' @field any_of a list of object types defined in the anyOf schema.
any_of = list("BasquePig", "DanishPig"),
#' Initialize a new AnyOfPig.
#'
#' @description
#' Initialize a new AnyOfPig.
#'
#' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#' An alias to the method `fromJSON`.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSON = function(input) {
error_messages <- list()
@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class(
stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>",
paste(error_messages, collapse = " >> ")))
},
#' Serialize AnyOfPig to JSON string.
#'
#' @description
#' Serialize AnyOfPig to JSON string.
#'
#' @return JSON string representation of the AnyOfPig.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify((self$actual_instance$toJSONString())))
@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPig to JSON.
#'
#' @description
#' Serialize AnyOfPig to JSON.
#'
#' @return JSON representation of the AnyOfPig.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPig.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPig and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("character", "integer"),
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @description
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self
},
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,15 +23,13 @@ ApiException <- R6::R6Class(
body = NULL,
headers = NULL,
error_object = NULL,
#' Initialize a new ApiException class.
#'
#' @description
#' Initialize a new ApiExceptino class.
#' Initialize a new ApiException class.
#'
#' @param status HTTP status.
#' @param reason Reason of the ApiException.
#' @param http_response HTTP response object.
#' @export
initialize = function(status = NULL, reason = NULL, http_response = NULL) {
if (!is.null(http_response)) {
self$status <- http_response$status_code
@ -51,13 +49,11 @@ ApiException <- R6::R6Class(
self$error_object <- NULL
}
},
#' Returns the string format of ApiException.
#'
#' @description
#' Returns the string format of ApiException.
#'
#' @return the string format of ApiException.
#' @export
toString = function() {
errorMsg <- ""
errorMsg <- paste("status : ", self$status, "\n", sep = "")

View File

@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class(
status_code = NULL,
status_code_desc = NULL,
headers = NULL,
#' Initialize a new ApiResponse class.
#'
#' @description
#' Initialize a new ApiResponse class.
#'
@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class(
#' @param status_code The HTTP response status code.
#' @param status_code_desc The brief description of the HTTP response status code.
#' @param headers The HTTP response headers.
#' @export
initialize = function(content = NULL,
response = NULL,
status_code = NULL,
@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class(
self$headers <- headers
},
#' Return the response as text
#'
#' @description
#' The response is stored as a raw vector. Use this to access the response after
#' converting it to text. If the response is not coercible to text NA is returned.
#'
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
if (is.null(self$response)) {
self$response <- charToRaw(jsonlite::toJSON("NULL"))

View File

@ -17,15 +17,13 @@ BasquePig <- R6::R6Class(
public = list(
`className` = NULL,
`color` = NULL,
#' Initialize a new BasquePig class.
#'
#' @description
#' Initialize a new BasquePig class.
#'
#' @param className className
#' @param color color
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color`, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -40,13 +38,11 @@ BasquePig <- R6::R6Class(
self$`color` <- `color`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSON = function() {
BasquePigObject <- list()
if (!is.null(self$`className`)) {
@ -59,14 +55,12 @@ BasquePig <- R6::R6Class(
}
BasquePigObject
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -77,13 +71,11 @@ BasquePig <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -106,27 +98,23 @@ BasquePig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
self$`color` <- this_object$`color`
self
},
#' Validate JSON input with respect to BasquePig
#'
#' @description
#' Validate JSON input with respect to BasquePig and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -146,23 +134,19 @@ BasquePig <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of BasquePig
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -176,13 +160,11 @@ BasquePig <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -197,12 +179,9 @@ BasquePig <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -20,8 +20,7 @@ Cat <- R6::R6Class(
`className` = NULL,
`color` = NULL,
`declawed` = NULL,
#' Initialize a new Cat class.
#'
#' @description
#' Initialize a new Cat class.
#'
@ -29,7 +28,6 @@ Cat <- R6::R6Class(
#' @param color color. Default to "red".
#' @param declawed declawed
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", `declawed` = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -50,13 +48,11 @@ Cat <- R6::R6Class(
self$`declawed` <- `declawed`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Cat in JSON format
#' @export
toJSON = function() {
CatObject <- list()
if (!is.null(self$`className`)) {
@ -73,14 +69,12 @@ Cat <- R6::R6Class(
}
CatObject
},
#' Deserialize JSON string into an instance of Cat
#'
#' @description
#' Deserialize JSON string into an instance of Cat
#'
#' @param input_json the JSON input
#' @return the instance of Cat
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -94,13 +88,11 @@ Cat <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Cat in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -131,14 +123,12 @@ Cat <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Cat
#'
#' @description
#' Deserialize JSON string into an instance of Cat
#'
#' @param input_json the JSON input
#' @return the instance of Cat
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -146,13 +136,11 @@ Cat <- R6::R6Class(
self$`declawed` <- this_object$`declawed`
self
},
#' Validate JSON input with respect to Cat
#'
#' @description
#' Validate JSON input with respect to Cat and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -164,23 +152,19 @@ Cat <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Cat
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -189,13 +173,11 @@ Cat <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -205,12 +187,9 @@ Cat <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ Category <- R6::R6Class(
public = list(
`id` = NULL,
`name` = NULL,
#' Initialize a new Category class.
#'
#' @description
#' Initialize a new Category class.
#'
#' @param id id
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -40,13 +38,11 @@ Category <- R6::R6Class(
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSON = function() {
CategoryObject <- list()
if (!is.null(self$`id`)) {
@ -59,14 +55,12 @@ Category <- R6::R6Class(
}
CategoryObject
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -77,13 +71,11 @@ Category <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Category in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -106,47 +98,39 @@ Category <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Category
#'
#' @description
#' Deserialize JSON string into an instance of Category
#'
#' @param input_json the JSON input
#' @return the instance of Category
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to Category
#'
#' @description
#' Validate JSON input with respect to Category and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Category
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
return(FALSE)
@ -154,13 +138,11 @@ Category <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
@ -169,12 +151,9 @@ Category <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ DanishPig <- R6::R6Class(
public = list(
`className` = NULL,
`size` = NULL,
#' Initialize a new DanishPig class.
#'
#' @description
#' Initialize a new DanishPig class.
#'
#' @param className className
#' @param size size
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `size`, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -40,13 +38,11 @@ DanishPig <- R6::R6Class(
self$`size` <- `size`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DanishPig in JSON format
#' @export
toJSON = function() {
DanishPigObject <- list()
if (!is.null(self$`className`)) {
@ -59,14 +55,12 @@ DanishPig <- R6::R6Class(
}
DanishPigObject
},
#' Deserialize JSON string into an instance of DanishPig
#'
#' @description
#' Deserialize JSON string into an instance of DanishPig
#'
#' @param input_json the JSON input
#' @return the instance of DanishPig
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -77,13 +71,11 @@ DanishPig <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return DanishPig in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -106,27 +98,23 @@ DanishPig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of DanishPig
#'
#' @description
#' Deserialize JSON string into an instance of DanishPig
#'
#' @param input_json the JSON input
#' @return the instance of DanishPig
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
self$`size` <- this_object$`size`
self
},
#' Validate JSON input with respect to DanishPig
#'
#' @description
#' Validate JSON input with respect to DanishPig and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -146,23 +134,19 @@ DanishPig <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DanishPig
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -176,13 +160,11 @@ DanishPig <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -197,12 +179,9 @@ DanishPig <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -19,8 +19,7 @@ Date <- R6::R6Class(
`className` = NULL,
`percent` = NULL,
`url_property` = NULL,
#' Initialize a new Date class.
#'
#' @description
#' Initialize a new Date class.
#'
@ -28,7 +27,6 @@ Date <- R6::R6Class(
#' @param url_property url_property
#' @param percent using \% in the description
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `url_property`, `percent` = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -53,13 +51,11 @@ Date <- R6::R6Class(
self$`percent` <- `percent`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Date in JSON format
#' @export
toJSON = function() {
DateObject <- list()
if (!is.null(self$`className`)) {
@ -76,14 +72,12 @@ Date <- R6::R6Class(
}
DateObject
},
#' Deserialize JSON string into an instance of Date
#'
#' @description
#' Deserialize JSON string into an instance of Date
#'
#' @param input_json the JSON input
#' @return the instance of Date
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -101,13 +95,11 @@ Date <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Date in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -138,14 +130,12 @@ Date <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Date
#'
#' @description
#' Deserialize JSON string into an instance of Date
#'
#' @param input_json the JSON input
#' @return the instance of Date
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -157,13 +147,11 @@ Date <- R6::R6Class(
self$`url_property` <- this_object$`url_property`
self
},
#' Validate JSON input with respect to Date
#'
#' @description
#' Validate JSON input with respect to Date and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -187,23 +175,19 @@ Date <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Date
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -217,13 +201,11 @@ Date <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -238,12 +220,9 @@ Date <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -20,8 +20,7 @@ Dog <- R6::R6Class(
`className` = NULL,
`color` = NULL,
`breed` = NULL,
#' Initialize a new Dog class.
#'
#' @description
#' Initialize a new Dog class.
#'
@ -29,7 +28,6 @@ Dog <- R6::R6Class(
#' @param color color. Default to "red".
#' @param breed breed
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", `breed` = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -50,13 +48,11 @@ Dog <- R6::R6Class(
self$`breed` <- `breed`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Dog in JSON format
#' @export
toJSON = function() {
DogObject <- list()
if (!is.null(self$`className`)) {
@ -73,14 +69,12 @@ Dog <- R6::R6Class(
}
DogObject
},
#' Deserialize JSON string into an instance of Dog
#'
#' @description
#' Deserialize JSON string into an instance of Dog
#'
#' @param input_json the JSON input
#' @return the instance of Dog
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -94,13 +88,11 @@ Dog <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Dog in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -131,14 +123,12 @@ Dog <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Dog
#'
#' @description
#' Deserialize JSON string into an instance of Dog
#'
#' @param input_json the JSON input
#' @return the instance of Dog
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -146,13 +136,11 @@ Dog <- R6::R6Class(
self$`breed` <- this_object$`breed`
self
},
#' Validate JSON input with respect to Dog
#'
#' @description
#' Validate JSON input with respect to Dog and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -164,23 +152,19 @@ Dog <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Dog
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -189,13 +173,11 @@ Dog <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -205,12 +187,9 @@ Dog <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,107 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ add_pet_optional } \emph{ Add a new pet to the store (optional body) }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_data_file } \emph{ test data_file to ensure it&#39;s escaped correctly }
#'
#'
#' \itemize{
#' \item \emph{ @param } dummy character
#' \item \emph{ @param } var_data_file character
#' \item \emph{ @returnType } \link{User} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : User
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_path_array } \emph{ test array parameter in path }
#'
#'
#' \itemize{
#' \item \emph{ @param } path_array_parameter list( character )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_regular_expression } \emph{ test regular expression to ensure no exception }
#'
#'
#' \itemize{
#' \item \emph{ @param } reg_exp_test character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ fake_set_query } \emph{ test set query parameter }
#'
#'
#' \itemize{
#' \item \emph{ @param } set_dummy list( character )
#' \item \emph{ @param } array_dummy list( character )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### add_pet_optional ####################
@ -270,13 +169,11 @@ FakeApi <- R6::R6Class(
"FakeApi",
public = list(
api_client = NULL,
#' Initialize a new FakeApi.
#'
#' @description
#' Initialize a new FakeApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -284,16 +181,15 @@ FakeApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Add a new pet to the store (optional body)
#'
#' @description
#' Add a new pet to the store (optional body)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
add_pet_optional = function(pet = NULL, data_file = NULL, ...) {
local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -306,16 +202,15 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' Add a new pet to the store (optional body)
#'
#' @description
#' Add a new pet to the store (optional body)
#'
#' @param pet (optional) Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -400,8 +295,7 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test data_file to ensure it's escaped correctly
#'
#' @description
#' test data_file to ensure it's escaped correctly
#'
@ -409,8 +303,8 @@ FakeApi <- R6::R6Class(
#' @param var_data_file (optional) header data file
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return User
#' @export
fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -423,8 +317,7 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test data_file to ensure it's escaped correctly
#'
#' @description
#' test data_file to ensure it's escaped correctly
#'
@ -432,8 +325,8 @@ FakeApi <- R6::R6Class(
#' @param var_data_file (optional) header data file
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (User) with additional information such as HTTP status code, headers
#' @export
fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -520,15 +413,14 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test array parameter in path
#'
#' @description
#' test array parameter in path
#'
#' @param path_array_parameter dummy path parameter
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_path_array = function(path_array_parameter, ...) {
local_var_response <- self$fake_path_array_with_http_info(path_array_parameter, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -541,15 +433,14 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test array parameter in path
#'
#' @description
#' test array parameter in path
#'
#' @param path_array_parameter dummy path parameter
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_path_array_with_http_info = function(path_array_parameter, ...) {
args <- list(...)
query_params <- list()
@ -622,15 +513,14 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test regular expression to ensure no exception
#'
#' @description
#' test regular expression to ensure no exception
#'
#' @param reg_exp_test dummy required parameter
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_regular_expression = function(reg_exp_test, ...) {
local_var_response <- self$fake_regular_expression_with_http_info(reg_exp_test, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -643,15 +533,14 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test regular expression to ensure no exception
#'
#' @description
#' test regular expression to ensure no exception
#'
#' @param reg_exp_test dummy required parameter
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_regular_expression_with_http_info = function(reg_exp_test, ...) {
args <- list(...)
query_params <- list()
@ -728,16 +617,15 @@ FakeApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' test set query parameter
#'
#' @description
#' test set query parameter
#'
#' @param set_dummy set query
#' @param array_dummy array query
#' @param ... Other optional arguments
#'
#' @return void
#' @export
fake_set_query = function(set_dummy, array_dummy, ...) {
local_var_response <- self$fake_set_query_with_http_info(set_dummy, array_dummy, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -750,16 +638,15 @@ FakeApi <- R6::R6Class(
local_var_response
}
},
#' test set query parameter
#'
#' @description
#' test set query parameter
#'
#' @param set_dummy set query
#' @param array_dummy array query
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
fake_set_query_with_http_info = function(set_dummy, array_dummy, ...) {
args <- list(...)
query_params <- list()

View File

@ -43,8 +43,7 @@ FormatTest <- R6::R6Class(
`password` = NULL,
`pattern_with_digits` = NULL,
`pattern_with_digits_and_delimiter` = NULL,
#' Initialize a new FormatTest class.
#'
#' @description
#' Initialize a new FormatTest class.
#'
@ -64,7 +63,6 @@ FormatTest <- R6::R6Class(
#' @param pattern_with_digits A string that is a 10 digit number. Can have leading zeros.
#' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
#' @param ... Other optional arguments.
#' @export
initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, ...) {
if (!missing(`number`)) {
self$`number` <- `number`
@ -148,13 +146,11 @@ FormatTest <- R6::R6Class(
self$`pattern_with_digits_and_delimiter` <- `pattern_with_digits_and_delimiter`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return FormatTest in JSON format
#' @export
toJSON = function() {
FormatTestObject <- list()
if (!is.null(self$`integer`)) {
@ -219,14 +215,12 @@ FormatTest <- R6::R6Class(
}
FormatTestObject
},
#' Deserialize JSON string into an instance of FormatTest
#'
#' @description
#' Deserialize JSON string into an instance of FormatTest
#'
#' @param input_json the JSON input
#' @return the instance of FormatTest
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`integer`)) {
@ -276,13 +270,11 @@ FormatTest <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return FormatTest in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`integer`)) {
@ -409,14 +401,12 @@ FormatTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of FormatTest
#'
#' @description
#' Deserialize JSON string into an instance of FormatTest
#'
#' @param input_json the JSON input
#' @return the instance of FormatTest
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`integer` <- this_object$`integer`
@ -436,13 +426,11 @@ FormatTest <- R6::R6Class(
self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter`
self
},
#' Validate JSON input with respect to FormatTest
#'
#' @description
#' Validate JSON input with respect to FormatTest and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `number`
@ -472,23 +460,19 @@ FormatTest <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of FormatTest
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
if (self$`integer` > 100) {
return(FALSE)
@ -566,13 +550,11 @@ FormatTest <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
if (self$`integer` > 100) {
@ -651,12 +633,9 @@ FormatTest <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -15,14 +15,12 @@ JustModel <- R6::R6Class(
"JustModel",
public = list(
`property` = NULL,
#' Initialize a new JustModel class.
#'
#' @description
#' Initialize a new JustModel class.
#'
#' @param property property
#' @param ... Other optional arguments.
#' @export
initialize = function(`property` = NULL, ...) {
if (!is.null(`property`)) {
if (!(is.character(`property`) && length(`property`) == 1)) {
@ -31,13 +29,11 @@ JustModel <- R6::R6Class(
self$`property` <- `property`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return JustModel in JSON format
#' @export
toJSON = function() {
JustModelObject <- list()
if (!is.null(self$`property`)) {
@ -46,14 +42,12 @@ JustModel <- R6::R6Class(
}
JustModelObject
},
#' Deserialize JSON string into an instance of JustModel
#'
#' @description
#' Deserialize JSON string into an instance of JustModel
#'
#' @param input_json the JSON input
#' @return the instance of JustModel
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`property`)) {
@ -61,13 +55,11 @@ JustModel <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return JustModel in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`property`)) {
@ -82,66 +74,53 @@ JustModel <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of JustModel
#'
#' @description
#' Deserialize JSON string into an instance of JustModel
#'
#' @param input_json the JSON input
#' @return the instance of JustModel
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`property` <- this_object$`property`
self
},
#' Validate JSON input with respect to JustModel
#'
#' @description
#' Validate JSON input with respect to JustModel and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of JustModel
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ Mammal <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("Whale", "Zebra"),
#' Initialize a new Mammal.
#'
#' @description
#' Initialize a new Mammal.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "Whale", "Zebra"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ Mammal <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of Mammal.
#'
#' @description
#' Deserialize JSON string into an instance of Mammal.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of Mammal.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of Mammal.
#'
#' @description
#' Deserialize JSON string into an instance of Mammal.
#'
#' @param input The input JSON.
#'
#' @return An instance of Mammal.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -110,13 +106,11 @@ Mammal <- R6::R6Class(
self
},
#' Serialize Mammal to JSON string.
#'
#' @description
#' Serialize Mammal to JSON string.
#'
#' @return JSON string representation of the Mammal.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -124,13 +118,11 @@ Mammal <- R6::R6Class(
NULL
}
},
#' Serialize Mammal to JSON.
#'
#' @description
#' Serialize Mammal to JSON.
#'
#' @return JSON representation of the Mammal.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -138,14 +130,12 @@ Mammal <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to Mammal.
#'
#' @description
#' Validate the input JSON with respect to Mammal and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -158,13 +148,11 @@ Mammal <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -174,12 +162,9 @@ Mammal <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -19,8 +19,7 @@ ModelApiResponse <- R6::R6Class(
`code` = NULL,
`type` = NULL,
`message` = NULL,
#' Initialize a new ModelApiResponse class.
#'
#' @description
#' Initialize a new ModelApiResponse class.
#'
@ -28,7 +27,6 @@ ModelApiResponse <- R6::R6Class(
#' @param type type
#' @param message message
#' @param ... Other optional arguments.
#' @export
initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, ...) {
if (!is.null(`code`)) {
if (!(is.numeric(`code`) && length(`code`) == 1)) {
@ -49,13 +47,11 @@ ModelApiResponse <- R6::R6Class(
self$`message` <- `message`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return ModelApiResponse in JSON format
#' @export
toJSON = function() {
ModelApiResponseObject <- list()
if (!is.null(self$`code`)) {
@ -72,14 +68,12 @@ ModelApiResponse <- R6::R6Class(
}
ModelApiResponseObject
},
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of ModelApiResponse
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`code`)) {
@ -93,13 +87,11 @@ ModelApiResponse <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return ModelApiResponse in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`code`)) {
@ -130,14 +122,12 @@ ModelApiResponse <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of ModelApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of ModelApiResponse
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`code` <- this_object$`code`
@ -145,53 +135,42 @@ ModelApiResponse <- R6::R6Class(
self$`message` <- this_object$`message`
self
},
#' Validate JSON input with respect to ModelApiResponse
#'
#' @description
#' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of ModelApiResponse
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ NestedOneOf <- R6::R6Class(
public = list(
`size` = NULL,
`nested_pig` = NULL,
#' Initialize a new NestedOneOf class.
#'
#' @description
#' Initialize a new NestedOneOf class.
#'
#' @param size size
#' @param nested_pig nested_pig
#' @param ... Other optional arguments.
#' @export
initialize = function(`size` = NULL, `nested_pig` = NULL, ...) {
if (!is.null(`size`)) {
if (!(is.numeric(`size`) && length(`size`) == 1)) {
@ -38,13 +36,11 @@ NestedOneOf <- R6::R6Class(
self$`nested_pig` <- `nested_pig`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NestedOneOf in JSON format
#' @export
toJSON = function() {
NestedOneOfObject <- list()
if (!is.null(self$`size`)) {
@ -57,14 +53,12 @@ NestedOneOf <- R6::R6Class(
}
NestedOneOfObject
},
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @description
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @param input_json the JSON input
#' @return the instance of NestedOneOf
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`size`)) {
@ -77,13 +71,11 @@ NestedOneOf <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return NestedOneOf in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`size`)) {
@ -106,67 +98,54 @@ NestedOneOf <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @description
#' Deserialize JSON string into an instance of NestedOneOf
#'
#' @param input_json the JSON input
#' @return the instance of NestedOneOf
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`size` <- this_object$`size`
self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA))
self
},
#' Validate JSON input with respect to NestedOneOf
#'
#' @description
#' Validate JSON input with respect to NestedOneOf and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of NestedOneOf
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("character", "integer"),
#' Initialize a new OneOfPrimitiveTypeTest.
#'
#' @description
#' Initialize a new OneOfPrimitiveTypeTest.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of OneOfPrimitiveTypeTest.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
#'
#' @param input The input JSON.
#'
#' @return An instance of OneOfPrimitiveTypeTest.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -112,13 +108,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
self
},
#' Serialize OneOfPrimitiveTypeTest to JSON string.
#'
#' @description
#' Serialize OneOfPrimitiveTypeTest to JSON string.
#'
#' @return JSON string representation of the OneOfPrimitiveTypeTest.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -126,13 +120,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Serialize OneOfPrimitiveTypeTest to JSON.
#'
#' @description
#' Serialize OneOfPrimitiveTypeTest to JSON.
#'
#' @return JSON representation of the OneOfPrimitiveTypeTest.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -140,14 +132,12 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest.
#'
#' @description
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -160,13 +150,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -176,12 +164,9 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -25,8 +25,7 @@ Order <- R6::R6Class(
`shipDate` = NULL,
`status` = NULL,
`complete` = NULL,
#' Initialize a new Order class.
#'
#' @description
#' Initialize a new Order class.
#'
@ -37,7 +36,6 @@ Order <- R6::R6Class(
#' @param status Order Status
#' @param complete complete. Default to FALSE.
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -79,13 +77,11 @@ Order <- R6::R6Class(
self$`complete` <- `complete`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Order in JSON format
#' @export
toJSON = function() {
OrderObject <- list()
if (!is.null(self$`id`)) {
@ -114,14 +110,12 @@ Order <- R6::R6Class(
}
OrderObject
},
#' Deserialize JSON string into an instance of Order
#'
#' @description
#' Deserialize JSON string into an instance of Order
#'
#' @param input_json the JSON input
#' @return the instance of Order
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -147,13 +141,11 @@ Order <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Order in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -208,14 +200,12 @@ Order <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Order
#'
#' @description
#' Deserialize JSON string into an instance of Order
#'
#' @param input_json the JSON input
#' @return the instance of Order
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -229,53 +219,42 @@ Order <- R6::R6Class(
self$`complete` <- this_object$`complete`
self
},
#' Validate JSON input with respect to Order
#'
#' @description
#' Validate JSON input with respect to Order and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Order
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -25,8 +25,7 @@ Pet <- R6::R6Class(
`photoUrls` = NULL,
`tags` = NULL,
`status` = NULL,
#' Initialize a new Pet class.
#'
#' @description
#' Initialize a new Pet class.
#'
@ -37,7 +36,6 @@ Pet <- R6::R6Class(
#' @param tags tags
#' @param status pet status in the store
#' @param ... Other optional arguments.
#' @export
initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) {
if (!missing(`name`)) {
if (!(is.character(`name`) && length(`name`) == 1)) {
@ -75,13 +73,11 @@ Pet <- R6::R6Class(
self$`status` <- `status`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSON = function() {
PetObject <- list()
if (!is.null(self$`id`)) {
@ -110,14 +106,12 @@ Pet <- R6::R6Class(
}
PetObject
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -145,13 +139,11 @@ Pet <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Pet in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -206,14 +198,12 @@ Pet <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Pet
#'
#' @description
#' Deserialize JSON string into an instance of Pet
#'
#' @param input_json the JSON input
#' @return the instance of Pet
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -227,13 +217,11 @@ Pet <- R6::R6Class(
self$`status` <- this_object$`status`
self
},
#' Validate JSON input with respect to Pet
#'
#' @description
#' Validate JSON input with respect to Pet and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `name`
@ -252,23 +240,19 @@ Pet <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Pet
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `name` is null
if (is.null(self$`name`)) {
@ -282,13 +266,11 @@ Pet <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `name` is null
@ -303,12 +285,9 @@ Pet <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,278 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ add_pet } \emph{ Add a new pet to the store }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ delete_pet } \emph{ Deletes a pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } api_key character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid pet value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ find_pets_by_status } \emph{ Finds Pets by status }
#' Multiple status values can be provided with comma separated strings
#'
#' \itemize{
#' \item \emph{ @param } status Enum < [available, pending, sold] >
#' \item \emph{ @returnType } list( \link{Pet} ) \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : array[Pet]
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid status value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ find_pets_by_tags } \emph{ Finds Pets by tags }
#' Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
#'
#' \itemize{
#' \item \emph{ @param } tags list( character )
#' \item \emph{ @returnType } list( \link{Pet} ) \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : array[Pet]
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid tag value
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_pet_by_id } \emph{ Find pet by ID }
#' Returns a single pet
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_pet_by_id_streaming } \emph{ Find pet by ID (streaming) }
#' Returns a single pet
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ test_header } \emph{ Header test }
#' Header test
#'
#' \itemize{
#' \item \emph{ @param } header_test_int integer
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_pet } \emph{ Update an existing pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet \link{Pet}
#' \item \emph{ @returnType } \link{Pet} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Pet
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Pet not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 405 | Validation exception
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_pet_with_form } \emph{ Updates a pet in the store with form data }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } name character
#' \item \emph{ @param } status character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 405 | Invalid input
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ upload_file } \emph{ uploads an image }
#'
#'
#' \itemize{
#' \item \emph{ @param } pet_id integer
#' \item \emph{ @param } additional_metadata character
#' \item \emph{ @param } file data.frame
#' \item \emph{ @returnType } \link{ModelApiResponse} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : ModelApiResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### add_pet ####################
@ -644,13 +372,11 @@ PetApi <- R6::R6Class(
"PetApi",
public = list(
api_client = NULL,
#' Initialize a new PetApi.
#'
#' @description
#' Initialize a new PetApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -658,16 +384,15 @@ PetApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Add a new pet to the store
#'
#' @description
#' Add a new pet to the store
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
add_pet = function(pet, data_file = NULL, ...) {
local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -680,16 +405,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Add a new pet to the store
#'
#' @description
#' Add a new pet to the store
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
add_pet_with_http_info = function(pet, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -781,16 +505,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Deletes a pet
#'
#' @description
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_pet = function(pet_id, api_key = NULL, ...) {
local_var_response <- self$delete_pet_with_http_info(pet_id, api_key, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -803,16 +526,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Deletes a pet
#'
#' @description
#' Deletes a pet
#'
#' @param pet_id Pet id to delete
#' @param api_key (optional) No description
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_pet_with_http_info = function(pet_id, api_key = NULL, ...) {
args <- list(...)
query_params <- list()
@ -891,16 +613,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Finds Pets by status
#'
#' @description
#' Finds Pets by status
#'
#' @param status Status values that need to be considered for filter
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return array[Pet]
#' @export
find_pets_by_status = function(status, data_file = NULL, ...) {
local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -913,16 +634,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Finds Pets by status
#'
#' @description
#' Finds Pets by status
#'
#' @param status Status values that need to be considered for filter
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (array[Pet]) with additional information such as HTTP status code, headers
#' @export
find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1019,16 +739,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Finds Pets by tags
#'
#' @description
#' Finds Pets by tags
#'
#' @param tags Tags to filter by
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return array[Pet]
#' @export
find_pets_by_tags = function(tags, data_file = NULL, ...) {
local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1041,16 +760,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Finds Pets by tags
#'
#' @description
#' Finds Pets by tags
#'
#' @param tags Tags to filter by
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (array[Pet]) with additional information such as HTTP status code, headers
#' @export
find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1135,16 +853,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find pet by ID
#'
#' @description
#' Find pet by ID
#'
#' @param pet_id ID of pet to return
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
get_pet_by_id = function(pet_id, data_file = NULL, ...) {
local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1157,16 +874,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Find pet by ID
#'
#' @description
#' Find pet by ID
#'
#' @param pet_id ID of pet to return
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1256,8 +972,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find pet by ID (streaming)
#'
#' @description
#' Find pet by ID (streaming)
#'
@ -1265,8 +980,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) {
local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ...)
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
@ -1283,8 +998,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Find pet by ID (streaming)
#'
#' @description
#' Find pet by ID (streaming)
#'
@ -1292,8 +1006,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1388,8 +1102,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Header test
#'
#' @description
#' Header test
#'
@ -1397,8 +1110,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) {
local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ...)
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
@ -1415,8 +1128,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Header test
#'
#' @description
#' Header test
#'
@ -1424,8 +1136,8 @@ PetApi <- R6::R6Class(
#' @param stream_callback (optional) callback function to process the data stream
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1518,16 +1230,15 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Update an existing pet
#'
#' @description
#' Update an existing pet
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Pet
#' @export
update_pet = function(pet, data_file = NULL, ...) {
local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1540,16 +1251,15 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Update an existing pet
#'
#' @description
#' Update an existing pet
#'
#' @param pet Pet object that needs to be added to the store
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Pet) with additional information such as HTTP status code, headers
#' @export
update_pet_with_http_info = function(pet, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1640,8 +1350,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Updates a pet in the store with form data
#'
#' @description
#' Updates a pet in the store with form data
#'
@ -1649,8 +1358,8 @@ PetApi <- R6::R6Class(
#' @param name (optional) Updated name of the pet
#' @param status (optional) Updated status of the pet
#' @param ... Other optional arguments
#'
#' @return void
#' @export
update_pet_with_form = function(pet_id, name = NULL, status = NULL, ...) {
local_var_response <- self$update_pet_with_form_with_http_info(pet_id, name, status, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1663,8 +1372,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' Updates a pet in the store with form data
#'
#' @description
#' Updates a pet in the store with form data
#'
@ -1672,8 +1380,8 @@ PetApi <- R6::R6Class(
#' @param name (optional) Updated name of the pet
#' @param status (optional) Updated status of the pet
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
update_pet_with_form_with_http_info = function(pet_id, name = NULL, status = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1750,8 +1458,7 @@ PetApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' uploads an image
#'
#' @description
#' uploads an image
#'
@ -1760,8 +1467,8 @@ PetApi <- R6::R6Class(
#' @param file (optional) file to upload
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return ModelApiResponse
#' @export
upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) {
local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1774,8 +1481,7 @@ PetApi <- R6::R6Class(
local_var_response
}
},
#' uploads an image
#'
#' @description
#' uploads an image
#'
@ -1784,8 +1490,8 @@ PetApi <- R6::R6Class(
#' @param file (optional) file to upload
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers
#' @export
upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -15,14 +15,12 @@ PetMap <- R6::R6Class(
"PetMap",
public = list(
`pet` = NULL,
#' Initialize a new PetMap class.
#'
#' @description
#' Initialize a new PetMap class.
#'
#' @param pet pet
#' @param ... Other optional arguments.
#' @export
initialize = function(`pet` = NULL, ...) {
if (!is.null(`pet`)) {
stopifnot(is.vector(`pet`), length(`pet`) != 0)
@ -30,13 +28,11 @@ PetMap <- R6::R6Class(
self$`pet` <- `pet`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return PetMap in JSON format
#' @export
toJSON = function() {
PetMapObject <- list()
if (!is.null(self$`pet`)) {
@ -45,14 +41,12 @@ PetMap <- R6::R6Class(
}
PetMapObject
},
#' Deserialize JSON string into an instance of PetMap
#'
#' @description
#' Deserialize JSON string into an instance of PetMap
#'
#' @param input_json the JSON input
#' @return the instance of PetMap
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`pet`)) {
@ -60,13 +54,11 @@ PetMap <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return PetMap in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`pet`)) {
@ -81,66 +73,53 @@ PetMap <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of PetMap
#'
#' @description
#' Deserialize JSON string into an instance of PetMap
#'
#' @param input_json the JSON input
#' @return the instance of PetMap
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`pet` <- ApiClient$new()$deserializeObj(this_object$`pet`, "map(character)", loadNamespace("petstore"))
self
},
#' Validate JSON input with respect to PetMap
#'
#' @description
#' Validate JSON input with respect to PetMap and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of PetMap
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ Pig <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("BasquePig", "DanishPig"),
#' Initialize a new Pig.
#'
#' @description
#' Initialize a new Pig.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ Pig <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of Pig.
#'
#' @description
#' Deserialize JSON string into an instance of Pig.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of Pig.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of Pig.
#'
#' @description
#' Deserialize JSON string into an instance of Pig.
#'
#' @param input The input JSON.
#'
#' @return An instance of Pig.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -110,13 +106,11 @@ Pig <- R6::R6Class(
self
},
#' Serialize Pig to JSON string.
#'
#' @description
#' Serialize Pig to JSON string.
#'
#' @return JSON string representation of the Pig.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -124,13 +118,11 @@ Pig <- R6::R6Class(
NULL
}
},
#' Serialize Pig to JSON.
#'
#' @description
#' Serialize Pig to JSON.
#'
#' @return JSON representation of the Pig.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -138,14 +130,12 @@ Pig <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to Pig.
#'
#' @description
#' Validate the input JSON with respect to Pig and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -158,13 +148,11 @@ Pig <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -174,12 +162,9 @@ Pig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -27,8 +27,7 @@ Special <- R6::R6Class(
`123_number` = NULL,
`array[test]` = NULL,
`empty_string` = NULL,
#' Initialize a new Special class.
#'
#' @description
#' Initialize a new Special class.
#'
@ -40,7 +39,6 @@ Special <- R6::R6Class(
#' @param array[test] array[test]
#' @param empty_string empty_string
#' @param ... Other optional arguments.
#' @export
initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ...) {
if (!is.null(`set_test`)) {
stopifnot(is.vector(`set_test`), length(`set_test`) != 0)
@ -87,13 +85,11 @@ Special <- R6::R6Class(
self$`empty_string` <- `empty_string`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Special in JSON format
#' @export
toJSON = function() {
SpecialObject <- list()
if (!is.null(self$`set_test`)) {
@ -126,14 +122,12 @@ Special <- R6::R6Class(
}
SpecialObject
},
#' Deserialize JSON string into an instance of Special
#'
#' @description
#' Deserialize JSON string into an instance of Special
#'
#' @param input_json the JSON input
#' @return the instance of Special
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`set_test`)) {
@ -162,13 +156,11 @@ Special <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Special in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`set_test`)) {
@ -231,14 +223,12 @@ Special <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Special
#'
#' @description
#' Deserialize JSON string into an instance of Special
#'
#' @param input_json the JSON input
#' @return the instance of Special
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`set_test` <- ApiClient$new()$deserializeObj(this_object$`set_test`, "set[character]", loadNamespace("petstore"))
@ -253,55 +243,44 @@ Special <- R6::R6Class(
self$`empty_string` <- this_object$`empty_string`
self
},
#' Validate JSON input with respect to Special
#'
#' @description
#' Validate JSON input with respect to Special and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Special
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,108 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ delete_order } \emph{ Delete purchase order by ID }
#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
#'
#' \itemize{
#' \item \emph{ @param } order_id character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Order not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_inventory } \emph{ Returns pet inventories by status }
#' Returns a map of status codes to quantities
#'
#' \itemize{
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : map(integer)
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_order_by_id } \emph{ Find purchase order by ID }
#' For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
#'
#' \itemize{
#' \item \emph{ @param } order_id integer
#' \item \emph{ @returnType } \link{Order} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Order
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid ID supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Order not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ place_order } \emph{ Place an order for a pet }
#'
#'
#' \itemize{
#' \item \emph{ @param } order \link{Order}
#' \item \emph{ @returnType } \link{Order} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : Order
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid Order
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### delete_order ####################
@ -250,13 +148,11 @@ StoreApi <- R6::R6Class(
"StoreApi",
public = list(
api_client = NULL,
#' Initialize a new StoreApi.
#'
#' @description
#' Initialize a new StoreApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -264,15 +160,14 @@ StoreApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Delete purchase order by ID
#'
#' @description
#' Delete purchase order by ID
#'
#' @param order_id ID of the order that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_order = function(order_id, ...) {
local_var_response <- self$delete_order_with_http_info(order_id, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -285,15 +180,14 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Delete purchase order by ID
#'
#' @description
#' Delete purchase order by ID
#'
#' @param order_id ID of the order that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_order_with_http_info = function(order_id, ...) {
args <- list(...)
query_params <- list()
@ -366,15 +260,14 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Returns pet inventories by status
#'
#' @description
#' Returns pet inventories by status
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return map(integer)
#' @export
get_inventory = function(data_file = NULL, ...) {
local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -387,15 +280,14 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Returns pet inventories by status
#'
#' @description
#' Returns pet inventories by status
#'
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (map(integer)) with additional information such as HTTP status code, headers
#' @export
get_inventory_with_http_info = function(data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -473,16 +365,15 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Find purchase order by ID
#'
#' @description
#' Find purchase order by ID
#'
#' @param order_id ID of pet that needs to be fetched
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Order
#' @export
get_order_by_id = function(order_id, data_file = NULL, ...) {
local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -495,16 +386,15 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Find purchase order by ID
#'
#' @description
#' Find purchase order by ID
#'
#' @param order_id ID of pet that needs to be fetched
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Order) with additional information such as HTTP status code, headers
#' @export
get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -602,16 +492,15 @@ StoreApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Place an order for a pet
#'
#' @description
#' Place an order for a pet
#'
#' @param order order placed for purchasing the pet
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return Order
#' @export
place_order = function(order, data_file = NULL, ...) {
local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -624,16 +513,15 @@ StoreApi <- R6::R6Class(
local_var_response
}
},
#' Place an order for a pet
#'
#' @description
#' Place an order for a pet
#'
#' @param order order placed for purchasing the pet
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (Order) with additional information such as HTTP status code, headers
#' @export
place_order_with_http_info = function(order, data_file = NULL, ...) {
args <- list(...)
query_params <- list()

View File

@ -17,15 +17,13 @@ Tag <- R6::R6Class(
public = list(
`id` = NULL,
`name` = NULL,
#' Initialize a new Tag class.
#'
#' @description
#' Initialize a new Tag class.
#'
#' @param id id
#' @param name name
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -40,13 +38,11 @@ Tag <- R6::R6Class(
self$`name` <- `name`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSON = function() {
TagObject <- list()
if (!is.null(self$`id`)) {
@ -59,14 +55,12 @@ Tag <- R6::R6Class(
}
TagObject
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -77,13 +71,11 @@ Tag <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Tag in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -106,67 +98,54 @@ Tag <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Tag
#'
#' @description
#' Deserialize JSON string into an instance of Tag
#'
#' @param input_json the JSON input
#' @return the instance of Tag
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
self$`name` <- this_object$`name`
self
},
#' Validate JSON input with respect to Tag
#'
#' @description
#' Validate JSON input with respect to Tag and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Tag
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ UpdatePetRequest <- R6::R6Class(
public = list(
`jsonData` = NULL,
`binaryDataN2Information` = NULL,
#' Initialize a new UpdatePetRequest class.
#'
#' @description
#' Initialize a new UpdatePetRequest class.
#'
#' @param jsonData jsonData
#' @param binaryDataN2Information binaryDataN2Information
#' @param ... Other optional arguments.
#' @export
initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, ...) {
if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`))
@ -35,13 +33,11 @@ UpdatePetRequest <- R6::R6Class(
self$`binaryDataN2Information` <- `binaryDataN2Information`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return UpdatePetRequest in JSON format
#' @export
toJSON = function() {
UpdatePetRequestObject <- list()
if (!is.null(self$`jsonData`)) {
@ -54,14 +50,12 @@ UpdatePetRequest <- R6::R6Class(
}
UpdatePetRequestObject
},
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @description
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @param input_json the JSON input
#' @return the instance of UpdatePetRequest
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`jsonData`)) {
@ -74,13 +68,11 @@ UpdatePetRequest <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return UpdatePetRequest in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`jsonData`)) {
@ -103,67 +95,54 @@ UpdatePetRequest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @description
#' Deserialize JSON string into an instance of UpdatePetRequest
#'
#' @param input_json the JSON input
#' @return the instance of UpdatePetRequest
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA))
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
self
},
#' Validate JSON input with respect to UpdatePetRequest
#'
#' @description
#' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of UpdatePetRequest
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -29,8 +29,7 @@ User <- R6::R6Class(
`password` = NULL,
`phone` = NULL,
`userStatus` = NULL,
#' Initialize a new User class.
#'
#' @description
#' Initialize a new User class.
#'
@ -43,7 +42,6 @@ User <- R6::R6Class(
#' @param phone phone
#' @param userStatus User Status
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -94,13 +92,11 @@ User <- R6::R6Class(
self$`userStatus` <- `userStatus`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return User in JSON format
#' @export
toJSON = function() {
UserObject <- list()
if (!is.null(self$`id`)) {
@ -137,14 +133,12 @@ User <- R6::R6Class(
}
UserObject
},
#' Deserialize JSON string into an instance of User
#'
#' @description
#' Deserialize JSON string into an instance of User
#'
#' @param input_json the JSON input
#' @return the instance of User
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -173,13 +167,11 @@ User <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return User in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -250,14 +242,12 @@ User <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of User
#'
#' @description
#' Deserialize JSON string into an instance of User
#'
#' @param input_json the JSON input
#' @return the instance of User
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -270,53 +260,42 @@ User <- R6::R6Class(
self$`userStatus` <- this_object$`userStatus`
self
},
#' Validate JSON input with respect to User
#'
#' @description
#' Validate JSON input with respect to User and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of User
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -11,187 +11,6 @@
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ create_user } \emph{ Create user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } user \link{User}
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ create_users_with_array_input } \emph{ Creates list of users with given input array }
#'
#'
#' \itemize{
#' \item \emph{ @param } user list( \link{User} )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ create_users_with_list_input } \emph{ Creates list of users with given input array }
#'
#'
#' \itemize{
#' \item \emph{ @param } user list( \link{User} )
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ delete_user } \emph{ Delete user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } username character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid username supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ get_user_by_name } \emph{ Get user by user name }
#'
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @returnType } \link{User} \cr
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : User
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Invalid username supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ login_user } \emph{ Logs user into the system }
#'
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @param } password character
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 200 | successful operation
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
#' X-Rate-Limit \tab calls per hour allowed by the user \cr
#' X-Expires-After \tab date in UTC when token expires \cr
#' }
#' \item status code : 400 | Invalid username/password supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ logout_user } \emph{ Logs out current logged in user session }
#'
#'
#' \itemize{
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 0 | successful operation
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ update_user } \emph{ Updated user }
#' This can only be done by the logged in user.
#'
#' \itemize{
#' \item \emph{ @param } username character
#' \item \emph{ @param } user \link{User}
#'
#' \item On encountering errors, an error of subclass ApiException will be thrown.
#'
#' \item status code : 400 | Invalid user supplied
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### create_user ####################
@ -438,13 +257,11 @@ UserApi <- R6::R6Class(
"UserApi",
public = list(
api_client = NULL,
#' Initialize a new UserApi.
#'
#' @description
#' Initialize a new UserApi.
#'
#' @param api_client An instance of API client.
#' @export
initialize = function(api_client) {
if (!missing(api_client)) {
self$api_client <- api_client
@ -452,15 +269,14 @@ UserApi <- R6::R6Class(
self$api_client <- ApiClient$new()
}
},
#' Create user
#'
#' @description
#' Create user
#'
#' @param user Created user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_user = function(user, ...) {
local_var_response <- self$create_user_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -473,15 +289,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Create user
#'
#' @description
#' Create user
#'
#' @param user Created user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_user_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -560,15 +375,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_users_with_array_input = function(user, ...) {
local_var_response <- self$create_users_with_array_input_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -581,15 +395,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_users_with_array_input_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -671,15 +484,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
create_users_with_list_input = function(user, ...) {
local_var_response <- self$create_users_with_list_input_with_http_info(user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -692,15 +504,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Creates list of users with given input array
#'
#' @description
#' Creates list of users with given input array
#'
#' @param user List of user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
create_users_with_list_input_with_http_info = function(user, ...) {
args <- list(...)
query_params <- list()
@ -782,15 +593,14 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Delete user
#'
#' @description
#' Delete user
#'
#' @param username The name that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return void
#' @export
delete_user = function(username, ...) {
local_var_response <- self$delete_user_with_http_info(username, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -803,15 +613,14 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Delete user
#'
#' @description
#' Delete user
#'
#' @param username The name that needs to be deleted
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
delete_user_with_http_info = function(username, ...) {
args <- list(...)
query_params <- list()
@ -888,16 +697,15 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Get user by user name
#'
#' @description
#' Get user by user name
#'
#' @param username The name that needs to be fetched. Use user1 for testing.
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return User
#' @export
get_user_by_name = function(username, data_file = NULL, ...) {
local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -910,16 +718,15 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Get user by user name
#'
#' @description
#' Get user by user name
#'
#' @param username The name that needs to be fetched. Use user1 for testing.
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (User) with additional information such as HTTP status code, headers
#' @export
get_user_by_name_with_http_info = function(username, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1005,8 +812,7 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Logs user into the system
#'
#' @description
#' Logs user into the system
#'
@ -1014,8 +820,8 @@ UserApi <- R6::R6Class(
#' @param password The password for login in clear text
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return character
#' @export
login_user = function(username, password, data_file = NULL, ...) {
local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1028,8 +834,7 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Logs user into the system
#'
#' @description
#' Logs user into the system
#'
@ -1037,8 +842,8 @@ UserApi <- R6::R6Class(
#' @param password The password for login in clear text
#' @param data_file (optional) name of the data file to save the result
#' @param ... Other optional arguments
#'
#' @return API response (character) with additional information such as HTTP status code, headers
#' @export
login_user_with_http_info = function(username, password, data_file = NULL, ...) {
args <- list(...)
query_params <- list()
@ -1138,14 +943,13 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Logs out current logged in user session
#'
#' @description
#' Logs out current logged in user session
#'
#' @param ... Other optional arguments
#'
#' @return void
#' @export
logout_user = function(...) {
local_var_response <- self$logout_user_with_http_info(...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1158,14 +962,13 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Logs out current logged in user session
#'
#' @description
#' Logs out current logged in user session
#'
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
logout_user_with_http_info = function(...) {
args <- list(...)
query_params <- list()
@ -1230,16 +1033,15 @@ UserApi <- R6::R6Class(
ApiException = ApiException$new(http_response = local_var_resp))
}
},
#' Updated user
#'
#' @description
#' Updated user
#'
#' @param username name that need to be deleted
#' @param user Updated user object
#' @param ... Other optional arguments
#'
#' @return void
#' @export
update_user = function(username, user, ...) {
local_var_response <- self$update_user_with_http_info(username, user, ...)
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
@ -1252,16 +1054,15 @@ UserApi <- R6::R6Class(
local_var_response
}
},
#' Updated user
#'
#' @description
#' Updated user
#'
#' @param username name that need to be deleted
#' @param user Updated user object
#' @param ... Other optional arguments
#'
#' @return API response (void) with additional information such as HTTP status code, headers
#' @export
update_user_with_http_info = function(username, user, ...) {
args <- list(...)
query_params <- list()

View File

@ -19,8 +19,7 @@ Whale <- R6::R6Class(
`hasBaleen` = NULL,
`hasTeeth` = NULL,
`className` = NULL,
#' Initialize a new Whale class.
#'
#' @description
#' Initialize a new Whale class.
#'
@ -28,7 +27,6 @@ Whale <- R6::R6Class(
#' @param hasBaleen hasBaleen
#' @param hasTeeth hasTeeth
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -49,13 +47,11 @@ Whale <- R6::R6Class(
self$`hasTeeth` <- `hasTeeth`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Whale in JSON format
#' @export
toJSON = function() {
WhaleObject <- list()
if (!is.null(self$`hasBaleen`)) {
@ -72,14 +68,12 @@ Whale <- R6::R6Class(
}
WhaleObject
},
#' Deserialize JSON string into an instance of Whale
#'
#' @description
#' Deserialize JSON string into an instance of Whale
#'
#' @param input_json the JSON input
#' @return the instance of Whale
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`hasBaleen`)) {
@ -93,13 +87,11 @@ Whale <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Whale in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`hasBaleen`)) {
@ -130,14 +122,12 @@ Whale <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Whale
#'
#' @description
#' Deserialize JSON string into an instance of Whale
#'
#' @param input_json the JSON input
#' @return the instance of Whale
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`hasBaleen` <- this_object$`hasBaleen`
@ -145,13 +135,11 @@ Whale <- R6::R6Class(
self$`className` <- this_object$`className`
self
},
#' Validate JSON input with respect to Whale
#'
#' @description
#' Validate JSON input with respect to Whale and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -163,23 +151,19 @@ Whale <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Whale
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -188,13 +172,11 @@ Whale <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -204,12 +186,9 @@ Whale <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,15 +17,13 @@ Zebra <- R6::R6Class(
public = list(
`type` = NULL,
`className` = NULL,
#' Initialize a new Zebra class.
#'
#' @description
#' Initialize a new Zebra class.
#'
#' @param className className
#' @param type type
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `type` = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -43,13 +41,11 @@ Zebra <- R6::R6Class(
self$`type` <- `type`
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Zebra in JSON format
#' @export
toJSON = function() {
ZebraObject <- list()
if (!is.null(self$`type`)) {
@ -62,14 +58,12 @@ Zebra <- R6::R6Class(
}
ZebraObject
},
#' Deserialize JSON string into an instance of Zebra
#'
#' @description
#' Deserialize JSON string into an instance of Zebra
#'
#' @param input_json the JSON input
#' @return the instance of Zebra
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`type`)) {
@ -83,13 +77,11 @@ Zebra <- R6::R6Class(
}
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Zebra in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`type`)) {
@ -112,14 +104,12 @@ Zebra <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
},
#' Deserialize JSON string into an instance of Zebra
#'
#' @description
#' Deserialize JSON string into an instance of Zebra
#'
#' @param input_json the JSON input
#' @return the instance of Zebra
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`type`) && !(this_object$`type` %in% c("plains", "mountain", "grevys"))) {
@ -129,13 +119,11 @@ Zebra <- R6::R6Class(
self$`className` <- this_object$`className`
self
},
#' Validate JSON input with respect to Zebra
#'
#' @description
#' Validate JSON input with respect to Zebra and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -147,23 +135,19 @@ Zebra <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Zebra
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -172,13 +156,11 @@ Zebra <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -188,12 +170,9 @@ Zebra <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -27,8 +27,7 @@ AllofTagApiResponse <- R6::R6Class(
`message` = NULL,
`_field_list` = c("id", "name", "code", "type", "message"),
`additional_properties` = list(),
#' Initialize a new AllofTagApiResponse class.
#'
#' @description
#' Initialize a new AllofTagApiResponse class.
#'
@ -39,7 +38,6 @@ AllofTagApiResponse <- R6::R6Class(
#' @param message message
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
if (!is.null(`id`)) {
if (!(is.numeric(`id`) && length(`id`) == 1)) {
@ -77,13 +75,11 @@ AllofTagApiResponse <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSON = function() {
AllofTagApiResponseObject <- list()
if (!is.null(self$`id`)) {
@ -112,14 +108,12 @@ AllofTagApiResponse <- R6::R6Class(
AllofTagApiResponseObject
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`id`)) {
@ -146,13 +140,11 @@ AllofTagApiResponse <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return AllofTagApiResponse in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
@ -204,14 +196,12 @@ AllofTagApiResponse <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @description
#' Deserialize JSON string into an instance of AllofTagApiResponse
#'
#' @param input_json the JSON input
#' @return the instance of AllofTagApiResponse
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`id` <- this_object$`id`
@ -228,53 +218,42 @@ AllofTagApiResponse <- R6::R6Class(
self
},
#' Validate JSON input with respect to AllofTagApiResponse
#'
#' @description
#' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of AllofTagApiResponse
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -23,8 +23,7 @@ Animal <- R6::R6Class(
`additional_properties` = list(),
`_discriminator_property_name` = 'className',
`_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'),
#' Initialize a new Animal class.
#'
#' @description
#' Initialize a new Animal class.
#'
@ -32,7 +31,6 @@ Animal <- R6::R6Class(
#' @param color color. Default to "red".
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -52,13 +50,11 @@ Animal <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSON = function() {
AnimalObject <- list()
if (!is.null(self$`className`)) {
@ -75,14 +71,12 @@ Animal <- R6::R6Class(
AnimalObject
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -100,13 +94,11 @@ Animal <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return Animal in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -134,14 +126,12 @@ Animal <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of Animal
#'
#' @description
#' Deserialize JSON string into an instance of Animal
#'
#' @param input_json the JSON input
#' @return the instance of Animal
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -155,13 +145,11 @@ Animal <- R6::R6Class(
self
},
#' Validate JSON input with respect to Animal
#'
#' @description
#' Validate JSON input with respect to Animal and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -173,23 +161,19 @@ Animal <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Animal
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -198,13 +182,11 @@ Animal <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -214,12 +196,9 @@ Animal <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class(
actual_type = NULL,
#' @field any_of a list of object types defined in the anyOf schema.
any_of = list("BasquePig", "DanishPig"),
#' Initialize a new AnyOfPig.
#'
#' @description
#' Initialize a new AnyOfPig.
#'
#' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#' An alias to the method `fromJSON`.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPig.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPig.
#' @export
fromJSON = function(input) {
error_messages <- list()
@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class(
stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>",
paste(error_messages, collapse = " >> ")))
},
#' Serialize AnyOfPig to JSON string.
#'
#' @description
#' Serialize AnyOfPig to JSON string.
#'
#' @return JSON string representation of the AnyOfPig.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify((self$actual_instance$toJSONString())))
@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPig to JSON.
#'
#' @description
#' Serialize AnyOfPig to JSON.
#'
#' @return JSON representation of the AnyOfPig.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPig.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPig and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
actual_type = NULL,
#' @field one_of a list of types defined in the oneOf schema.
one_of = list("character", "integer"),
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @description
#' Initialize a new AnyOfPrimitiveTypeTest.
#'
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
#' @export
initialize = function(instance = NULL) {
if (is.null(instance)) {
# do nothing
@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
get(class(instance)[[1]], pos = -1)$classname))
}
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#' An alias to the method `fromJSON` .
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSONString = function(input) {
self$fromJSON(input)
},
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @description
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
#'
#' @param input The input JSON.
#'
#' @return An instance of AnyOfPrimitiveTypeTest.
#' @export
fromJSON = function(input) {
matched <- 0 # match counter
matched_schemas <- list() #names of matched schemas
@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self
},
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
#'
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSONString = function() {
if (!is.null(self$actual_instance)) {
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @description
#' Serialize AnyOfPrimitiveTypeTest to JSON.
#'
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
#' @export
toJSON = function() {
if (!is.null(self$actual_instance)) {
self$actual_instance$toJSON()
@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
NULL
}
},
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
#'
#' @description
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
#' throw exception if invalid.
#'
#' @param input The input JSON.
#' @export
validateJSON = function(input) {
# backup current values
actual_instance_bak <- self$actual_instance
@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
self$actual_instance <- actual_instance_bak
self$actual_type <- actual_type_bak
},
#' Returns the string representation of the instance.
#'
#' @description
#' Returns the string representation of the instance.
#'
#' @return The string representation of the instance.
#' @export
toString = function() {
jsoncontent <- c(
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

View File

@ -150,8 +150,7 @@ ApiClient <- R6::R6Class(
self$max_retry_attempts <- max_retry_attempts
}
},
#' Prepare to make an API call with the retry logic.
#'
#' @description
#' Prepare to make an API call with the retry logic.
#'
@ -166,8 +165,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process the data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
CallApi = function(url, method, query_params, header_params, form_params,
file_params, accepts, content_types,
body, stream_callback = NULL, ...) {
@ -197,8 +196,7 @@ ApiClient <- R6::R6Class(
resp
},
#' Make an API call
#'
#' @description
#' Make an API call
#'
@ -213,8 +211,8 @@ ApiClient <- R6::R6Class(
#' @param body The HTTP request body.
#' @param stream_callback Callback function to process data stream
#' @param ... Other optional arguments.
#'
#' @return HTTP response
#' @export
Execute = function(url, method, query_params, header_params,
form_params, file_params,
accepts, content_types,
@ -297,7 +295,7 @@ ApiClient <- R6::R6Class(
# return ApiResponse
api_response <- ApiResponse$new()
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code <- httr::status_code(httr_response)
api_response$status_code_desc <- httr::http_status(httr_response)$reason
api_response$response <- httr::content(httr_response, "raw")
api_response$headers <- httr::headers(httr_response)
@ -305,32 +303,31 @@ ApiClient <- R6::R6Class(
api_response
}
},
#' Deserialize the content of API response to the given type.
#'
#' @description
#' Deserialize the content of API response to the given type.
#'
#' @param raw_response Raw response.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserialize = function(raw_response, return_type, pkg_env) {
resp_obj <- jsonlite::fromJSON(raw_response)
self$deserializeObj(resp_obj, return_type, pkg_env)
},
#' Deserialize the response from jsonlite object based on the given type
#'
#' @description
#' Deserialize the response from jsonlite object based on the given type
#' by handling complex and nested types by iterating recursively
#' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.,
#' Example return_types will be like "array[integer]", "map(Pet)",
#' "array[map(Tag)]", etc.,
#'
#' @param obj Response object.
#' @param return_type R return type.
#' @param pkg_env Package environment.
#'
#' @return Deserialized object.
#' @export
deserializeObj = function(obj, return_type, pkg_env) {
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
@ -392,15 +389,14 @@ ApiClient <- R6::R6Class(
}
return_obj
},
#' Return a property header (for accept or content-type).
#'
#' @description
#' Return a property header (for accept or content-type). If JSON-related MIME is found,
#' return it. Otherwise, return the first one, if any.
#'
#' @param headers A list of headers
#'
#' @return A header (e.g. 'application/json')
#' @export
select_header = function(headers) {
if (length(headers) == 0) {
return(invisible(NULL))

View File

@ -23,15 +23,13 @@ ApiException <- R6::R6Class(
body = NULL,
headers = NULL,
error_object = NULL,
#' Initialize a new ApiException class.
#'
#' @description
#' Initialize a new ApiExceptino class.
#' Initialize a new ApiException class.
#'
#' @param status HTTP status.
#' @param reason Reason of the ApiException.
#' @param http_response HTTP response object.
#' @export
initialize = function(status = NULL, reason = NULL, http_response = NULL) {
if (!is.null(http_response)) {
self$status <- http_response$status_code
@ -51,13 +49,11 @@ ApiException <- R6::R6Class(
self$error_object <- NULL
}
},
#' Returns the string format of ApiException.
#'
#' @description
#' Returns the string format of ApiException.
#'
#' @return the string format of ApiException.
#' @export
toString = function() {
errorMsg <- ""
errorMsg <- paste("status : ", self$status, "\n", sep = "")

View File

@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class(
status_code = NULL,
status_code_desc = NULL,
headers = NULL,
#' Initialize a new ApiResponse class.
#'
#' @description
#' Initialize a new ApiResponse class.
#'
@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class(
#' @param status_code The HTTP response status code.
#' @param status_code_desc The brief description of the HTTP response status code.
#' @param headers The HTTP response headers.
#' @export
initialize = function(content = NULL,
response = NULL,
status_code = NULL,
@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class(
self$headers <- headers
},
#' Return the response as text
#'
#' @description
#' The response is stored as a raw vector. Use this to access the response after
#' converting it to text. If the response is not coercible to text NA is returned.
#'
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
if (is.null(self$response)) {
self$response <- charToRaw(jsonlite::toJSON("NULL"))

View File

@ -21,8 +21,7 @@ BasquePig <- R6::R6Class(
`color` = NULL,
`_field_list` = c("className", "color"),
`additional_properties` = list(),
#' Initialize a new BasquePig class.
#'
#' @description
#' Initialize a new BasquePig class.
#'
@ -30,7 +29,6 @@ BasquePig <- R6::R6Class(
#' @param color color
#' @param additional_properties additional properties (optional)
#' @param ... Other optional arguments.
#' @export
initialize = function(`className`, `color`, additional_properties = NULL, ...) {
if (!missing(`className`)) {
if (!(is.character(`className`) && length(`className`) == 1)) {
@ -50,13 +48,11 @@ BasquePig <- R6::R6Class(
}
}
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSON = function() {
BasquePigObject <- list()
if (!is.null(self$`className`)) {
@ -73,14 +69,12 @@ BasquePig <- R6::R6Class(
BasquePigObject
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSON = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
if (!is.null(this_object$`className`)) {
@ -98,13 +92,11 @@ BasquePig <- R6::R6Class(
self
},
#' To JSON string
#'
#' @description
#' To JSON String
#'
#' @return BasquePig in JSON format
#' @export
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`className`)) {
@ -132,14 +124,12 @@ BasquePig <- R6::R6Class(
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
},
#' Deserialize JSON string into an instance of BasquePig
#'
#' @description
#' Deserialize JSON string into an instance of BasquePig
#'
#' @param input_json the JSON input
#' @return the instance of BasquePig
#' @export
fromJSONString = function(input_json) {
this_object <- jsonlite::fromJSON(input_json)
self$`className` <- this_object$`className`
@ -153,13 +143,11 @@ BasquePig <- R6::R6Class(
self
},
#' Validate JSON input with respect to BasquePig
#'
#' @description
#' Validate JSON input with respect to BasquePig and throw an exception if invalid
#'
#' @param input the JSON input
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
# check the required field `className`
@ -179,23 +167,19 @@ BasquePig <- R6::R6Class(
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of BasquePig
#' @export
toString = function() {
self$toJSONString()
},
#' Return true if the values in all fields are valid.
#'
#' @description
#' Return true if the values in all fields are valid.
#'
#' @return true if the values in all fields are valid.
#' @export
isValid = function() {
# check if the required `className` is null
if (is.null(self$`className`)) {
@ -209,13 +193,11 @@ BasquePig <- R6::R6Class(
TRUE
},
#' Return a list of invalid fields (if any).
#'
#' @description
#' Return a list of invalid fields (if any).
#'
#' @return A list of invalid fields (if any).
#' @export
getInvalidFields = function() {
invalid_fields <- list()
# check if the required `className` is null
@ -230,12 +212,9 @@ BasquePig <- R6::R6Class(
invalid_fields
},
#' Print the object
#'
#' @description
#' Print the object
#'
#' @export
print = function() {
print(jsonlite::prettify(self$toJSONString()))
invisible(self)

Some files were not shown because too many files have changed in this diff Show More