R - better code format (#13691)

* r - beter code format

* better readme

* update instruction
This commit is contained in:
William Cheng 2022-10-15 10:47:27 +08:00 committed by GitHub
parent 3ed6503075
commit daf475a96d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
80 changed files with 943 additions and 960 deletions

View File

@ -63,6 +63,17 @@ install.packages("{{{packageName}}}_{{{packageVersion}}}.tar.gz", repos = NULL,
library({{{packageName}}}) library({{{packageName}}})
``` ```
### Reformat code
To reformat code using [styler](https://styler.r-lib.org/index.html), please run the following in the R console:
```R
install.packages("remotes")
remotes::install_github("r-lib/styler@v1.7.0.9003")
library("styler")
style_dir()
```
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *{{basePath}}* All URIs are relative to *{{basePath}}*

View File

@ -50,9 +50,7 @@
{{/isAdditionalPropertiesTrue}} {{/isAdditionalPropertiesTrue}}
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function({{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...) {
{{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...
) {
{{#requiredVars}} {{#requiredVars}}
if (!missing(`{{name}}`)) { if (!missing(`{{name}}`)) {
{{^isContainer}} {{^isContainer}}
@ -619,7 +617,8 @@
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -40,9 +40,7 @@ AllofTagApiResponse <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -270,7 +268,8 @@ AllofTagApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -33,9 +33,7 @@ Animal <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) {
`className`, `color` = "red", additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -219,7 +217,8 @@ Animal <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ BasquePig <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color`, additional_properties = NULL, ...) {
`className`, `color`, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -233,7 +231,8 @@ BasquePig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -35,9 +35,7 @@ Cat <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) {
`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -241,7 +239,8 @@ Cat <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -28,9 +28,7 @@ CatAllOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`declawed` = NULL, additional_properties = NULL, ...) {
`declawed` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`declawed`)) { if (!is.null(`declawed`)) {
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
@ -178,7 +176,8 @@ CatAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Category <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -209,7 +207,8 @@ Category <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ DanishPig <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `size`, additional_properties = NULL, ...) {
`className`, `size`, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -233,7 +231,8 @@ DanishPig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ Date <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) {
`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -272,7 +270,8 @@ Date <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -35,9 +35,7 @@ Dog <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) {
`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -241,7 +239,8 @@ Dog <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -28,9 +28,7 @@ DogAllOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`breed` = NULL, additional_properties = NULL, ...) {
`breed` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`breed`)) { if (!is.null(`breed`)) {
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
@ -178,7 +176,8 @@ DogAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ ModelApiResponse <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`code`)) { if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1) stopifnot(is.numeric(`code`), length(`code`) == 1)
self$`code` <- `code` self$`code` <- `code`
@ -224,7 +222,8 @@ ModelApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ NestedOneOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) {
`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`size`)) { if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size` self$`size` <- `size`
@ -203,7 +201,8 @@ NestedOneOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -43,9 +43,7 @@ Order <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) {
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -302,7 +300,8 @@ Order <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -43,9 +43,7 @@ Pet <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) {
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...
) {
if (!missing(`name`)) { if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
@ -339,7 +337,8 @@ Pet <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -46,9 +46,7 @@ Special <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( 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, ...) {
`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`)) { if (!is.null(`set_test`)) {
stopifnot(is.vector(`set_test`), length(`set_test`) != 0) stopifnot(is.vector(`set_test`), length(`set_test`) != 0)
sapply(`set_test`, function(x) stopifnot(is.character(x))) sapply(`set_test`, function(x) stopifnot(is.character(x)))
@ -328,7 +326,8 @@ Special <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Tag <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -201,7 +199,8 @@ Tag <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ UpdatePetRequest <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) {
`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`jsonData`)) { if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`)) stopifnot(R6::is.R6(`jsonData`))
self$`jsonData` <- `jsonData` self$`jsonData` <- `jsonData`
@ -202,7 +200,8 @@ UpdatePetRequest <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -49,9 +49,7 @@ User <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) {
`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.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -339,7 +337,8 @@ User <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ Whale <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) {
`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -240,7 +238,8 @@ Whale <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Zebra <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) {
`className`, `type` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -226,7 +224,8 @@ Zebra <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source")
library(petstore) library(petstore)
``` ```
### Reformat code
To reformat code using [styler](https://styler.r-lib.org/index.html), please run the following in the R console:
```R
install.packages("remotes")
remotes::install_github("r-lib/styler@v1.7.0.9003")
library("styler")
style_dir()
```
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*

View File

@ -35,9 +35,7 @@ AllofTagApiResponse <- R6::R6Class(
#' @param message message #' @param message message
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...) {
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -237,7 +235,8 @@ AllofTagApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -28,9 +28,7 @@ Animal <- R6::R6Class(
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", ...) {
`className`, `color` = "red", ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -186,7 +184,8 @@ Animal <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ BasquePig <- R6::R6Class(
#' @param color color #' @param color color
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color`, ...) {
`className`, `color`, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -200,7 +198,8 @@ BasquePig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -30,9 +30,7 @@ Cat <- R6::R6Class(
#' @param declawed declawed #' @param declawed declawed
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `declawed` = NULL, ...) {
`className`, `color` = "red", `declawed` = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -208,7 +206,8 @@ Cat <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -23,9 +23,7 @@ CatAllOf <- R6::R6Class(
#' @param declawed declawed #' @param declawed declawed
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`declawed` = NULL, ...) {
`declawed` = NULL, ...
) {
if (!is.null(`declawed`)) { if (!is.null(`declawed`)) {
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
@ -145,7 +143,8 @@ CatAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ Category <- R6::R6Class(
#' @param name name #' @param name name
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, ...) {
`id` = NULL, `name` = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -176,7 +174,8 @@ Category <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ DanishPig <- R6::R6Class(
#' @param size size #' @param size size
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `size`, ...) {
`className`, `size`, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -200,7 +198,8 @@ DanishPig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -29,9 +29,7 @@ Date <- R6::R6Class(
#' @param percent_description using \% in the description #' @param percent_description using \% in the description
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `url_property`, `percent_description` = NULL, ...) {
`className`, `url_property`, `percent_description` = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -239,7 +237,8 @@ Date <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -30,9 +30,7 @@ Dog <- R6::R6Class(
#' @param breed breed #' @param breed breed
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `breed` = NULL, ...) {
`className`, `color` = "red", `breed` = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -208,7 +206,8 @@ Dog <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -23,9 +23,7 @@ DogAllOf <- R6::R6Class(
#' @param breed breed #' @param breed breed
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`breed` = NULL, ...) {
`breed` = NULL, ...
) {
if (!is.null(`breed`)) { if (!is.null(`breed`)) {
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
@ -145,7 +143,8 @@ DogAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -29,9 +29,7 @@ ModelApiResponse <- R6::R6Class(
#' @param message message #' @param message message
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, ...) {
`code` = NULL, `type` = NULL, `message` = NULL, ...
) {
if (!is.null(`code`)) { if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1) stopifnot(is.numeric(`code`), length(`code`) == 1)
self$`code` <- `code` self$`code` <- `code`
@ -191,7 +189,8 @@ ModelApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ NestedOneOf <- R6::R6Class(
#' @param nested_pig nested_pig #' @param nested_pig nested_pig
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`size` = NULL, `nested_pig` = NULL, ...) {
`size` = NULL, `nested_pig` = NULL, ...
) {
if (!is.null(`size`)) { if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size` self$`size` <- `size`
@ -170,7 +168,8 @@ NestedOneOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -38,9 +38,7 @@ Order <- R6::R6Class(
#' @param complete complete. Default to FALSE. #' @param complete complete. Default to FALSE.
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...) {
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -269,7 +267,8 @@ Order <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -38,9 +38,7 @@ Pet <- R6::R6Class(
#' @param status pet status in the store #' @param status pet status in the store
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) {
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...
) {
if (!missing(`name`)) { if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
@ -306,7 +304,8 @@ Pet <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -41,9 +41,7 @@ Special <- R6::R6Class(
#' @param empty_string empty_string #' @param empty_string empty_string
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ...) {
`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`)) { if (!is.null(`set_test`)) {
stopifnot(is.vector(`set_test`), length(`set_test`) != 0) stopifnot(is.vector(`set_test`), length(`set_test`) != 0)
sapply(`set_test`, function(x) stopifnot(is.character(x))) sapply(`set_test`, function(x) stopifnot(is.character(x)))
@ -295,7 +293,8 @@ Special <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ Tag <- R6::R6Class(
#' @param name name #' @param name name
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, ...) {
`id` = NULL, `name` = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -168,7 +166,8 @@ Tag <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ UpdatePetRequest <- R6::R6Class(
#' @param binaryDataN2Information binaryDataN2Information #' @param binaryDataN2Information binaryDataN2Information
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, ...) {
`jsonData` = NULL, `binaryDataN2Information` = NULL, ...
) {
if (!is.null(`jsonData`)) { if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`)) stopifnot(R6::is.R6(`jsonData`))
self$`jsonData` <- `jsonData` self$`jsonData` <- `jsonData`
@ -169,7 +167,8 @@ UpdatePetRequest <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -44,9 +44,7 @@ User <- R6::R6Class(
#' @param userStatus User Status #' @param userStatus User Status
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...) {
`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -306,7 +304,8 @@ User <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -29,9 +29,7 @@ Whale <- R6::R6Class(
#' @param hasTeeth hasTeeth #' @param hasTeeth hasTeeth
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...) {
`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -207,7 +205,8 @@ Whale <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -26,9 +26,7 @@ Zebra <- R6::R6Class(
#' @param type type #' @param type type
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `type` = NULL, ...) {
`className`, `type` = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -193,7 +191,8 @@ Zebra <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source")
library(petstore) library(petstore)
``` ```
### Reformat code
To reformat code using [styler](https://styler.r-lib.org/index.html), please run the following in the R console:
```R
install.packages("remotes")
remotes::install_github("r-lib/styler@v1.7.0.9003")
library("styler")
style_dir()
```
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*

View File

@ -40,9 +40,7 @@ AllofTagApiResponse <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -270,7 +268,8 @@ AllofTagApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -33,9 +33,7 @@ Animal <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) {
`className`, `color` = "red", additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -219,7 +217,8 @@ Animal <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ BasquePig <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color`, additional_properties = NULL, ...) {
`className`, `color`, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -233,7 +231,8 @@ BasquePig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -35,9 +35,7 @@ Cat <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) {
`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -241,7 +239,8 @@ Cat <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -28,9 +28,7 @@ CatAllOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`declawed` = NULL, additional_properties = NULL, ...) {
`declawed` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`declawed`)) { if (!is.null(`declawed`)) {
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
@ -178,7 +176,8 @@ CatAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Category <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -209,7 +207,8 @@ Category <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ DanishPig <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `size`, additional_properties = NULL, ...) {
`className`, `size`, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -233,7 +231,8 @@ DanishPig <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ Date <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) {
`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -272,7 +270,8 @@ Date <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -35,9 +35,7 @@ Dog <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) {
`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -241,7 +239,8 @@ Dog <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -28,9 +28,7 @@ DogAllOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`breed` = NULL, additional_properties = NULL, ...) {
`breed` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`breed`)) { if (!is.null(`breed`)) {
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
@ -178,7 +176,8 @@ DogAllOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ ModelApiResponse <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) {
`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`code`)) { if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1) stopifnot(is.numeric(`code`), length(`code`) == 1)
self$`code` <- `code` self$`code` <- `code`
@ -224,7 +222,8 @@ ModelApiResponse <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ NestedOneOf <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) {
`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`size`)) { if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size` self$`size` <- `size`
@ -203,7 +201,8 @@ NestedOneOf <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -43,9 +43,7 @@ Order <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) {
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -302,7 +300,8 @@ Order <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -43,9 +43,7 @@ Pet <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) {
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...
) {
if (!missing(`name`)) { if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
@ -339,7 +337,8 @@ Pet <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -46,9 +46,7 @@ Special <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( 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, ...) {
`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`)) { if (!is.null(`set_test`)) {
stopifnot(is.vector(`set_test`), length(`set_test`) != 0) stopifnot(is.vector(`set_test`), length(`set_test`) != 0)
sapply(`set_test`, function(x) stopifnot(is.character(x))) sapply(`set_test`, function(x) stopifnot(is.character(x)))
@ -328,7 +326,8 @@ Special <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Tag <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) {
`id` = NULL, `name` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -201,7 +199,8 @@ Tag <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ UpdatePetRequest <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) {
`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...
) {
if (!is.null(`jsonData`)) { if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`)) stopifnot(R6::is.R6(`jsonData`))
self$`jsonData` <- `jsonData` self$`jsonData` <- `jsonData`
@ -202,7 +200,8 @@ UpdatePetRequest <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -49,9 +49,7 @@ User <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) {
`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.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id` self$`id` <- `id`
@ -339,7 +337,8 @@ User <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -34,9 +34,7 @@ Whale <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) {
`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -240,7 +238,8 @@ Whale <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -31,9 +31,7 @@ Zebra <- R6::R6Class(
#' @param additional_properties additonal properties (optional) #' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) {
`className`, `type` = NULL, additional_properties = NULL, ...
) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
self$`className` <- `className` self$`className` <- `className`
@ -226,7 +224,8 @@ Zebra <- R6::R6Class(
print = function() { print = function() {
print(jsonlite::prettify(self$toJSONString())) print(jsonlite::prettify(self$toJSONString()))
invisible(self) invisible(self)
}), }
),
# Lock the class to prevent modifications to the method or field # Lock the class to prevent modifications to the method or field
lock_class = TRUE lock_class = TRUE
) )

View File

@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source")
library(petstore) library(petstore)
``` ```
### Reformat code
To reformat code using [styler](https://styler.r-lib.org/index.html), please run the following in the R console:
```R
install.packages("remotes")
remotes::install_github("r-lib/styler@v1.7.0.9003")
library("styler")
style_dir()
```
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*