From daf475a96d23f4280138f6866ee094cff34cf8e9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 15 Oct 2022 10:47:27 +0800 Subject: [PATCH] R - better code format (#13691) * r - beter code format * better readme * update instruction --- .../src/main/resources/r/README.mustache | 11 ++++ .../src/main/resources/r/api.mustache | 44 ++++++------- .../src/main/resources/r/api_client.mustache | 2 +- .../main/resources/r/modelGeneric.mustache | 65 +++++++++---------- .../R/allof_tag_api_response.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/animal.R | 25 ++++--- .../petstore/R-httr2-wrapper/R/basque_pig.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/cat.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/cat_all_of.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/category.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/danish_pig.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/date.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/dog.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/dog_all_of.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/fake_api.R | 16 ++--- .../R-httr2-wrapper/R/model_api_response.R | 23 ++++--- .../R-httr2-wrapper/R/nested_one_of.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/order.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/pet.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/pet_api.R | 64 +++++++++--------- .../petstore/R-httr2-wrapper/R/special.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/store_api.R | 24 +++---- .../client/petstore/R-httr2-wrapper/R/tag.R | 23 ++++--- .../R-httr2-wrapper/R/update_pet_request.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/user.R | 23 ++++--- .../petstore/R-httr2-wrapper/R/user_api.R | 16 ++--- .../client/petstore/R-httr2-wrapper/R/whale.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/R/zebra.R | 23 ++++--- .../client/petstore/R-httr2-wrapper/README.md | 11 ++++ .../R-httr2/R/allof_tag_api_response.R | 23 ++++--- samples/client/petstore/R-httr2/R/animal.R | 25 ++++--- .../client/petstore/R-httr2/R/basque_pig.R | 23 ++++--- samples/client/petstore/R-httr2/R/cat.R | 23 ++++--- .../client/petstore/R-httr2/R/cat_all_of.R | 23 ++++--- samples/client/petstore/R-httr2/R/category.R | 23 ++++--- .../client/petstore/R-httr2/R/danish_pig.R | 23 ++++--- samples/client/petstore/R-httr2/R/date.R | 23 ++++--- samples/client/petstore/R-httr2/R/dog.R | 23 ++++--- .../client/petstore/R-httr2/R/dog_all_of.R | 23 ++++--- samples/client/petstore/R-httr2/R/fake_api.R | 16 ++--- .../petstore/R-httr2/R/model_api_response.R | 23 ++++--- .../client/petstore/R-httr2/R/nested_one_of.R | 23 ++++--- samples/client/petstore/R-httr2/R/order.R | 23 ++++--- samples/client/petstore/R-httr2/R/pet.R | 23 ++++--- samples/client/petstore/R-httr2/R/pet_api.R | 64 +++++++++--------- samples/client/petstore/R-httr2/R/special.R | 23 ++++--- samples/client/petstore/R-httr2/R/store_api.R | 24 +++---- samples/client/petstore/R-httr2/R/tag.R | 23 ++++--- .../petstore/R-httr2/R/update_pet_request.R | 23 ++++--- samples/client/petstore/R-httr2/R/user.R | 23 ++++--- samples/client/petstore/R-httr2/R/user_api.R | 16 ++--- samples/client/petstore/R-httr2/R/whale.R | 23 ++++--- samples/client/petstore/R-httr2/R/zebra.R | 23 ++++--- samples/client/petstore/R-httr2/README.md | 11 ++++ .../petstore/R/R/allof_tag_api_response.R | 23 ++++--- samples/client/petstore/R/R/animal.R | 25 ++++--- samples/client/petstore/R/R/api_client.R | 2 +- samples/client/petstore/R/R/basque_pig.R | 23 ++++--- samples/client/petstore/R/R/cat.R | 23 ++++--- samples/client/petstore/R/R/cat_all_of.R | 23 ++++--- samples/client/petstore/R/R/category.R | 23 ++++--- samples/client/petstore/R/R/danish_pig.R | 23 ++++--- samples/client/petstore/R/R/date.R | 23 ++++--- samples/client/petstore/R/R/dog.R | 23 ++++--- samples/client/petstore/R/R/dog_all_of.R | 23 ++++--- samples/client/petstore/R/R/fake_api.R | 16 ++--- .../client/petstore/R/R/model_api_response.R | 23 ++++--- samples/client/petstore/R/R/nested_one_of.R | 23 ++++--- samples/client/petstore/R/R/order.R | 23 ++++--- samples/client/petstore/R/R/pet.R | 23 ++++--- samples/client/petstore/R/R/pet_api.R | 64 +++++++++--------- samples/client/petstore/R/R/special.R | 23 ++++--- samples/client/petstore/R/R/store_api.R | 24 +++---- samples/client/petstore/R/R/tag.R | 23 ++++--- .../client/petstore/R/R/update_pet_request.R | 23 ++++--- samples/client/petstore/R/R/user.R | 23 ++++--- samples/client/petstore/R/R/user_api.R | 16 ++--- samples/client/petstore/R/R/whale.R | 23 ++++--- samples/client/petstore/R/R/zebra.R | 23 ++++--- samples/client/petstore/R/README.md | 11 ++++ 80 files changed, 943 insertions(+), 960 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache index efcf2732fa2..961894a3f2f 100644 --- a/modules/openapi-generator/src/main/resources/r/README.mustache +++ b/modules/openapi-generator/src/main/resources/r/README.mustache @@ -63,6 +63,17 @@ install.packages("{{{packageName}}}_{{{packageVersion}}}.tar.gz", repos = NULL, 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 All URIs are relative to *{{basePath}}* diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 3bd93e460f1..db49260916b 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -621,11 +621,11 @@ {{#returnType}} {{#isPrimitiveType}} local_var_content <- local_var_resp$response - local_var_resp, "text", encoding = "UTF-8", simplifyVector = FALSE + local_var_resp, "text", encoding = "UTF-8", simplifyVector = FALSE ) # save response in a file if (!is.null(data_file)) { - write(local_var_content, data_file) + write(local_var_content, data_file) } ApiResponse$new(content,resp) @@ -633,20 +633,20 @@ {{^isPrimitiveType}} # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "{{returnType}}", loadNamespace("{{packageName}}")), error = function(e) { - {{#useDefaultExceptionHandling}} - stop("Failed to deserialize response") - {{/useDefaultExceptionHandling}} - {{#useRlangExceptionHandling}} - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) - {{/useRlangExceptionHandling}} + {{#useDefaultExceptionHandling}} + stop("Failed to deserialize response") + {{/useDefaultExceptionHandling}} + {{#useRlangExceptionHandling}} + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) + {{/useRlangExceptionHandling}} } ) local_var_resp$content <- deserialized_resp_obj @@ -671,12 +671,12 @@ .subclass = "ApiException", ApiException = ApiException$new(http_response = local_var_resp)) {{/useRlangExceptionHandling}} - {{/returnExceptionOnFailure}} - {{^returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} + {{^returnExceptionOnFailure}} ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp) - {{/returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) { - {{#returnExceptionOnFailure}} + {{#returnExceptionOnFailure}} local_var_error_msg <- local_var_resp$response if (local_var_error_msg == "") { local_var_error_msg <- "Api client exception encountered." @@ -689,12 +689,12 @@ .subclass = "ApiException", ApiException = ApiException$new(http_response = local_var_resp)) {{/useRlangExceptionHandling}} - {{/returnExceptionOnFailure}} - {{^returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} + {{^returnExceptionOnFailure}} ApiResponse$new("API client error", local_var_resp) - {{/returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) { - {{#returnExceptionOnFailure}} + {{#returnExceptionOnFailure}} local_var_error_msg <- local_var_resp$response if (local_var_error_msg == "") { local_var_error_msg <- "Api server exception encountered." @@ -707,13 +707,13 @@ .subclass = "ApiException", ApiException = ApiException$new(http_response = local_var_resp)) {{/useRlangExceptionHandling}} - {{/returnExceptionOnFailure}} - {{^returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} + {{^returnExceptionOnFailure}} if (is.null(local_var_resp$response) || local_var_resp$response == "") { local_var_resp$response <- "API server error" } local_var_resp - {{/returnExceptionOnFailure}} + {{/returnExceptionOnFailure}} } }{{^-last}},{{/-last}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/r/api_client.mustache b/modules/openapi-generator/src/main/resources/r/api_client.mustache index 3821f841d1b..395ff41be4e 100644 --- a/modules/openapi-generator/src/main/resources/r/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_client.mustache @@ -44,7 +44,7 @@ #' @importFrom rlang abort {{/useRlangExceptionHandling}} #' @export -ApiClient <- R6::R6Class( +ApiClient <- R6::R6Class( "ApiClient", public = list( # base path of all requests diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index 7fd625caf3c..d67e502b01f 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -32,7 +32,7 @@ {{/isAdditionalPropertiesTrue}} {{#discriminator}} `_discriminator_property_name` = '{{discriminator.propertyName}}', - {{#discriminator.mappedModels}}{{#-first}}`_discriminator_mapping_name` = c({{/-first}}'{{mappingName}}' = '{{modelName}}'{{^-last}},{{/-last}}{{#-last}}),{{/-last}}{{/discriminator.mappedModels}} + {{#discriminator.mappedModels}}{{#-first}}`_discriminator_mapping_name` = c({{/-first}}'{{mappingName}}' = '{{modelName}}'{{^-last}}, {{/-last}}{{#-last}}),{{/-last}}{{/discriminator.mappedModels}} {{/discriminator}} #' Initialize a new {{{classname}}} class. #' @@ -50,9 +50,7 @@ {{/isAdditionalPropertiesTrue}} #' @param ... Other optional arguments. #' @export - initialize = function( - {{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}... - ) { + initialize = function({{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...) { {{#requiredVars}} if (!missing(`{{name}}`)) { {{^isContainer}} @@ -185,32 +183,32 @@ {{#vars}} if (!is.null(self$`{{name}}`)) { {{classname}}Object[["{{baseName}}"]] <- - {{#isContainer}} - {{#isArray}} - {{#isPrimitiveType}} + {{#isContainer}} + {{#isArray}} + {{#isPrimitiveType}} self$`{{name}}` - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} lapply(self$`{{name}}`, function(x) x$toJSON()) - {{/isPrimitiveType}} - {{/isArray}} - {{#isMap}} - {{#isPrimitiveType}} + {{/isPrimitiveType}} + {{/isArray}} + {{#isMap}} + {{#isPrimitiveType}} self$`{{name}}` - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} lapply(self$`{{name}}`, function(x) x$toJSON()) - {{/isPrimitiveType}} - {{/isMap}} - {{/isContainer}} - {{^isContainer}} - {{#isPrimitiveType}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} self$`{{name}}` - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} self$`{{name}}`$toJSON() - {{/isPrimitiveType}} - {{/isContainer}} + {{/isPrimitiveType}} + {{/isContainer}} } {{/vars}} {{#isAdditionalPropertiesTrue}} @@ -619,17 +617,18 @@ print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#{{classname}}$unlock() +# {{classname}}$unlock() # ## Below is an example to define the print fnuction -#{{classname}}$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# {{classname}}$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#{{classname}}$lock() +# {{classname}}$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R index 05d2ae0abc8..e485c15e4ca 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R @@ -40,9 +40,7 @@ AllofTagApiResponse <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -270,18 +268,19 @@ AllofTagApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#AllofTagApiResponse$unlock() +# AllofTagApiResponse$unlock() # ## Below is an example to define the print fnuction -#AllofTagApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# AllofTagApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#AllofTagApiResponse$lock() +# AllofTagApiResponse$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/animal.R b/samples/client/petstore/R-httr2-wrapper/R/animal.R index 5e93185d96c..632b160087d 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/animal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/animal.R @@ -22,7 +22,7 @@ Animal <- R6::R6Class( `_field_list` = c("className", "color"), `additional_properties` = list(), `_discriminator_property_name` = 'className', - `_discriminator_mapping_name` = c('Cat' = 'Cat','Dog' = 'Dog'), + `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), #' Initialize a new Animal class. #' #' @description @@ -33,9 +33,7 @@ Animal <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -219,18 +217,19 @@ Animal <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Animal$unlock() +# Animal$unlock() # ## Below is an example to define the print fnuction -#Animal$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Animal$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Animal$lock() +# Animal$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R index be3096b2447..2335bbe37c0 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R @@ -31,9 +31,7 @@ BasquePig <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color`, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -233,18 +231,19 @@ BasquePig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#BasquePig$unlock() +# BasquePig$unlock() # ## Below is an example to define the print fnuction -#BasquePig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# BasquePig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#BasquePig$lock() +# BasquePig$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat.R b/samples/client/petstore/R-httr2-wrapper/R/cat.R index 3dc1ebbf294..60d417950b1 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat.R @@ -35,9 +35,7 @@ Cat <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -241,18 +239,19 @@ Cat <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Cat$unlock() +# Cat$unlock() # ## Below is an example to define the print fnuction -#Cat$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Cat$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Cat$lock() +# Cat$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R b/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R index 6d677755caa..c3969fc0550 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R @@ -28,9 +28,7 @@ CatAllOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `declawed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`declawed` = NULL, additional_properties = NULL, ...) { if (!is.null(`declawed`)) { stopifnot(is.logical(`declawed`), length(`declawed`) == 1) self$`declawed` <- `declawed` @@ -178,18 +176,19 @@ CatAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#CatAllOf$unlock() +# CatAllOf$unlock() # ## Below is an example to define the print fnuction -#CatAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# CatAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#CatAllOf$lock() +# CatAllOf$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/category.R b/samples/client/petstore/R-httr2-wrapper/R/category.R index 294ddfe46cd..2de263a5682 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/category.R +++ b/samples/client/petstore/R-httr2-wrapper/R/category.R @@ -31,9 +31,7 @@ Category <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -209,18 +207,19 @@ Category <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Category$unlock() +# Category$unlock() # ## Below is an example to define the print fnuction -#Category$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Category$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Category$lock() +# Category$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R index 615ed1f465f..737bfad4b97 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R @@ -31,9 +31,7 @@ DanishPig <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `size`, additional_properties = NULL, ... - ) { + initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -233,18 +231,19 @@ DanishPig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DanishPig$unlock() +# DanishPig$unlock() # ## Below is an example to define the print fnuction -#DanishPig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DanishPig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DanishPig$lock() +# DanishPig$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/date.R b/samples/client/petstore/R-httr2-wrapper/R/date.R index cab55abeaf6..a26b7977d4f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/date.R +++ b/samples/client/petstore/R-httr2-wrapper/R/date.R @@ -34,9 +34,7 @@ Date <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -272,18 +270,19 @@ Date <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Date$unlock() +# Date$unlock() # ## Below is an example to define the print fnuction -#Date$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Date$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Date$lock() +# Date$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog.R b/samples/client/petstore/R-httr2-wrapper/R/dog.R index e387c368aca..67fb8a315e2 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog.R @@ -35,9 +35,7 @@ Dog <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -241,18 +239,19 @@ Dog <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Dog$unlock() +# Dog$unlock() # ## Below is an example to define the print fnuction -#Dog$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Dog$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Dog$lock() +# Dog$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R b/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R index c9408b089be..ea44d583d74 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R @@ -28,9 +28,7 @@ DogAllOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `breed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`breed` = NULL, additional_properties = NULL, ...) { if (!is.null(`breed`)) { stopifnot(is.character(`breed`), length(`breed`) == 1) self$`breed` <- `breed` @@ -178,18 +176,19 @@ DogAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DogAllOf$unlock() +# DogAllOf$unlock() # ## Below is an example to define the print fnuction -#DogAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DogAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DogAllOf$lock() +# DogAllOf$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R index 56eb7c889b8..73cf0e8c54e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R @@ -361,15 +361,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -481,15 +481,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R index d0ce1ebbaf1..03059bb5225 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R @@ -34,9 +34,7 @@ ModelApiResponse <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { stopifnot(is.numeric(`code`), length(`code`) == 1) self$`code` <- `code` @@ -224,18 +222,19 @@ ModelApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#ModelApiResponse$unlock() +# ModelApiResponse$unlock() # ## Below is an example to define the print fnuction -#ModelApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# ModelApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#ModelApiResponse$lock() +# ModelApiResponse$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R index 70e9489af28..68b0db6b371 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R @@ -31,9 +31,7 @@ NestedOneOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { stopifnot(is.numeric(`size`), length(`size`) == 1) self$`size` <- `size` @@ -203,18 +201,19 @@ NestedOneOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#NestedOneOf$unlock() +# NestedOneOf$unlock() # ## Below is an example to define the print fnuction -#NestedOneOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# NestedOneOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#NestedOneOf$lock() +# NestedOneOf$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/order.R b/samples/client/petstore/R-httr2-wrapper/R/order.R index 77d5790216a..6f43799918d 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/order.R +++ b/samples/client/petstore/R-httr2-wrapper/R/order.R @@ -43,9 +43,7 @@ Order <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -302,18 +300,19 @@ Order <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Order$unlock() +# Order$unlock() # ## Below is an example to define the print fnuction -#Order$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Order$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Order$lock() +# Order$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet.R b/samples/client/petstore/R-httr2-wrapper/R/pet.R index 47291dfbdbf..63318448c0c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet.R @@ -43,9 +43,7 @@ Pet <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { stopifnot(is.character(`name`), length(`name`) == 1) self$`name` <- `name` @@ -339,18 +337,19 @@ Pet <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Pet$unlock() +# Pet$unlock() # ## Below is an example to define the print fnuction -#Pet$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Pet$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Pet$lock() +# Pet$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R index 8a8f211c63b..837c4c3d5df 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -742,15 +742,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -980,15 +980,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1096,15 +1096,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1217,15 +1217,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1349,15 +1349,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1479,15 +1479,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1601,15 +1601,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1839,15 +1839,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "ModelApiResponse", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2-wrapper/R/special.R b/samples/client/petstore/R-httr2-wrapper/R/special.R index 5b55380340a..33f06cc6a67 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/special.R +++ b/samples/client/petstore/R-httr2-wrapper/R/special.R @@ -46,9 +46,7 @@ Special <- R6::R6Class( #' @param additional_properties additonal 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, ... - ) { + 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) sapply(`set_test`, function(x) stopifnot(is.character(x))) @@ -328,18 +326,19 @@ Special <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Special$unlock() +# Special$unlock() # ## Below is an example to define the print fnuction -#Special$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Special$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Special$lock() +# Special$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/store_api.R b/samples/client/petstore/R-httr2-wrapper/R/store_api.R index 9da20356fbe..3811d0e6a45 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/store_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/store_api.R @@ -434,15 +434,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "map(integer)", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -563,15 +563,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -682,15 +682,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2-wrapper/R/tag.R b/samples/client/petstore/R-httr2-wrapper/R/tag.R index eaeea9fdb0f..bd4aac10e2f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/tag.R +++ b/samples/client/petstore/R-httr2-wrapper/R/tag.R @@ -31,9 +31,7 @@ Tag <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -201,18 +199,19 @@ Tag <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Tag$unlock() +# Tag$unlock() # ## Below is an example to define the print fnuction -#Tag$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Tag$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Tag$lock() +# Tag$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R index e0d603b7ffb..bde06df6a8a 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R @@ -31,9 +31,7 @@ UpdatePetRequest <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) self$`jsonData` <- `jsonData` @@ -202,18 +200,19 @@ UpdatePetRequest <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#UpdatePetRequest$unlock() +# UpdatePetRequest$unlock() # ## Below is an example to define the print fnuction -#UpdatePetRequest$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# UpdatePetRequest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#UpdatePetRequest$lock() +# UpdatePetRequest$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/user.R b/samples/client/petstore/R-httr2-wrapper/R/user.R index 33b090fb563..153aacb3ea5 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user.R @@ -49,9 +49,7 @@ User <- R6::R6Class( #' @param additional_properties additonal 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, ... - ) { + 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`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -339,18 +337,19 @@ User <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#User$unlock() +# User$unlock() # ## Below is an example to define the print fnuction -#User$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# User$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#User$lock() +# User$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/user_api.R b/samples/client/petstore/R-httr2-wrapper/R/user_api.R index 3be15858fbc..bc8daa69c9d 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user_api.R @@ -966,15 +966,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1099,15 +1099,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "character", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2-wrapper/R/whale.R b/samples/client/petstore/R-httr2-wrapper/R/whale.R index 2dae2424369..936b3a2573e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/whale.R +++ b/samples/client/petstore/R-httr2-wrapper/R/whale.R @@ -34,9 +34,7 @@ Whale <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -240,18 +238,19 @@ Whale <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Whale$unlock() +# Whale$unlock() # ## Below is an example to define the print fnuction -#Whale$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Whale$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Whale$lock() +# Whale$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/R/zebra.R b/samples/client/petstore/R-httr2-wrapper/R/zebra.R index 939ca24f2dd..5c090e84cbb 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/zebra.R +++ b/samples/client/petstore/R-httr2-wrapper/R/zebra.R @@ -31,9 +31,7 @@ Zebra <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `type` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -226,18 +224,19 @@ Zebra <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Zebra$unlock() +# Zebra$unlock() # ## Below is an example to define the print fnuction -#Zebra$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Zebra$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Zebra$lock() +# Zebra$lock() diff --git a/samples/client/petstore/R-httr2-wrapper/README.md b/samples/client/petstore/R-httr2-wrapper/README.md index 1e4a1a56f55..bb481451cbd 100644 --- a/samples/client/petstore/R-httr2-wrapper/README.md +++ b/samples/client/petstore/R-httr2-wrapper/README.md @@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source") 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 All URIs are relative to *http://petstore.swagger.io/v2* diff --git a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R index 51266e1edce..de8c4c80034 100644 --- a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R @@ -35,9 +35,7 @@ AllofTagApiResponse <- R6::R6Class( #' @param message message #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -237,18 +235,19 @@ AllofTagApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#AllofTagApiResponse$unlock() +# AllofTagApiResponse$unlock() # ## Below is an example to define the print fnuction -#AllofTagApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# AllofTagApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#AllofTagApiResponse$lock() +# AllofTagApiResponse$lock() diff --git a/samples/client/petstore/R-httr2/R/animal.R b/samples/client/petstore/R-httr2/R/animal.R index d2ee3466a14..f111fd1252b 100644 --- a/samples/client/petstore/R-httr2/R/animal.R +++ b/samples/client/petstore/R-httr2/R/animal.R @@ -18,7 +18,7 @@ Animal <- R6::R6Class( `className` = NULL, `color` = NULL, `_discriminator_property_name` = 'className', - `_discriminator_mapping_name` = c('Cat' = 'Cat','Dog' = 'Dog'), + `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), #' Initialize a new Animal class. #' #' @description @@ -28,9 +28,7 @@ Animal <- R6::R6Class( #' @param color color. Default to "red". #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", ... - ) { + initialize = function(`className`, `color` = "red", ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -186,18 +184,19 @@ Animal <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Animal$unlock() +# Animal$unlock() # ## Below is an example to define the print fnuction -#Animal$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Animal$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Animal$lock() +# Animal$lock() diff --git a/samples/client/petstore/R-httr2/R/basque_pig.R b/samples/client/petstore/R-httr2/R/basque_pig.R index 727962a99f7..0a83d2b2548 100644 --- a/samples/client/petstore/R-httr2/R/basque_pig.R +++ b/samples/client/petstore/R-httr2/R/basque_pig.R @@ -26,9 +26,7 @@ BasquePig <- R6::R6Class( #' @param color color #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color`, ... - ) { + initialize = function(`className`, `color`, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -200,18 +198,19 @@ BasquePig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#BasquePig$unlock() +# BasquePig$unlock() # ## Below is an example to define the print fnuction -#BasquePig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# BasquePig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#BasquePig$lock() +# BasquePig$lock() diff --git a/samples/client/petstore/R-httr2/R/cat.R b/samples/client/petstore/R-httr2/R/cat.R index 0483948e5ee..f9bfc07a9ab 100644 --- a/samples/client/petstore/R-httr2/R/cat.R +++ b/samples/client/petstore/R-httr2/R/cat.R @@ -30,9 +30,7 @@ Cat <- R6::R6Class( #' @param declawed declawed #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `declawed` = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `declawed` = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -208,18 +206,19 @@ Cat <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Cat$unlock() +# Cat$unlock() # ## Below is an example to define the print fnuction -#Cat$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Cat$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Cat$lock() +# Cat$lock() diff --git a/samples/client/petstore/R-httr2/R/cat_all_of.R b/samples/client/petstore/R-httr2/R/cat_all_of.R index a30906841ed..b54b944cd26 100644 --- a/samples/client/petstore/R-httr2/R/cat_all_of.R +++ b/samples/client/petstore/R-httr2/R/cat_all_of.R @@ -23,9 +23,7 @@ CatAllOf <- R6::R6Class( #' @param declawed declawed #' @param ... Other optional arguments. #' @export - initialize = function( - `declawed` = NULL, ... - ) { + initialize = function(`declawed` = NULL, ...) { if (!is.null(`declawed`)) { stopifnot(is.logical(`declawed`), length(`declawed`) == 1) self$`declawed` <- `declawed` @@ -145,18 +143,19 @@ CatAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#CatAllOf$unlock() +# CatAllOf$unlock() # ## Below is an example to define the print fnuction -#CatAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# CatAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#CatAllOf$lock() +# CatAllOf$lock() diff --git a/samples/client/petstore/R-httr2/R/category.R b/samples/client/petstore/R-httr2/R/category.R index 881f9ad0ec4..ab4f475202e 100644 --- a/samples/client/petstore/R-httr2/R/category.R +++ b/samples/client/petstore/R-httr2/R/category.R @@ -26,9 +26,7 @@ Category <- R6::R6Class( #' @param name name #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -176,18 +174,19 @@ Category <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Category$unlock() +# Category$unlock() # ## Below is an example to define the print fnuction -#Category$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Category$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Category$lock() +# Category$lock() diff --git a/samples/client/petstore/R-httr2/R/danish_pig.R b/samples/client/petstore/R-httr2/R/danish_pig.R index 9d3377240db..206cdeca85a 100644 --- a/samples/client/petstore/R-httr2/R/danish_pig.R +++ b/samples/client/petstore/R-httr2/R/danish_pig.R @@ -26,9 +26,7 @@ DanishPig <- R6::R6Class( #' @param size size #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `size`, ... - ) { + initialize = function(`className`, `size`, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -200,18 +198,19 @@ DanishPig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DanishPig$unlock() +# DanishPig$unlock() # ## Below is an example to define the print fnuction -#DanishPig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DanishPig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DanishPig$lock() +# DanishPig$lock() diff --git a/samples/client/petstore/R-httr2/R/date.R b/samples/client/petstore/R-httr2/R/date.R index ffbad1cd46b..8af974b7ae5 100644 --- a/samples/client/petstore/R-httr2/R/date.R +++ b/samples/client/petstore/R-httr2/R/date.R @@ -29,9 +29,7 @@ Date <- R6::R6Class( #' @param percent_description using \% in the description #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `url_property`, `percent_description` = NULL, ... - ) { + initialize = function(`className`, `url_property`, `percent_description` = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -239,18 +237,19 @@ Date <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Date$unlock() +# Date$unlock() # ## Below is an example to define the print fnuction -#Date$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Date$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Date$lock() +# Date$lock() diff --git a/samples/client/petstore/R-httr2/R/dog.R b/samples/client/petstore/R-httr2/R/dog.R index 54b95afe511..75299cdfc78 100644 --- a/samples/client/petstore/R-httr2/R/dog.R +++ b/samples/client/petstore/R-httr2/R/dog.R @@ -30,9 +30,7 @@ Dog <- R6::R6Class( #' @param breed breed #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `breed` = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `breed` = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -208,18 +206,19 @@ Dog <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Dog$unlock() +# Dog$unlock() # ## Below is an example to define the print fnuction -#Dog$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Dog$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Dog$lock() +# Dog$lock() diff --git a/samples/client/petstore/R-httr2/R/dog_all_of.R b/samples/client/petstore/R-httr2/R/dog_all_of.R index f9172ab0dde..fc8e7d0a6d6 100644 --- a/samples/client/petstore/R-httr2/R/dog_all_of.R +++ b/samples/client/petstore/R-httr2/R/dog_all_of.R @@ -23,9 +23,7 @@ DogAllOf <- R6::R6Class( #' @param breed breed #' @param ... Other optional arguments. #' @export - initialize = function( - `breed` = NULL, ... - ) { + initialize = function(`breed` = NULL, ...) { if (!is.null(`breed`)) { stopifnot(is.character(`breed`), length(`breed`) == 1) self$`breed` <- `breed` @@ -145,18 +143,19 @@ DogAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DogAllOf$unlock() +# DogAllOf$unlock() # ## Below is an example to define the print fnuction -#DogAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DogAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DogAllOf$lock() +# DogAllOf$lock() diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 4ed239b627e..3ead57443af 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -361,15 +361,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -481,15 +481,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2/R/model_api_response.R b/samples/client/petstore/R-httr2/R/model_api_response.R index 952d587ac0d..de8760bdf23 100644 --- a/samples/client/petstore/R-httr2/R/model_api_response.R +++ b/samples/client/petstore/R-httr2/R/model_api_response.R @@ -29,9 +29,7 @@ ModelApiResponse <- R6::R6Class( #' @param message message #' @param ... Other optional arguments. #' @export - initialize = function( - `code` = NULL, `type` = NULL, `message` = NULL, ... - ) { + initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`code`)) { stopifnot(is.numeric(`code`), length(`code`) == 1) self$`code` <- `code` @@ -191,18 +189,19 @@ ModelApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#ModelApiResponse$unlock() +# ModelApiResponse$unlock() # ## Below is an example to define the print fnuction -#ModelApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# ModelApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#ModelApiResponse$lock() +# ModelApiResponse$lock() diff --git a/samples/client/petstore/R-httr2/R/nested_one_of.R b/samples/client/petstore/R-httr2/R/nested_one_of.R index e5d71f21ead..542a11c4d21 100644 --- a/samples/client/petstore/R-httr2/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2/R/nested_one_of.R @@ -26,9 +26,7 @@ NestedOneOf <- R6::R6Class( #' @param nested_pig nested_pig #' @param ... Other optional arguments. #' @export - initialize = function( - `size` = NULL, `nested_pig` = NULL, ... - ) { + initialize = function(`size` = NULL, `nested_pig` = NULL, ...) { if (!is.null(`size`)) { stopifnot(is.numeric(`size`), length(`size`) == 1) self$`size` <- `size` @@ -170,18 +168,19 @@ NestedOneOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#NestedOneOf$unlock() +# NestedOneOf$unlock() # ## Below is an example to define the print fnuction -#NestedOneOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# NestedOneOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#NestedOneOf$lock() +# NestedOneOf$lock() diff --git a/samples/client/petstore/R-httr2/R/order.R b/samples/client/petstore/R-httr2/R/order.R index c45f20acecf..01b511bb351 100644 --- a/samples/client/petstore/R-httr2/R/order.R +++ b/samples/client/petstore/R-httr2/R/order.R @@ -38,9 +38,7 @@ Order <- R6::R6Class( #' @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, ... - ) { + initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -269,18 +267,19 @@ Order <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Order$unlock() +# Order$unlock() # ## Below is an example to define the print fnuction -#Order$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Order$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Order$lock() +# Order$lock() diff --git a/samples/client/petstore/R-httr2/R/pet.R b/samples/client/petstore/R-httr2/R/pet.R index f452d75f071..f840c7ca9ab 100644 --- a/samples/client/petstore/R-httr2/R/pet.R +++ b/samples/client/petstore/R-httr2/R/pet.R @@ -38,9 +38,7 @@ Pet <- R6::R6Class( #' @param status pet status in the store #' @param ... Other optional arguments. #' @export - initialize = function( - `name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ... - ) { + initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) { if (!missing(`name`)) { stopifnot(is.character(`name`), length(`name`) == 1) self$`name` <- `name` @@ -306,18 +304,19 @@ Pet <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Pet$unlock() +# Pet$unlock() # ## Below is an example to define the print fnuction -#Pet$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Pet$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Pet$lock() +# Pet$lock() diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index dd5847c7c6a..563895e44bf 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -742,15 +742,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -980,15 +980,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1096,15 +1096,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1217,15 +1217,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1349,15 +1349,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1479,15 +1479,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1601,15 +1601,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1839,15 +1839,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "ModelApiResponse", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2/R/special.R b/samples/client/petstore/R-httr2/R/special.R index b6bac11b512..32ced477530 100644 --- a/samples/client/petstore/R-httr2/R/special.R +++ b/samples/client/petstore/R-httr2/R/special.R @@ -41,9 +41,7 @@ Special <- R6::R6Class( #' @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, ... - ) { + 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) sapply(`set_test`, function(x) stopifnot(is.character(x))) @@ -295,18 +293,19 @@ Special <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Special$unlock() +# Special$unlock() # ## Below is an example to define the print fnuction -#Special$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Special$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Special$lock() +# Special$lock() diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index ccc64c4cb4c..ef974aa9a56 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -434,15 +434,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "map(integer)", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -563,15 +563,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -682,15 +682,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2/R/tag.R b/samples/client/petstore/R-httr2/R/tag.R index 24319868149..8db55133014 100644 --- a/samples/client/petstore/R-httr2/R/tag.R +++ b/samples/client/petstore/R-httr2/R/tag.R @@ -26,9 +26,7 @@ Tag <- R6::R6Class( #' @param name name #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -168,18 +166,19 @@ Tag <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Tag$unlock() +# Tag$unlock() # ## Below is an example to define the print fnuction -#Tag$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Tag$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Tag$lock() +# Tag$lock() diff --git a/samples/client/petstore/R-httr2/R/update_pet_request.R b/samples/client/petstore/R-httr2/R/update_pet_request.R index 722f60be901..1d37555f4b0 100644 --- a/samples/client/petstore/R-httr2/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2/R/update_pet_request.R @@ -26,9 +26,7 @@ UpdatePetRequest <- R6::R6Class( #' @param binaryDataN2Information binaryDataN2Information #' @param ... Other optional arguments. #' @export - initialize = function( - `jsonData` = NULL, `binaryDataN2Information` = NULL, ... - ) { + initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) self$`jsonData` <- `jsonData` @@ -169,18 +167,19 @@ UpdatePetRequest <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#UpdatePetRequest$unlock() +# UpdatePetRequest$unlock() # ## Below is an example to define the print fnuction -#UpdatePetRequest$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# UpdatePetRequest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#UpdatePetRequest$lock() +# UpdatePetRequest$lock() diff --git a/samples/client/petstore/R-httr2/R/user.R b/samples/client/petstore/R-httr2/R/user.R index 08690a25fbb..c3db6eb00d7 100644 --- a/samples/client/petstore/R-httr2/R/user.R +++ b/samples/client/petstore/R-httr2/R/user.R @@ -44,9 +44,7 @@ User <- R6::R6Class( #' @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, ... - ) { + initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -306,18 +304,19 @@ User <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#User$unlock() +# User$unlock() # ## Below is an example to define the print fnuction -#User$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# User$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#User$lock() +# User$lock() diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index f273f8c7917..379460748f0 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -966,15 +966,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1099,15 +1099,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "character", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R-httr2/R/whale.R b/samples/client/petstore/R-httr2/R/whale.R index 1706098ddc1..51a3f0b69f2 100644 --- a/samples/client/petstore/R-httr2/R/whale.R +++ b/samples/client/petstore/R-httr2/R/whale.R @@ -29,9 +29,7 @@ Whale <- R6::R6Class( #' @param hasTeeth hasTeeth #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ... - ) { + initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -207,18 +205,19 @@ Whale <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Whale$unlock() +# Whale$unlock() # ## Below is an example to define the print fnuction -#Whale$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Whale$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Whale$lock() +# Whale$lock() diff --git a/samples/client/petstore/R-httr2/R/zebra.R b/samples/client/petstore/R-httr2/R/zebra.R index d53e727ac01..7feafc3745c 100644 --- a/samples/client/petstore/R-httr2/R/zebra.R +++ b/samples/client/petstore/R-httr2/R/zebra.R @@ -26,9 +26,7 @@ Zebra <- R6::R6Class( #' @param type type #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `type` = NULL, ... - ) { + initialize = function(`className`, `type` = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -193,18 +191,19 @@ Zebra <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Zebra$unlock() +# Zebra$unlock() # ## Below is an example to define the print fnuction -#Zebra$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Zebra$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Zebra$lock() +# Zebra$lock() diff --git a/samples/client/petstore/R-httr2/README.md b/samples/client/petstore/R-httr2/README.md index 1e4a1a56f55..bb481451cbd 100644 --- a/samples/client/petstore/R-httr2/README.md +++ b/samples/client/petstore/R-httr2/README.md @@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source") 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 All URIs are relative to *http://petstore.swagger.io/v2* diff --git a/samples/client/petstore/R/R/allof_tag_api_response.R b/samples/client/petstore/R/R/allof_tag_api_response.R index 05d2ae0abc8..e485c15e4ca 100644 --- a/samples/client/petstore/R/R/allof_tag_api_response.R +++ b/samples/client/petstore/R/R/allof_tag_api_response.R @@ -40,9 +40,7 @@ AllofTagApiResponse <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -270,18 +268,19 @@ AllofTagApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#AllofTagApiResponse$unlock() +# AllofTagApiResponse$unlock() # ## Below is an example to define the print fnuction -#AllofTagApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# AllofTagApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#AllofTagApiResponse$lock() +# AllofTagApiResponse$lock() diff --git a/samples/client/petstore/R/R/animal.R b/samples/client/petstore/R/R/animal.R index 5e93185d96c..632b160087d 100644 --- a/samples/client/petstore/R/R/animal.R +++ b/samples/client/petstore/R/R/animal.R @@ -22,7 +22,7 @@ Animal <- R6::R6Class( `_field_list` = c("className", "color"), `additional_properties` = list(), `_discriminator_property_name` = 'className', - `_discriminator_mapping_name` = c('Cat' = 'Cat','Dog' = 'Dog'), + `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), #' Initialize a new Animal class. #' #' @description @@ -33,9 +33,7 @@ Animal <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -219,18 +217,19 @@ Animal <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Animal$unlock() +# Animal$unlock() # ## Below is an example to define the print fnuction -#Animal$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Animal$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Animal$lock() +# Animal$lock() diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R index e2901cd7244..cd0958b02de 100644 --- a/samples/client/petstore/R/R/api_client.R +++ b/samples/client/petstore/R/R/api_client.R @@ -42,7 +42,7 @@ #' @importFrom httr add_headers accept timeout content #' @importFrom rlang abort #' @export -ApiClient <- R6::R6Class( +ApiClient <- R6::R6Class( "ApiClient", public = list( # base path of all requests diff --git a/samples/client/petstore/R/R/basque_pig.R b/samples/client/petstore/R/R/basque_pig.R index be3096b2447..2335bbe37c0 100644 --- a/samples/client/petstore/R/R/basque_pig.R +++ b/samples/client/petstore/R/R/basque_pig.R @@ -31,9 +31,7 @@ BasquePig <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color`, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -233,18 +231,19 @@ BasquePig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#BasquePig$unlock() +# BasquePig$unlock() # ## Below is an example to define the print fnuction -#BasquePig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# BasquePig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#BasquePig$lock() +# BasquePig$lock() diff --git a/samples/client/petstore/R/R/cat.R b/samples/client/petstore/R/R/cat.R index 3dc1ebbf294..60d417950b1 100644 --- a/samples/client/petstore/R/R/cat.R +++ b/samples/client/petstore/R/R/cat.R @@ -35,9 +35,7 @@ Cat <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -241,18 +239,19 @@ Cat <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Cat$unlock() +# Cat$unlock() # ## Below is an example to define the print fnuction -#Cat$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Cat$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Cat$lock() +# Cat$lock() diff --git a/samples/client/petstore/R/R/cat_all_of.R b/samples/client/petstore/R/R/cat_all_of.R index 6d677755caa..c3969fc0550 100644 --- a/samples/client/petstore/R/R/cat_all_of.R +++ b/samples/client/petstore/R/R/cat_all_of.R @@ -28,9 +28,7 @@ CatAllOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `declawed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`declawed` = NULL, additional_properties = NULL, ...) { if (!is.null(`declawed`)) { stopifnot(is.logical(`declawed`), length(`declawed`) == 1) self$`declawed` <- `declawed` @@ -178,18 +176,19 @@ CatAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#CatAllOf$unlock() +# CatAllOf$unlock() # ## Below is an example to define the print fnuction -#CatAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# CatAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#CatAllOf$lock() +# CatAllOf$lock() diff --git a/samples/client/petstore/R/R/category.R b/samples/client/petstore/R/R/category.R index 294ddfe46cd..2de263a5682 100644 --- a/samples/client/petstore/R/R/category.R +++ b/samples/client/petstore/R/R/category.R @@ -31,9 +31,7 @@ Category <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -209,18 +207,19 @@ Category <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Category$unlock() +# Category$unlock() # ## Below is an example to define the print fnuction -#Category$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Category$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Category$lock() +# Category$lock() diff --git a/samples/client/petstore/R/R/danish_pig.R b/samples/client/petstore/R/R/danish_pig.R index 615ed1f465f..737bfad4b97 100644 --- a/samples/client/petstore/R/R/danish_pig.R +++ b/samples/client/petstore/R/R/danish_pig.R @@ -31,9 +31,7 @@ DanishPig <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `size`, additional_properties = NULL, ... - ) { + initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -233,18 +231,19 @@ DanishPig <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DanishPig$unlock() +# DanishPig$unlock() # ## Below is an example to define the print fnuction -#DanishPig$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DanishPig$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DanishPig$lock() +# DanishPig$lock() diff --git a/samples/client/petstore/R/R/date.R b/samples/client/petstore/R/R/date.R index cab55abeaf6..a26b7977d4f 100644 --- a/samples/client/petstore/R/R/date.R +++ b/samples/client/petstore/R/R/date.R @@ -34,9 +34,7 @@ Date <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -272,18 +270,19 @@ Date <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Date$unlock() +# Date$unlock() # ## Below is an example to define the print fnuction -#Date$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Date$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Date$lock() +# Date$lock() diff --git a/samples/client/petstore/R/R/dog.R b/samples/client/petstore/R/R/dog.R index e387c368aca..67fb8a315e2 100644 --- a/samples/client/petstore/R/R/dog.R +++ b/samples/client/petstore/R/R/dog.R @@ -35,9 +35,7 @@ Dog <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -241,18 +239,19 @@ Dog <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Dog$unlock() +# Dog$unlock() # ## Below is an example to define the print fnuction -#Dog$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Dog$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Dog$lock() +# Dog$lock() diff --git a/samples/client/petstore/R/R/dog_all_of.R b/samples/client/petstore/R/R/dog_all_of.R index c9408b089be..ea44d583d74 100644 --- a/samples/client/petstore/R/R/dog_all_of.R +++ b/samples/client/petstore/R/R/dog_all_of.R @@ -28,9 +28,7 @@ DogAllOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `breed` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`breed` = NULL, additional_properties = NULL, ...) { if (!is.null(`breed`)) { stopifnot(is.character(`breed`), length(`breed`) == 1) self$`breed` <- `breed` @@ -178,18 +176,19 @@ DogAllOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#DogAllOf$unlock() +# DogAllOf$unlock() # ## Below is an example to define the print fnuction -#DogAllOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# DogAllOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#DogAllOf$lock() +# DogAllOf$lock() diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index cd9c23ac49d..b20d9bcd7f5 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -361,15 +361,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -481,15 +481,15 @@ FakeApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R/R/model_api_response.R b/samples/client/petstore/R/R/model_api_response.R index d0ce1ebbaf1..03059bb5225 100644 --- a/samples/client/petstore/R/R/model_api_response.R +++ b/samples/client/petstore/R/R/model_api_response.R @@ -34,9 +34,7 @@ ModelApiResponse <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { stopifnot(is.numeric(`code`), length(`code`) == 1) self$`code` <- `code` @@ -224,18 +222,19 @@ ModelApiResponse <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#ModelApiResponse$unlock() +# ModelApiResponse$unlock() # ## Below is an example to define the print fnuction -#ModelApiResponse$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# ModelApiResponse$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#ModelApiResponse$lock() +# ModelApiResponse$lock() diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index 70e9489af28..68b0db6b371 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -31,9 +31,7 @@ NestedOneOf <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { stopifnot(is.numeric(`size`), length(`size`) == 1) self$`size` <- `size` @@ -203,18 +201,19 @@ NestedOneOf <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#NestedOneOf$unlock() +# NestedOneOf$unlock() # ## Below is an example to define the print fnuction -#NestedOneOf$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# NestedOneOf$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#NestedOneOf$lock() +# NestedOneOf$lock() diff --git a/samples/client/petstore/R/R/order.R b/samples/client/petstore/R/R/order.R index 77d5790216a..6f43799918d 100644 --- a/samples/client/petstore/R/R/order.R +++ b/samples/client/petstore/R/R/order.R @@ -43,9 +43,7 @@ Order <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -302,18 +300,19 @@ Order <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Order$unlock() +# Order$unlock() # ## Below is an example to define the print fnuction -#Order$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Order$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Order$lock() +# Order$lock() diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index 47291dfbdbf..63318448c0c 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -43,9 +43,7 @@ Pet <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { stopifnot(is.character(`name`), length(`name`) == 1) self$`name` <- `name` @@ -339,18 +337,19 @@ Pet <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Pet$unlock() +# Pet$unlock() # ## Below is an example to define the print fnuction -#Pet$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Pet$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Pet$lock() +# Pet$lock() diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index ba9f7a0cded..19f1a04b1f6 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -742,15 +742,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -980,15 +980,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1096,15 +1096,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "array[Pet]", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1217,15 +1217,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1349,15 +1349,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1479,15 +1479,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1601,15 +1601,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Pet", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1839,15 +1839,15 @@ PetApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "ModelApiResponse", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R/R/special.R b/samples/client/petstore/R/R/special.R index 5b55380340a..33f06cc6a67 100644 --- a/samples/client/petstore/R/R/special.R +++ b/samples/client/petstore/R/R/special.R @@ -46,9 +46,7 @@ Special <- R6::R6Class( #' @param additional_properties additonal 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, ... - ) { + 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) sapply(`set_test`, function(x) stopifnot(is.character(x))) @@ -328,18 +326,19 @@ Special <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Special$unlock() +# Special$unlock() # ## Below is an example to define the print fnuction -#Special$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Special$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Special$lock() +# Special$lock() diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 498ad9958c5..ec9b71aabf0 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -434,15 +434,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "map(integer)", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -563,15 +563,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -682,15 +682,15 @@ StoreApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R/R/tag.R b/samples/client/petstore/R/R/tag.R index eaeea9fdb0f..bd4aac10e2f 100644 --- a/samples/client/petstore/R/R/tag.R +++ b/samples/client/petstore/R/R/tag.R @@ -31,9 +31,7 @@ Tag <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `id` = NULL, `name` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -201,18 +199,19 @@ Tag <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Tag$unlock() +# Tag$unlock() # ## Below is an example to define the print fnuction -#Tag$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Tag$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Tag$lock() +# Tag$lock() diff --git a/samples/client/petstore/R/R/update_pet_request.R b/samples/client/petstore/R/R/update_pet_request.R index e0d603b7ffb..bde06df6a8a 100644 --- a/samples/client/petstore/R/R/update_pet_request.R +++ b/samples/client/petstore/R/R/update_pet_request.R @@ -31,9 +31,7 @@ UpdatePetRequest <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) self$`jsonData` <- `jsonData` @@ -202,18 +200,19 @@ UpdatePetRequest <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#UpdatePetRequest$unlock() +# UpdatePetRequest$unlock() # ## Below is an example to define the print fnuction -#UpdatePetRequest$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# UpdatePetRequest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#UpdatePetRequest$lock() +# UpdatePetRequest$lock() diff --git a/samples/client/petstore/R/R/user.R b/samples/client/petstore/R/R/user.R index 33b090fb563..153aacb3ea5 100644 --- a/samples/client/petstore/R/R/user.R +++ b/samples/client/petstore/R/R/user.R @@ -49,9 +49,7 @@ User <- R6::R6Class( #' @param additional_properties additonal 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, ... - ) { + 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`)) { stopifnot(is.numeric(`id`), length(`id`) == 1) self$`id` <- `id` @@ -339,18 +337,19 @@ User <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#User$unlock() +# User$unlock() # ## Below is an example to define the print fnuction -#User$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# User$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#User$lock() +# User$lock() diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index a785a27d023..34e6a7b10b4 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -966,15 +966,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj @@ -1099,15 +1099,15 @@ UserApi <- R6::R6Class( if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) { # save response in a file if (!is.null(data_file)) { - write(local_var_resp$response, data_file) + write(local_var_resp$response, data_file) } deserialized_resp_obj <- tryCatch( self$api_client$deserialize(local_var_resp$response, "character", loadNamespace("petstore")), error = function(e) { - rlang::abort(message = "Failed to deserialize response", - .subclass = "ApiException", - ApiException = ApiException$new(http_response = local_var_resp)) + rlang::abort(message = "Failed to deserialize response", + .subclass = "ApiException", + ApiException = ApiException$new(http_response = local_var_resp)) } ) local_var_resp$content <- deserialized_resp_obj diff --git a/samples/client/petstore/R/R/whale.R b/samples/client/petstore/R/R/whale.R index 2dae2424369..936b3a2573e 100644 --- a/samples/client/petstore/R/R/whale.R +++ b/samples/client/petstore/R/R/whale.R @@ -34,9 +34,7 @@ Whale <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -240,18 +238,19 @@ Whale <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Whale$unlock() +# Whale$unlock() # ## Below is an example to define the print fnuction -#Whale$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Whale$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Whale$lock() +# Whale$lock() diff --git a/samples/client/petstore/R/R/zebra.R b/samples/client/petstore/R/R/zebra.R index 939ca24f2dd..5c090e84cbb 100644 --- a/samples/client/petstore/R/R/zebra.R +++ b/samples/client/petstore/R/R/zebra.R @@ -31,9 +31,7 @@ Zebra <- R6::R6Class( #' @param additional_properties additonal properties (optional) #' @param ... Other optional arguments. #' @export - initialize = function( - `className`, `type` = NULL, additional_properties = NULL, ... - ) { + initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { stopifnot(is.character(`className`), length(`className`) == 1) self$`className` <- `className` @@ -226,18 +224,19 @@ Zebra <- R6::R6Class( print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) - }), - # Lock the class to prevent modifications to the method or field - lock_class = TRUE + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE ) ## Uncomment below to unlock the class to allow modifications of the method or field -#Zebra$unlock() +# Zebra$unlock() # ## Below is an example to define the print fnuction -#Zebra$set("public", "print", function(...) { -# print(jsonlite::prettify(self$toJSONString())) -# invisible(self) -#}) +# Zebra$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) ## Uncomment below to lock the class to prevent modifications to the method or field -#Zebra$lock() +# Zebra$lock() diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index 10342aaa7e0..263e44af2d5 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -55,6 +55,17 @@ install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source") 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 All URIs are relative to *http://petstore.swagger.io/v2*