From 29c3b020e620330669bac9950863b09bc2e61764 Mon Sep 17 00:00:00 2001 From: Luke Zappia Date: Thu, 26 Sep 2024 07:56:22 +0200 Subject: [PATCH] [R] Update R6 object documentation (#19679) * Remove @export and titles from R6 methods * Remove redundant methods docs from R api.mustache * Build project --- .../src/main/resources/r/ApiResponse.mustache | 8 +- .../src/main/resources/r/api.mustache | 87 +--- .../src/main/resources/r/api_client.mustache | 30 +- .../main/resources/r/api_exception.mustache | 10 +- .../src/main/resources/r/modelAnyOf.mustache | 35 +- .../src/main/resources/r/modelEnum.mustache | 22 +- .../main/resources/r/modelGeneric.mustache | 41 +- .../src/main/resources/r/modelOneOf.mustache | 35 +- samples/client/echo_api/r/R/api_client.R | 30 +- samples/client/echo_api/r/R/api_response.R | 8 +- samples/client/echo_api/r/R/auth_api.R | 59 +-- samples/client/echo_api/r/R/bird.R | 41 +- samples/client/echo_api/r/R/body_api.R | 271 ++----------- samples/client/echo_api/r/R/category.R | 41 +- samples/client/echo_api/r/R/data_query.R | 41 +- samples/client/echo_api/r/R/default_value.R | 41 +- samples/client/echo_api/r/R/form_api.R | 94 +---- samples/client/echo_api/r/R/header_api.R | 39 +- .../echo_api/r/R/number_properties_only.R | 41 +- samples/client/echo_api/r/R/path_api.R | 38 +- samples/client/echo_api/r/R/pet.R | 41 +- samples/client/echo_api/r/R/query.R | 41 +- samples/client/echo_api/r/R/query_api.R | 274 ++----------- samples/client/echo_api/r/R/string_enum_ref.R | 22 +- samples/client/echo_api/r/R/tag.R | 41 +- ...est_form_object_multipart_request_marker.R | 41 +- ...rue_object_all_of_query_object_parameter.R | 41 +- ...true_array_string_query_object_parameter.R | 41 +- .../R/allof_tag_api_response.R | 41 +- .../petstore/R-httr2-wrapper/R/animal.R | 41 +- .../petstore/R-httr2-wrapper/R/any_of_pig.R | 35 +- .../R/any_of_primitive_type_test.R | 35 +- .../R-httr2-wrapper/R/api_exception.R | 10 +- .../petstore/R-httr2-wrapper/R/api_response.R | 8 +- .../petstore/R-httr2-wrapper/R/basque_pig.R | 41 +- .../client/petstore/R-httr2-wrapper/R/cat.R | 41 +- .../petstore/R-httr2-wrapper/R/category.R | 41 +- .../petstore/R-httr2-wrapper/R/danish_pig.R | 41 +- .../client/petstore/R-httr2-wrapper/R/date.R | 41 +- .../client/petstore/R-httr2-wrapper/R/dog.R | 41 +- .../petstore/R-httr2-wrapper/R/dummy_model.R | 41 +- .../petstore/R-httr2-wrapper/R/fake_api.R | 155 +------- .../petstore/R-httr2-wrapper/R/format_test.R | 41 +- .../petstore/R-httr2-wrapper/R/mammal.R | 35 +- .../R-httr2-wrapper/R/model_api_response.R | 41 +- .../R-httr2-wrapper/R/nested_one_of.R | 41 +- .../R/one_of_primitive_type_test.R | 35 +- .../client/petstore/R-httr2-wrapper/R/order.R | 41 +- .../client/petstore/R-httr2-wrapper/R/pet.R | 41 +- .../petstore/R-httr2-wrapper/R/pet_api.R | 376 ++---------------- .../petstore/R-httr2-wrapper/R/pet_map.R | 41 +- .../client/petstore/R-httr2-wrapper/R/pig.R | 35 +- .../petstore/R-httr2-wrapper/R/special.R | 41 +- .../petstore/R-httr2-wrapper/R/store_api.R | 146 +------ .../client/petstore/R-httr2-wrapper/R/tag.R | 41 +- .../R-httr2-wrapper/R/update_pet_request.R | 41 +- .../client/petstore/R-httr2-wrapper/R/user.R | 41 +- .../petstore/R-httr2-wrapper/R/user_api.R | 265 ++---------- .../client/petstore/R-httr2-wrapper/R/whale.R | 41 +- .../client/petstore/R-httr2-wrapper/R/zebra.R | 41 +- .../R-httr2/R/allof_tag_api_response.R | 41 +- samples/client/petstore/R-httr2/R/animal.R | 41 +- .../client/petstore/R-httr2/R/any_of_pig.R | 35 +- .../R-httr2/R/any_of_primitive_type_test.R | 35 +- .../client/petstore/R-httr2/R/api_exception.R | 10 +- .../client/petstore/R-httr2/R/api_response.R | 8 +- .../client/petstore/R-httr2/R/basque_pig.R | 41 +- samples/client/petstore/R-httr2/R/cat.R | 41 +- samples/client/petstore/R-httr2/R/category.R | 41 +- .../client/petstore/R-httr2/R/danish_pig.R | 41 +- samples/client/petstore/R-httr2/R/date.R | 41 +- samples/client/petstore/R-httr2/R/dog.R | 41 +- samples/client/petstore/R-httr2/R/fake_api.R | 155 +------- .../client/petstore/R-httr2/R/format_test.R | 41 +- .../client/petstore/R-httr2/R/just_model.R | 41 +- samples/client/petstore/R-httr2/R/mammal.R | 35 +- .../petstore/R-httr2/R/model_api_response.R | 41 +- .../client/petstore/R-httr2/R/nested_one_of.R | 41 +- .../R-httr2/R/one_of_primitive_type_test.R | 35 +- samples/client/petstore/R-httr2/R/order.R | 41 +- samples/client/petstore/R-httr2/R/pet.R | 41 +- samples/client/petstore/R-httr2/R/pet_api.R | 376 ++---------------- samples/client/petstore/R-httr2/R/pet_map.R | 41 +- samples/client/petstore/R-httr2/R/pig.R | 35 +- samples/client/petstore/R-httr2/R/special.R | 41 +- samples/client/petstore/R-httr2/R/store_api.R | 146 +------ samples/client/petstore/R-httr2/R/tag.R | 41 +- .../petstore/R-httr2/R/update_pet_request.R | 41 +- samples/client/petstore/R-httr2/R/user.R | 41 +- samples/client/petstore/R-httr2/R/user_api.R | 265 ++---------- samples/client/petstore/R-httr2/R/whale.R | 41 +- samples/client/petstore/R-httr2/R/zebra.R | 41 +- .../petstore/R/R/allof_tag_api_response.R | 41 +- samples/client/petstore/R/R/animal.R | 41 +- samples/client/petstore/R/R/any_of_pig.R | 35 +- .../petstore/R/R/any_of_primitive_type_test.R | 35 +- samples/client/petstore/R/R/api_client.R | 30 +- samples/client/petstore/R/R/api_exception.R | 10 +- samples/client/petstore/R/R/api_response.R | 8 +- samples/client/petstore/R/R/basque_pig.R | 41 +- samples/client/petstore/R/R/cat.R | 41 +- samples/client/petstore/R/R/category.R | 41 +- samples/client/petstore/R/R/danish_pig.R | 41 +- samples/client/petstore/R/R/date.R | 41 +- samples/client/petstore/R/R/dog.R | 41 +- samples/client/petstore/R/R/dummy_model.R | 41 +- samples/client/petstore/R/R/fake_api.R | 155 +------- samples/client/petstore/R/R/format_test.R | 41 +- samples/client/petstore/R/R/mammal.R | 35 +- .../client/petstore/R/R/model_api_response.R | 41 +- samples/client/petstore/R/R/nested_one_of.R | 41 +- .../petstore/R/R/one_of_primitive_type_test.R | 35 +- samples/client/petstore/R/R/order.R | 41 +- samples/client/petstore/R/R/pet.R | 41 +- samples/client/petstore/R/R/pet_api.R | 376 ++---------------- samples/client/petstore/R/R/pet_map.R | 41 +- samples/client/petstore/R/R/pig.R | 35 +- samples/client/petstore/R/R/special.R | 41 +- samples/client/petstore/R/R/store_api.R | 146 +------ samples/client/petstore/R/R/tag.R | 41 +- .../client/petstore/R/R/update_pet_request.R | 41 +- samples/client/petstore/R/R/user.R | 41 +- samples/client/petstore/R/R/user_api.R | 265 ++---------- samples/client/petstore/R/R/whale.R | 41 +- samples/client/petstore/R/R/zebra.R | 41 +- 125 files changed, 1450 insertions(+), 6122 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/r/ApiResponse.mustache index 28520f752bef..c817cb42713e 100644 --- a/modules/openapi-generator/src/main/resources/r/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/r/ApiResponse.mustache @@ -17,8 +17,7 @@ ApiResponse <- R6::R6Class( status_code = NULL, status_code_desc = NULL, headers = NULL, - #' Initialize a new ApiResponse class. - #' + #' @description #' Initialize a new ApiResponse class. #' @@ -27,7 +26,6 @@ ApiResponse <- R6::R6Class( #' @param status_code The HTTP response status code. #' @param status_code_desc The brief description of the HTTP response status code. #' @param headers The HTTP response headers. - #' @export initialize = function(content = NULL, response = NULL, status_code = NULL, @@ -40,15 +38,13 @@ ApiResponse <- R6::R6Class( self$headers <- headers }, - #' Return the response as text - #' + #' @description #' The response is stored as a raw vector. Use this to access the response after #' converting it to text. If the response is not coercible to text NA is returned. #' #' @param from_encoding The encoding of the raw response. #' @param to_encoding The target encoding of the return value. - #' @export response_as_text = function(from_encoding = "", to_encoding = "UTF-8") { if (is.null(self$response)) { self$response <- charToRaw(jsonlite::toJSON("NULL")) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 5bf0cd527626..14e3fe6b54aa 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -6,79 +6,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -{{! Adding the below changes for generating documentation for the api methods. }} -#' \describe{ -{{#operation}} -#' \strong{ {{operationId}} } \emph{ {{#lambdaRdocEscape}}{{summary}}{{/lambdaRdocEscape}} } -{{#notes}} -#' {{#lambdaRdocEscape}}{{{.}}}{{/lambdaRdocEscape}} -{{/notes}} -#' -#' \itemize{ -{{#allParams}} -{{#isEnum}} -#' \item \emph{ @param } {{paramName}} Enum < {{#allowableValues}}{{values}}{{/allowableValues}} > -{{/isEnum}} -{{^isEnum}} -{{#isContainer}} -{{#isArray}} -{{#items}} -{{#isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} list( {{dataType}} ) -{{/isPrimitiveType}} -{{^isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} list( \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%> ) -{{/isPrimitiveType}} -{{/items}} -{{/isArray}} -{{#isMap}} -{{#isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} named list( {{dataType}} ) -{{/isPrimitiveType}} -{{^isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} named list( \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%> ) -{{/isPrimitiveType}} -{{/isMap}} -{{/isContainer}} -{{^isContainer}} -{{#isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} {{dataType}} -{{/isPrimitiveType}} -{{^isPrimitiveType}} -#' \item \emph{ @param } {{paramName}} \link{{=<% %>=}}{<%dataType%>}<%={{ }}=%> -{{/isPrimitiveType}} -{{/isContainer}} -{{/isEnum}} -{{/allParams}} -{{#returnType}} -{{^returnTypeIsPrimitive}} -#' \item \emph{ @returnType } {{#returnContainer}}{{#isArray}}list( {{/isArray}}{{#isMap}}named list( {{/isMap}}{{/returnContainer}}\link{{=<% %>=}}{<%#returnContainer%><%={{ }}=%>{{returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{returnType}}{{=<% %>=}}<%/returnContainer%>}<%={{ }}=%>{{#returnContainer}}{{#isArray}} ){{/isArray}}{{#isMap}} ){{/isMap}}{{/returnContainer}} \cr -{{/returnTypeIsPrimitive}} -{{/returnType}} -#' -{{#useRlangExceptionHandling}} -#' \item On encountering errors, an error of subclass ApiException will be thrown. -{{/useRlangExceptionHandling}} -#' -{{#responses}} -#' \item status code : {{code}} | {{{message}}} -#' -#'{{#dataType}} \item return type : {{{.}}}{{/dataType}} -#' \item response headers : -#' -#' \tabular{ll}{ -{{#headers}} -#' {{name}} \tab {{{description}}} \cr -{{/headers}} -#' } -{{/responses}} -#' } -#' -{{/operation}} -#' } -#' -#' #' @examples #' \dontrun{ {{#operation}} @@ -185,13 +112,11 @@ "{{classname}}", public = list( api_client = NULL, - #' Initialize a new {{{classname}}}. - #' + #' @description #' Initialize a new {{{classname}}}. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -200,8 +125,7 @@ } }, {{#operation}} - #' {{{summary}}} - #' + #' @description #' {{{description}}}{{^description}}{{{summary}}}{{/description}} #' @@ -218,8 +142,8 @@ #' @param data_file (optional) name of the data file to save the result {{/returnType}} #' @param ... Other optional arguments + #' #' @return {{{returnType}}}{{^returnType}}void{{/returnType}} - #' @export {{{operationId}}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) { local_var_response <- self${{{operationId}}}{{WithHttpInfo}}({{#allParams}}{{paramName}}, {{/allParams}}{{#vendorExtensions.x-streaming}}stream_callback = stream_callback, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = data_file, {{/returnType}}...) {{#vendorExtensions.x-streaming}} @@ -238,8 +162,7 @@ local_var_response } }, - #' {{{summary}}} - #' + #' @description #' {{{description}}}{{^description}}{{{summary}}}{{/description}} #' @@ -256,8 +179,8 @@ #' @param data_file (optional) name of the data file to save the result {{/returnType}} #' @param ... Other optional arguments + #' #' @return API response ({{{returnType}}}{{^returnType}}void{{/returnType}}) with additional information such as HTTP status code, headers - #' @export {{{operationId}}}{{WithHttpInfo}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) { args <- list(...) query_params <- list() 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 3057ea2c4004..fb1285d0f177 100644 --- a/modules/openapi-generator/src/main/resources/r/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_client.mustache @@ -158,8 +158,7 @@ ApiClient <- R6::R6Class( self$max_retry_attempts <- max_retry_attempts } }, - #' Prepare to make an API call with the retry logic. - #' + #' @description #' Prepare to make an API call with the retry logic. #' @@ -174,8 +173,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process the data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export CallApi = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, body, stream_callback = NULL, ...) { @@ -205,8 +204,7 @@ ApiClient <- R6::R6Class( resp }, - #' Make an API call - #' + #' @description #' Make an API call #' @@ -221,8 +219,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export Execute = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, @@ -316,7 +314,7 @@ ApiClient <- R6::R6Class( # return ApiResponse api_response <- ApiResponse$new() - api_response$status_code <- httr::status_code(httr_response) + api_response$status_code <- httr::status_code(httr_response) api_response$status_code_desc <- httr::http_status(httr_response)$reason api_response$response <- httr::content(httr_response, "raw") api_response$headers <- httr::headers(httr_response) @@ -324,32 +322,31 @@ ApiClient <- R6::R6Class( api_response } }, - #' Deserialize the content of API response to the given type. - #' + #' @description #' Deserialize the content of API response to the given type. #' #' @param raw_response Raw response. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserialize = function(raw_response, return_type, pkg_env) { resp_obj <- jsonlite::fromJSON(raw_response) self$deserializeObj(resp_obj, return_type, pkg_env) }, - #' Deserialize the response from jsonlite object based on the given type - #' + #' @description #' Deserialize the response from jsonlite object based on the given type #' by handling complex and nested types by iterating recursively - #' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc., + #' Example return_types will be like "array[integer]", "map(Pet)", + #' "array[map(Tag)]", etc., #' #' @param obj Response object. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserializeObj = function(obj, return_type, pkg_env) { return_obj <- NULL primitive_types <- c("character", "numeric", "integer", "logical", "complex") @@ -411,15 +408,14 @@ ApiClient <- R6::R6Class( } return_obj }, - #' Return a property header (for accept or content-type). - #' + #' @description #' Return a property header (for accept or content-type). If JSON-related MIME is found, #' return it. Otherwise, return the first one, if any. #' #' @param headers A list of headers + #' #' @return A header (e.g. 'application/json') - #' @export select_header = function(headers) { if (length(headers) == 0) { return(invisible(NULL)) diff --git a/modules/openapi-generator/src/main/resources/r/api_exception.mustache b/modules/openapi-generator/src/main/resources/r/api_exception.mustache index 64aa6c3d76a1..5c2e0bc45b2a 100644 --- a/modules/openapi-generator/src/main/resources/r/api_exception.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_exception.mustache @@ -22,15 +22,13 @@ ApiException <- R6::R6Class( {{#errorObjectType}} error_object = NULL, {{/errorObjectType}} - #' Initialize a new ApiException class. - #' + #' @description - #' Initialize a new ApiExceptino class. + #' Initialize a new ApiException class. #' #' @param status HTTP status. #' @param reason Reason of the ApiException. #' @param http_response HTTP response object. - #' @export initialize = function(status = NULL, reason = NULL, http_response = NULL) { if (!is.null(http_response)) { self$status <- http_response$status_code @@ -54,13 +52,11 @@ ApiException <- R6::R6Class( {{/errorObjectType}} } }, - #' Returns the string format of ApiException. - #' + #' @description #' Returns the string format of ApiException. #' #' @return the string format of ApiException. - #' @export toString = function() { errorMsg <- "" errorMsg <- paste("status : ", self$status, "\n", sep = "") diff --git a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache index 3c8e5d74147f..62e6dd7e41c1 100644 --- a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache @@ -17,13 +17,11 @@ actual_type = NULL, #' @field any_of a list of object types defined in the anyOf schema. any_of = list({{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}}), - #' Initialize a new {{{classname}}}. - #' + #' @description #' Initialize a new {{{classname}}}. #' #' @param instance an instance of the object defined in the anyOf schemas: {{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}} - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -35,26 +33,24 @@ get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of {{{classname}}}. - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}}. #' An alias to the method `fromJSON`. #' #' @param input The input JSON. + #' #' @return An instance of {{{classname}}}. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of {{{classname}}}. - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}}. #' #' @param input The input JSON. + #' #' @return An instance of {{{classname}}}. - #' @export fromJSON = function(input) { error_messages <- list() @@ -88,13 +84,11 @@ stop(paste("No match found when deserializing the input into {{{classname}}} with anyOf schemas {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: >>", paste(error_messages, collapse = " >> "))) }, - #' Serialize {{{classname}}} to JSON string. - #' + #' @description #' Serialize {{{classname}}} to JSON string. #' #' @return JSON string representation of the {{{classname}}}. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify((self$actual_instance$toJSONString()))) @@ -102,13 +96,11 @@ NULL } }, - #' Serialize {{{classname}}} to JSON. - #' + #' @description #' Serialize {{{classname}}} to JSON. #' #' @return JSON representation of the {{{classname}}}. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -116,14 +108,12 @@ NULL } }, - #' Validate the input JSON with respect to {{{classname}}}. - #' + #' @description #' Validate the input JSON with respect to {{{classname}}} and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -136,13 +126,11 @@ self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -152,12 +140,9 @@ jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache index 266cd9f2a872..64d136449be1 100644 --- a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache @@ -9,13 +9,11 @@ {{classname}} <- R6::R6Class( "{{classname}}", public = list( - #' Initialize a new {{{classname}}} class. - #' + #' @description #' Initialize a new {{{classname}}} class. #' #' @param ... Optional arguments. - #' @export initialize = function(...) { local.optional.var <- list(...) val <- unlist(local.optional.var) @@ -38,48 +36,42 @@ } private$value <- val }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return {{{classname}}} in JSON format - #' @export toJSON = function() { jsonlite::toJSON(private$value, auto_unbox = TRUE) }, - #' Deserialize JSON string into an instance of {{{classname}}} - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}} #' #' @param input_json the JSON input + #' #' @return the instance of {{{classname}}} - #' @export fromJSON = function(input_json) { private$value <- jsonlite::fromJSON(input_json, simplifyVector = FALSE) self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return {{{classname}}} in JSON format - #' @export toJSONString = function() { as.character(jsonlite::toJSON(private$value, auto_unbox = TRUE)) }, - #' Deserialize JSON string into an instance of {{{classname}}} - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}} #' #' @param input_json the JSON input + #' #' @return the instance of {{{classname}}} - #' @export fromJSONString = function(input_json) { private$value <- jsonlite::fromJSON(input_json, simplifyVector = FALSE) diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index cdafe398e0d8..24f0ddf8c8f0 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -34,8 +34,7 @@ `_discriminator_property_name` = '{{discriminator.propertyName}}', {{#discriminator.mappedModels}}{{#-first}}`_discriminator_mapping_name` = c({{/-first}}'{{mappingName}}' = '{{modelName}}'{{^-last}}, {{/-last}}{{#-last}}),{{/-last}}{{/discriminator.mappedModels}} {{/discriminator}} - #' Initialize a new {{{classname}}} class. - #' + #' @description #' Initialize a new {{{classname}}} class. #' @@ -49,7 +48,6 @@ #' @param additional_properties additional properties (optional) {{/isAdditionalPropertiesTrue}} #' @param ... Other optional arguments. - #' @export initialize = function({{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...) { {{#requiredVars}} if (!missing(`{{name}}`)) { @@ -203,13 +201,11 @@ } {{/isAdditionalPropertiesTrue}} }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return {{{classname}}} in JSON format - #' @export toJSON = function() { {{classname}}Object <- list() {{#vars}} @@ -251,14 +247,12 @@ {{/isAdditionalPropertiesTrue}} {{classname}}Object }, - #' Deserialize JSON string into an instance of {{{classname}}} - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}} #' #' @param input_json the JSON input #' @return the instance of {{{classname}}} - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) {{#vars}} @@ -307,13 +301,11 @@ {{/isAdditionalPropertiesTrue}} self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return {{{classname}}} in JSON format - #' @export toJSONString = function() { jsoncontent <- c( {{#vars}} @@ -383,14 +375,12 @@ json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) {{/isAdditionalPropertiesTrue}} }, - #' Deserialize JSON string into an instance of {{{classname}}} - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}} #' #' @param input_json the JSON input #' @return the instance of {{{classname}}} - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) {{#vars}} @@ -436,13 +426,11 @@ {{/isAdditionalPropertiesTrue}} self }, - #' Validate JSON input with respect to {{classname}} - #' + #' @description #' Validate JSON input with respect to {{classname}} and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) {{#requiredVars}} @@ -515,23 +503,19 @@ } {{/requiredVars}} }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of {{{classname}}} - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { {{#allVars}} {{^isNullable}} @@ -590,13 +574,11 @@ {{/allVars}} TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() {{#allVars}} @@ -656,12 +638,9 @@ {{/allVars}} invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache index 4c70d776623c..4fe94c4ad043 100644 --- a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache @@ -17,13 +17,11 @@ actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list({{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}), - #' Initialize a new {{{classname}}}. - #' + #' @description #' Initialize a new {{{classname}}}. #' #' @param instance an instance of the object defined in the oneOf schemas: {{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}} - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -35,26 +33,24 @@ get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of {{{classname}}}. - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}}. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of {{{classname}}}. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of {{{classname}}}. - #' + #' @description #' Deserialize JSON string into an instance of {{{classname}}}. #' #' @param input The input JSON. + #' #' @return An instance of {{{classname}}}. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -140,13 +136,11 @@ self }, - #' Serialize {{{classname}}} to JSON string. - #' + #' @description #' Serialize {{{classname}}} to JSON string. #' #' @return JSON string representation of the {{{classname}}}. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -154,13 +148,11 @@ NULL } }, - #' Serialize {{{classname}}} to JSON. - #' + #' @description #' Serialize {{{classname}}} to JSON. #' #' @return JSON representation of the {{{classname}}}. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -168,14 +160,12 @@ NULL } }, - #' Validate the input JSON with respect to {{{classname}}}. - #' + #' @description #' Validate the input JSON with respect to {{{classname}}} and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -188,13 +178,11 @@ self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -204,12 +192,9 @@ jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/api_client.R b/samples/client/echo_api/r/R/api_client.R index 9fbeffaa59f6..3c9001df6ef3 100644 --- a/samples/client/echo_api/r/R/api_client.R +++ b/samples/client/echo_api/r/R/api_client.R @@ -125,8 +125,7 @@ ApiClient <- R6::R6Class( self$max_retry_attempts <- max_retry_attempts } }, - #' Prepare to make an API call with the retry logic. - #' + #' @description #' Prepare to make an API call with the retry logic. #' @@ -141,8 +140,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process the data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export CallApi = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, body, stream_callback = NULL, ...) { @@ -172,8 +171,7 @@ ApiClient <- R6::R6Class( resp }, - #' Make an API call - #' + #' @description #' Make an API call #' @@ -188,8 +186,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export Execute = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, @@ -268,7 +266,7 @@ ApiClient <- R6::R6Class( # return ApiResponse api_response <- ApiResponse$new() - api_response$status_code <- httr::status_code(httr_response) + api_response$status_code <- httr::status_code(httr_response) api_response$status_code_desc <- httr::http_status(httr_response)$reason api_response$response <- httr::content(httr_response, "raw") api_response$headers <- httr::headers(httr_response) @@ -276,32 +274,31 @@ ApiClient <- R6::R6Class( api_response } }, - #' Deserialize the content of API response to the given type. - #' + #' @description #' Deserialize the content of API response to the given type. #' #' @param raw_response Raw response. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserialize = function(raw_response, return_type, pkg_env) { resp_obj <- jsonlite::fromJSON(raw_response) self$deserializeObj(resp_obj, return_type, pkg_env) }, - #' Deserialize the response from jsonlite object based on the given type - #' + #' @description #' Deserialize the response from jsonlite object based on the given type #' by handling complex and nested types by iterating recursively - #' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc., + #' Example return_types will be like "array[integer]", "map(Pet)", + #' "array[map(Tag)]", etc., #' #' @param obj Response object. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserializeObj = function(obj, return_type, pkg_env) { return_obj <- NULL primitive_types <- c("character", "numeric", "integer", "logical", "complex") @@ -363,15 +360,14 @@ ApiClient <- R6::R6Class( } return_obj }, - #' Return a property header (for accept or content-type). - #' + #' @description #' Return a property header (for accept or content-type). If JSON-related MIME is found, #' return it. Otherwise, return the first one, if any. #' #' @param headers A list of headers + #' #' @return A header (e.g. 'application/json') - #' @export select_header = function(headers) { if (length(headers) == 0) { return(invisible(NULL)) diff --git a/samples/client/echo_api/r/R/api_response.R b/samples/client/echo_api/r/R/api_response.R index 999532bf3611..7d628bab258d 100644 --- a/samples/client/echo_api/r/R/api_response.R +++ b/samples/client/echo_api/r/R/api_response.R @@ -24,8 +24,7 @@ ApiResponse <- R6::R6Class( status_code = NULL, status_code_desc = NULL, headers = NULL, - #' Initialize a new ApiResponse class. - #' + #' @description #' Initialize a new ApiResponse class. #' @@ -34,7 +33,6 @@ ApiResponse <- R6::R6Class( #' @param status_code The HTTP response status code. #' @param status_code_desc The brief description of the HTTP response status code. #' @param headers The HTTP response headers. - #' @export initialize = function(content = NULL, response = NULL, status_code = NULL, @@ -47,15 +45,13 @@ ApiResponse <- R6::R6Class( self$headers <- headers }, - #' Return the response as text - #' + #' @description #' The response is stored as a raw vector. Use this to access the response after #' converting it to text. If the response is not coercible to text NA is returned. #' #' @param from_encoding The encoding of the raw response. #' @param to_encoding The target encoding of the return value. - #' @export response_as_text = function(from_encoding = "", to_encoding = "UTF-8") { if (is.null(self$response)) { self$response <- charToRaw(jsonlite::toJSON("NULL")) diff --git a/samples/client/echo_api/r/R/auth_api.R b/samples/client/echo_api/r/R/auth_api.R index aa3d8e416bb5..3785b97b5cb7 100644 --- a/samples/client/echo_api/r/R/auth_api.R +++ b/samples/client/echo_api/r/R/auth_api.R @@ -12,41 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestAuthHttpBasic } \emph{ To test HTTP basic authentication } -#' To test HTTP basic authentication -#' -#' \itemize{ -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestAuthHttpBearer } \emph{ To test HTTP bearer authentication } -#' To test HTTP bearer authentication -#' -#' \itemize{ -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestAuthHttpBasic #################### @@ -90,13 +55,11 @@ AuthApi <- R6::R6Class( "AuthApi", public = list( api_client = NULL, - #' Initialize a new AuthApi. - #' + #' @description #' Initialize a new AuthApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -104,15 +67,14 @@ AuthApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' To test HTTP basic authentication - #' + #' @description #' To test HTTP basic authentication #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestAuthHttpBasic = function(data_file = NULL, ...) { local_var_response <- self$TestAuthHttpBasicWithHttpInfo(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -125,15 +87,14 @@ AuthApi <- R6::R6Class( local_var_response } }, - #' To test HTTP basic authentication - #' + #' @description #' To test HTTP basic authentication #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestAuthHttpBasicWithHttpInfo = function(data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -194,15 +155,14 @@ AuthApi <- R6::R6Class( local_var_resp } }, - #' To test HTTP bearer authentication - #' + #' @description #' To test HTTP bearer authentication #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestAuthHttpBearer = function(data_file = NULL, ...) { local_var_response <- self$TestAuthHttpBearerWithHttpInfo(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -215,15 +175,14 @@ AuthApi <- R6::R6Class( local_var_response } }, - #' To test HTTP bearer authentication - #' + #' @description #' To test HTTP bearer authentication #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestAuthHttpBearerWithHttpInfo = function(data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/bird.R b/samples/client/echo_api/r/R/bird.R index 57616beecb71..5132beb3788c 100644 --- a/samples/client/echo_api/r/R/bird.R +++ b/samples/client/echo_api/r/R/bird.R @@ -17,15 +17,13 @@ Bird <- R6::R6Class( public = list( `size` = NULL, `color` = NULL, - #' Initialize a new Bird class. - #' + #' @description #' Initialize a new Bird class. #' #' @param size size #' @param color color #' @param ... Other optional arguments. - #' @export initialize = function(`size` = NULL, `color` = NULL, ...) { if (!is.null(`size`)) { if (!(is.character(`size`) && length(`size`) == 1)) { @@ -40,13 +38,11 @@ Bird <- R6::R6Class( self$`color` <- `color` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Bird in JSON format - #' @export toJSON = function() { BirdObject <- list() if (!is.null(self$`size`)) { @@ -59,14 +55,12 @@ Bird <- R6::R6Class( } BirdObject }, - #' Deserialize JSON string into an instance of Bird - #' + #' @description #' Deserialize JSON string into an instance of Bird #' #' @param input_json the JSON input #' @return the instance of Bird - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`size`)) { @@ -77,13 +71,11 @@ Bird <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Bird in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`size`)) { @@ -106,67 +98,54 @@ Bird <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Bird - #' + #' @description #' Deserialize JSON string into an instance of Bird #' #' @param input_json the JSON input #' @return the instance of Bird - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` self$`color` <- this_object$`color` self }, - #' Validate JSON input with respect to Bird - #' + #' @description #' Validate JSON input with respect to Bird and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Bird - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/body_api.R b/samples/client/echo_api/r/R/body_api.R index 5e23d0581432..5fb012236667 100644 --- a/samples/client/echo_api/r/R/body_api.R +++ b/samples/client/echo_api/r/R/body_api.R @@ -12,173 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestBinaryGif } \emph{ Test binary (gif) response body } -#' Test binary (gif) response body -#' -#' \itemize{ -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : data.frame -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestBodyApplicationOctetstreamBinary } \emph{ Test body parameter(s) } -#' Test body parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } body data.frame -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestBodyMultipartFormdataArrayOfBinary } \emph{ Test array of binary in multipart mime } -#' Test array of binary in multipart mime -#' -#' \itemize{ -#' \item \emph{ @param } files list( data.frame ) -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestBodyMultipartFormdataSingleBinary } \emph{ Test single binary in multipart mime } -#' Test single binary in multipart mime -#' -#' \itemize{ -#' \item \emph{ @param } my_file data.frame -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyAllOfPet } \emph{ Test body parameter(s) } -#' Test body parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyFreeFormObjectResponseString } \emph{ Test free form object } -#' Test free form object -#' -#' \itemize{ -#' \item \emph{ @param } body object -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyPet } \emph{ Test body parameter(s) } -#' Test body parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyPetResponseString } \emph{ Test empty response body } -#' Test empty response body -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyStringEnum } \emph{ Test string enum response body } -#' Test string enum response body -#' -#' \itemize{ -#' \item \emph{ @param } body character -#' \item \emph{ @returnType } \link{StringEnumRef} \cr -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : StringEnumRef -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestEchoBodyTagResponseString } \emph{ Test empty json (request body) } -#' Test empty json (request body) -#' -#' \itemize{ -#' \item \emph{ @param } tag \link{Tag} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestBinaryGif #################### @@ -328,13 +161,11 @@ BodyApi <- R6::R6Class( "BodyApi", public = list( api_client = NULL, - #' Initialize a new BodyApi. - #' + #' @description #' Initialize a new BodyApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -342,15 +173,14 @@ BodyApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Test binary (gif) response body - #' + #' @description #' Test binary (gif) response body #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return data.frame - #' @export TestBinaryGif = function(data_file = NULL, ...) { local_var_response <- self$TestBinaryGifWithHttpInfo(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -363,15 +193,14 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test binary (gif) response body - #' + #' @description #' Test binary (gif) response body #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (data.frame) with additional information such as HTTP status code, headers - #' @export TestBinaryGifWithHttpInfo = function(data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -428,16 +257,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param body (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestBodyApplicationOctetstreamBinary = function(body = NULL, data_file = NULL, ...) { local_var_response <- self$TestBodyApplicationOctetstreamBinaryWithHttpInfo(body, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -450,16 +278,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param body (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestBodyApplicationOctetstreamBinaryWithHttpInfo = function(body = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -523,16 +350,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test array of binary in multipart mime - #' + #' @description #' Test array of binary in multipart mime #' #' @param files #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestBodyMultipartFormdataArrayOfBinary = function(files, data_file = NULL, ...) { local_var_response <- self$TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -545,16 +371,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test array of binary in multipart mime - #' + #' @description #' Test array of binary in multipart mime #' #' @param files #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo = function(files, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -617,16 +442,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test single binary in multipart mime - #' + #' @description #' Test single binary in multipart mime #' #' @param my_file (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestBodyMultipartFormdataSingleBinary = function(my_file = NULL, data_file = NULL, ...) { local_var_response <- self$TestBodyMultipartFormdataSingleBinaryWithHttpInfo(my_file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -639,16 +463,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test single binary in multipart mime - #' + #' @description #' Test single binary in multipart mime #' #' @param my_file (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestBodyMultipartFormdataSingleBinaryWithHttpInfo = function(my_file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -707,16 +530,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export TestEchoBodyAllOfPet = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyAllOfPetWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -729,16 +551,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export TestEchoBodyAllOfPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -802,16 +623,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test free form object - #' + #' @description #' Test free form object #' #' @param body (optional) Free form object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestEchoBodyFreeFormObjectResponseString = function(body = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyFreeFormObjectResponseStringWithHttpInfo(body, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -824,16 +644,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test free form object - #' + #' @description #' Test free form object #' #' @param body (optional) Free form object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestEchoBodyFreeFormObjectResponseStringWithHttpInfo = function(body = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -897,16 +716,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export TestEchoBodyPet = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyPetWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -919,16 +737,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test body parameter(s) - #' + #' @description #' Test body parameter(s) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export TestEchoBodyPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -992,16 +809,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test empty response body - #' + #' @description #' Test empty response body #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestEchoBodyPetResponseString = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyPetResponseStringWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1014,16 +830,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test empty response body - #' + #' @description #' Test empty response body #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestEchoBodyPetResponseStringWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1087,16 +902,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test string enum response body - #' + #' @description #' Test string enum response body #' #' @param body (optional) String enum #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return StringEnumRef - #' @export TestEchoBodyStringEnum = function(body = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyStringEnumWithHttpInfo(body, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1109,16 +923,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test string enum response body - #' + #' @description #' Test string enum response body #' #' @param body (optional) String enum #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (StringEnumRef) with additional information such as HTTP status code, headers - #' @export TestEchoBodyStringEnumWithHttpInfo = function(body = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1182,16 +995,15 @@ BodyApi <- R6::R6Class( local_var_resp } }, - #' Test empty json (request body) - #' + #' @description #' Test empty json (request body) #' #' @param tag (optional) Tag object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestEchoBodyTagResponseString = function(tag = NULL, data_file = NULL, ...) { local_var_response <- self$TestEchoBodyTagResponseStringWithHttpInfo(tag, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1204,16 +1016,15 @@ BodyApi <- R6::R6Class( local_var_response } }, - #' Test empty json (request body) - #' + #' @description #' Test empty json (request body) #' #' @param tag (optional) Tag object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestEchoBodyTagResponseStringWithHttpInfo = function(tag = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/category.R b/samples/client/echo_api/r/R/category.R index 3213851b9e9e..cbf3a88b9ddc 100644 --- a/samples/client/echo_api/r/R/category.R +++ b/samples/client/echo_api/r/R/category.R @@ -17,15 +17,13 @@ Category <- R6::R6Class( public = list( `id` = NULL, `name` = NULL, - #' Initialize a new Category class. - #' + #' @description #' Initialize a new Category class. #' #' @param id id #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -40,13 +38,11 @@ Category <- R6::R6Class( self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSON = function() { CategoryObject <- list() if (!is.null(self$`id`)) { @@ -59,14 +55,12 @@ Category <- R6::R6Class( } CategoryObject }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -77,13 +71,11 @@ Category <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -106,67 +98,54 @@ Category <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to Category - #' + #' @description #' Validate JSON input with respect to Category and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Category - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/data_query.R b/samples/client/echo_api/r/R/data_query.R index 0a749f98d6ed..edc0bcda0a72 100644 --- a/samples/client/echo_api/r/R/data_query.R +++ b/samples/client/echo_api/r/R/data_query.R @@ -24,8 +24,7 @@ DataQuery <- R6::R6Class( `suffix` = NULL, `text` = NULL, `date` = NULL, - #' Initialize a new DataQuery class. - #' + #' @description #' Initialize a new DataQuery class. #' @@ -35,7 +34,6 @@ DataQuery <- R6::R6Class( #' @param text Some text containing white spaces #' @param date A date #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `outcomes` = [SUCCESS, FAILURE], `suffix` = NULL, `text` = NULL, `date` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -67,13 +65,11 @@ DataQuery <- R6::R6Class( self$`date` <- `date` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DataQuery in JSON format - #' @export toJSON = function() { DataQueryObject <- list() if (!is.null(self$`id`)) { @@ -98,14 +94,12 @@ DataQuery <- R6::R6Class( } DataQueryObject }, - #' Deserialize JSON string into an instance of DataQuery - #' + #' @description #' Deserialize JSON string into an instance of DataQuery #' #' @param input_json the JSON input #' @return the instance of DataQuery - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -125,13 +119,11 @@ DataQuery <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DataQuery in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -178,14 +170,12 @@ DataQuery <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of DataQuery - #' + #' @description #' Deserialize JSON string into an instance of DataQuery #' #' @param input_json the JSON input #' @return the instance of DataQuery - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -195,53 +185,42 @@ DataQuery <- R6::R6Class( self$`date` <- this_object$`date` self }, - #' Validate JSON input with respect to DataQuery - #' + #' @description #' Validate JSON input with respect to DataQuery and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DataQuery - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/default_value.R b/samples/client/echo_api/r/R/default_value.R index 6f051e08903f..4456d7fcea03 100644 --- a/samples/client/echo_api/r/R/default_value.R +++ b/samples/client/echo_api/r/R/default_value.R @@ -29,8 +29,7 @@ DefaultValue <- R6::R6Class( `array_string_nullable` = NULL, `array_string_extension_nullable` = NULL, `string_nullable` = NULL, - #' Initialize a new DefaultValue class. - #' + #' @description #' Initialize a new DefaultValue class. #' @@ -43,7 +42,6 @@ DefaultValue <- R6::R6Class( #' @param array_string_extension_nullable array_string_extension_nullable #' @param string_nullable string_nullable #' @param ... Other optional arguments. - #' @export initialize = function(`array_string_enum_ref_default` = ["success","failure"], `array_string_enum_default` = ["success","failure"], `array_string_default` = ["failure","skipped"], `array_integer_default` = [1,3], `array_string` = NULL, `array_string_nullable` = NULL, `array_string_extension_nullable` = NULL, `string_nullable` = NULL, ...) { if (!is.null(`array_string_enum_ref_default`)) { stopifnot(is.vector(`array_string_enum_ref_default`), length(`array_string_enum_ref_default`) != 0) @@ -87,13 +85,11 @@ DefaultValue <- R6::R6Class( self$`string_nullable` <- `string_nullable` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DefaultValue in JSON format - #' @export toJSON = function() { DefaultValueObject <- list() if (!is.null(self$`array_string_enum_ref_default`)) { @@ -130,14 +126,12 @@ DefaultValue <- R6::R6Class( } DefaultValueObject }, - #' Deserialize JSON string into an instance of DefaultValue - #' + #' @description #' Deserialize JSON string into an instance of DefaultValue #' #' @param input_json the JSON input #' @return the instance of DefaultValue - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`array_string_enum_ref_default`)) { @@ -166,13 +160,11 @@ DefaultValue <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DefaultValue in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`array_string_enum_ref_default`)) { @@ -243,14 +235,12 @@ DefaultValue <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of DefaultValue - #' + #' @description #' Deserialize JSON string into an instance of DefaultValue #' #' @param input_json the JSON input #' @return the instance of DefaultValue - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`array_string_enum_ref_default` <- ApiClient$new()$deserializeObj(this_object$`array_string_enum_ref_default`, "array[StringEnumRef]", loadNamespace("openapi")) @@ -263,53 +253,42 @@ DefaultValue <- R6::R6Class( self$`string_nullable` <- this_object$`string_nullable` self }, - #' Validate JSON input with respect to DefaultValue - #' + #' @description #' Validate JSON input with respect to DefaultValue and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DefaultValue - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/form_api.R b/samples/client/echo_api/r/R/form_api.R index 17f7c520ca80..25bacabdd6a6 100644 --- a/samples/client/echo_api/r/R/form_api.R +++ b/samples/client/echo_api/r/R/form_api.R @@ -12,66 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestFormIntegerBooleanString } \emph{ Test form parameter(s) } -#' Test form parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } integer_form integer -#' \item \emph{ @param } boolean_form character -#' \item \emph{ @param } string_form character -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestFormObjectMultipart } \emph{ Test form parameter(s) for multipart schema } -#' Test form parameter(s) for multipart schema -#' -#' \itemize{ -#' \item \emph{ @param } marker \link{TestFormObjectMultipartRequestMarker} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestFormOneof } \emph{ Test form parameter(s) for oneOf schema } -#' Test form parameter(s) for oneOf schema -#' -#' \itemize{ -#' \item \emph{ @param } form1 character -#' \item \emph{ @param } form2 integer -#' \item \emph{ @param } form3 character -#' \item \emph{ @param } form4 character -#' \item \emph{ @param } id integer -#' \item \emph{ @param } name character -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestFormIntegerBooleanString #################### @@ -131,13 +71,11 @@ FormApi <- R6::R6Class( "FormApi", public = list( api_client = NULL, - #' Initialize a new FormApi. - #' + #' @description #' Initialize a new FormApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -145,8 +83,7 @@ FormApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Test form parameter(s) - #' + #' @description #' Test form parameter(s) #' @@ -155,8 +92,8 @@ FormApi <- R6::R6Class( #' @param string_form (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestFormIntegerBooleanString = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ...) { local_var_response <- self$TestFormIntegerBooleanStringWithHttpInfo(integer_form, boolean_form, string_form, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -169,8 +106,7 @@ FormApi <- R6::R6Class( local_var_response } }, - #' Test form parameter(s) - #' + #' @description #' Test form parameter(s) #' @@ -179,8 +115,8 @@ FormApi <- R6::R6Class( #' @param string_form (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestFormIntegerBooleanStringWithHttpInfo = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -243,16 +179,15 @@ FormApi <- R6::R6Class( local_var_resp } }, - #' Test form parameter(s) for multipart schema - #' + #' @description #' Test form parameter(s) for multipart schema #' #' @param marker #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestFormObjectMultipart = function(marker, data_file = NULL, ...) { local_var_response <- self$TestFormObjectMultipartWithHttpInfo(marker, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -265,16 +200,15 @@ FormApi <- R6::R6Class( local_var_response } }, - #' Test form parameter(s) for multipart schema - #' + #' @description #' Test form parameter(s) for multipart schema #' #' @param marker #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestFormObjectMultipartWithHttpInfo = function(marker, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -337,8 +271,7 @@ FormApi <- R6::R6Class( local_var_resp } }, - #' Test form parameter(s) for oneOf schema - #' + #' @description #' Test form parameter(s) for oneOf schema #' @@ -350,8 +283,8 @@ FormApi <- R6::R6Class( #' @param name (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestFormOneof = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ...) { local_var_response <- self$TestFormOneofWithHttpInfo(form1, form2, form3, form4, id, name, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -364,8 +297,7 @@ FormApi <- R6::R6Class( local_var_response } }, - #' Test form parameter(s) for oneOf schema - #' + #' @description #' Test form parameter(s) for oneOf schema #' @@ -377,8 +309,8 @@ FormApi <- R6::R6Class( #' @param name (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestFormOneofWithHttpInfo = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/header_api.R b/samples/client/echo_api/r/R/header_api.R index 35ea7700e76f..4117739ac339 100644 --- a/samples/client/echo_api/r/R/header_api.R +++ b/samples/client/echo_api/r/R/header_api.R @@ -12,31 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestHeaderIntegerBooleanStringEnums } \emph{ Test header parameter(s) } -#' Test header parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } integer_header integer -#' \item \emph{ @param } boolean_header character -#' \item \emph{ @param } string_header character -#' \item \emph{ @param } enum_nonref_string_header Enum < [success, failure, unclassified] > -#' \item \emph{ @param } enum_ref_string_header \link{StringEnumRef} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestHeaderIntegerBooleanStringEnums #################### @@ -65,13 +40,11 @@ HeaderApi <- R6::R6Class( "HeaderApi", public = list( api_client = NULL, - #' Initialize a new HeaderApi. - #' + #' @description #' Initialize a new HeaderApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -79,8 +52,7 @@ HeaderApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Test header parameter(s) - #' + #' @description #' Test header parameter(s) #' @@ -91,8 +63,8 @@ HeaderApi <- R6::R6Class( #' @param enum_ref_string_header (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestHeaderIntegerBooleanStringEnums = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ...) { local_var_response <- self$TestHeaderIntegerBooleanStringEnumsWithHttpInfo(integer_header, boolean_header, string_header, enum_nonref_string_header, enum_ref_string_header, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -105,8 +77,7 @@ HeaderApi <- R6::R6Class( local_var_response } }, - #' Test header parameter(s) - #' + #' @description #' Test header parameter(s) #' @@ -117,8 +88,8 @@ HeaderApi <- R6::R6Class( #' @param enum_ref_string_header (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestHeaderIntegerBooleanStringEnumsWithHttpInfo = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/number_properties_only.R b/samples/client/echo_api/r/R/number_properties_only.R index a025def4e587..7b0b698630fd 100644 --- a/samples/client/echo_api/r/R/number_properties_only.R +++ b/samples/client/echo_api/r/R/number_properties_only.R @@ -19,8 +19,7 @@ NumberPropertiesOnly <- R6::R6Class( `number` = NULL, `float` = NULL, `double` = NULL, - #' Initialize a new NumberPropertiesOnly class. - #' + #' @description #' Initialize a new NumberPropertiesOnly class. #' @@ -28,7 +27,6 @@ NumberPropertiesOnly <- R6::R6Class( #' @param float float #' @param double double #' @param ... Other optional arguments. - #' @export initialize = function(`number` = NULL, `float` = NULL, `double` = NULL, ...) { if (!is.null(`number`)) { self$`number` <- `number` @@ -46,13 +44,11 @@ NumberPropertiesOnly <- R6::R6Class( self$`double` <- `double` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NumberPropertiesOnly in JSON format - #' @export toJSON = function() { NumberPropertiesOnlyObject <- list() if (!is.null(self$`number`)) { @@ -69,14 +65,12 @@ NumberPropertiesOnly <- R6::R6Class( } NumberPropertiesOnlyObject }, - #' Deserialize JSON string into an instance of NumberPropertiesOnly - #' + #' @description #' Deserialize JSON string into an instance of NumberPropertiesOnly #' #' @param input_json the JSON input #' @return the instance of NumberPropertiesOnly - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`number`)) { @@ -90,13 +84,11 @@ NumberPropertiesOnly <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NumberPropertiesOnly in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`number`)) { @@ -127,14 +119,12 @@ NumberPropertiesOnly <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of NumberPropertiesOnly - #' + #' @description #' Deserialize JSON string into an instance of NumberPropertiesOnly #' #' @param input_json the JSON input #' @return the instance of NumberPropertiesOnly - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`number` <- this_object$`number` @@ -142,33 +132,27 @@ NumberPropertiesOnly <- R6::R6Class( self$`double` <- this_object$`double` self }, - #' Validate JSON input with respect to NumberPropertiesOnly - #' + #' @description #' Validate JSON input with respect to NumberPropertiesOnly and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of NumberPropertiesOnly - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (self$`double` > 50.2) { return(FALSE) @@ -179,13 +163,11 @@ NumberPropertiesOnly <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (self$`double` > 50.2) { @@ -197,12 +179,9 @@ NumberPropertiesOnly <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/path_api.R b/samples/client/echo_api/r/R/path_api.R index 75b09d76eca4..5b690cfc8f99 100644 --- a/samples/client/echo_api/r/R/path_api.R +++ b/samples/client/echo_api/r/R/path_api.R @@ -12,30 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath } \emph{ Test path parameter(s) } -#' Test path parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } path_string character -#' \item \emph{ @param } path_integer integer -#' \item \emph{ @param } enum_nonref_string_path Enum < [success, failure, unclassified] > -#' \item \emph{ @param } enum_ref_string_path \link{StringEnumRef} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath #################### @@ -63,13 +39,11 @@ PathApi <- R6::R6Class( "PathApi", public = list( api_client = NULL, - #' Initialize a new PathApi. - #' + #' @description #' Initialize a new PathApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -77,8 +51,7 @@ PathApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Test path parameter(s) - #' + #' @description #' Test path parameter(s) #' @@ -88,8 +61,8 @@ PathApi <- R6::R6Class( #' @param enum_ref_string_path #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ...) { local_var_response <- self$TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -102,8 +75,7 @@ PathApi <- R6::R6Class( local_var_response } }, - #' Test path parameter(s) - #' + #' @description #' Test path parameter(s) #' @@ -113,8 +85,8 @@ PathApi <- R6::R6Class( #' @param enum_ref_string_path #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/pet.R b/samples/client/echo_api/r/R/pet.R index 9d2e80b3bb21..b03d04e66cd6 100644 --- a/samples/client/echo_api/r/R/pet.R +++ b/samples/client/echo_api/r/R/pet.R @@ -25,8 +25,7 @@ Pet <- R6::R6Class( `photoUrls` = NULL, `tags` = NULL, `status` = NULL, - #' Initialize a new Pet class. - #' + #' @description #' Initialize a new Pet class. #' @@ -37,7 +36,6 @@ Pet <- R6::R6Class( #' @param tags tags #' @param status pet status in the store #' @param ... Other optional arguments. - #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) { if (!missing(`name`)) { if (!(is.character(`name`) && length(`name`) == 1)) { @@ -75,13 +73,11 @@ Pet <- R6::R6Class( self$`status` <- `status` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSON = function() { PetObject <- list() if (!is.null(self$`id`)) { @@ -110,14 +106,12 @@ Pet <- R6::R6Class( } PetObject }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -145,13 +139,11 @@ Pet <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -206,14 +198,12 @@ Pet <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -227,13 +217,11 @@ Pet <- R6::R6Class( self$`status` <- this_object$`status` self }, - #' Validate JSON input with respect to Pet - #' + #' @description #' Validate JSON input with respect to Pet and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `name` @@ -252,23 +240,19 @@ Pet <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Pet - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `name` is null if (is.null(self$`name`)) { @@ -282,13 +266,11 @@ Pet <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `name` is null @@ -303,12 +285,9 @@ Pet <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/query.R b/samples/client/echo_api/r/R/query.R index 4dcf16ddaf29..527a97226b1d 100644 --- a/samples/client/echo_api/r/R/query.R +++ b/samples/client/echo_api/r/R/query.R @@ -17,15 +17,13 @@ Query <- R6::R6Class( public = list( `id` = NULL, `outcomes` = NULL, - #' Initialize a new Query class. - #' + #' @description #' Initialize a new Query class. #' #' @param id Query #' @param outcomes outcomes. Default to ["SUCCESS","FAILURE"]. #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `outcomes` = ["SUCCESS","FAILURE"], ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -39,13 +37,11 @@ Query <- R6::R6Class( self$`outcomes` <- `outcomes` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Query in JSON format - #' @export toJSON = function() { QueryObject <- list() if (!is.null(self$`id`)) { @@ -58,14 +54,12 @@ Query <- R6::R6Class( } QueryObject }, - #' Deserialize JSON string into an instance of Query - #' + #' @description #' Deserialize JSON string into an instance of Query #' #' @param input_json the JSON input #' @return the instance of Query - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -76,13 +70,11 @@ Query <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Query in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -105,67 +97,54 @@ Query <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Query - #' + #' @description #' Deserialize JSON string into an instance of Query #' #' @param input_json the JSON input #' @return the instance of Query - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` self$`outcomes` <- ApiClient$new()$deserializeObj(this_object$`outcomes`, "array[character]", loadNamespace("openapi")) self }, - #' Validate JSON input with respect to Query - #' + #' @description #' Validate JSON input with respect to Query and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Query - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/query_api.R b/samples/client/echo_api/r/R/query_api.R index c1c62acd7e02..a4459a898099 100644 --- a/samples/client/echo_api/r/R/query_api.R +++ b/samples/client/echo_api/r/R/query_api.R @@ -12,176 +12,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ TestEnumRefString } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } enum_nonref_string_query Enum < [success, failure, unclassified] > -#' \item \emph{ @param } enum_ref_string_query \link{StringEnumRef} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryDatetimeDateString } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } datetime_query character -#' \item \emph{ @param } date_query character -#' \item \emph{ @param } string_query character -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryIntegerBooleanString } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } integer_query integer -#' \item \emph{ @param } boolean_query character -#' \item \emph{ @param } string_query character -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleDeepObjectExplodeTrueObject } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object \link{Pet} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleDeepObjectExplodeTrueObjectAllOf } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object \link{TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleFormExplodeFalseArrayInteger } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object list( integer ) -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleFormExplodeFalseArrayString } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object list( character ) -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleFormExplodeTrueArrayString } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object \link{TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleFormExplodeTrueObject } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object \link{Pet} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestQueryStyleFormExplodeTrueObjectAllOf } \emph{ Test query parameter(s) } -#' Test query parameter(s) -#' -#' \itemize{ -#' \item \emph{ @param } query_object \link{DataQuery} -#' -#' -#' \item status code : 200 | Successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### TestEnumRefString #################### @@ -337,13 +167,11 @@ QueryApi <- R6::R6Class( "QueryApi", public = list( api_client = NULL, - #' Initialize a new QueryApi. - #' + #' @description #' Initialize a new QueryApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -351,8 +179,7 @@ QueryApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -360,8 +187,8 @@ QueryApi <- R6::R6Class( #' @param enum_ref_string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestEnumRefString = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ...) { local_var_response <- self$TestEnumRefStringWithHttpInfo(enum_nonref_string_query, enum_ref_string_query, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -374,8 +201,7 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -383,8 +209,8 @@ QueryApi <- R6::R6Class( #' @param enum_ref_string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestEnumRefStringWithHttpInfo = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -450,8 +276,7 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -460,8 +285,8 @@ QueryApi <- R6::R6Class( #' @param string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryDatetimeDateString = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryDatetimeDateStringWithHttpInfo(datetime_query, date_query, string_query, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -474,8 +299,7 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -484,8 +308,8 @@ QueryApi <- R6::R6Class( #' @param string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryDatetimeDateStringWithHttpInfo = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -551,8 +375,7 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -561,8 +384,8 @@ QueryApi <- R6::R6Class( #' @param string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryIntegerBooleanString = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryIntegerBooleanStringWithHttpInfo(integer_query, boolean_query, string_query, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -575,8 +398,7 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' @@ -585,8 +407,8 @@ QueryApi <- R6::R6Class( #' @param string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryIntegerBooleanStringWithHttpInfo = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -652,16 +474,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleDeepObjectExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -674,16 +495,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -743,16 +563,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleDeepObjectExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -765,16 +584,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -834,16 +652,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleFormExplodeFalseArrayInteger = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -856,16 +673,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -926,16 +742,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleFormExplodeFalseArrayString = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -948,16 +763,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1018,16 +832,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleFormExplodeTrueArrayString = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1040,16 +853,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1109,16 +921,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleFormExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleFormExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1131,16 +942,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleFormExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1200,16 +1010,15 @@ QueryApi <- R6::R6Class( local_var_resp } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export TestQueryStyleFormExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) { local_var_response <- self$TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1222,16 +1031,15 @@ QueryApi <- R6::R6Class( local_var_response } }, - #' Test query parameter(s) - #' + #' @description #' Test query parameter(s) #' #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/echo_api/r/R/string_enum_ref.R b/samples/client/echo_api/r/R/string_enum_ref.R index ea39a2a6e2c9..1be463a16552 100644 --- a/samples/client/echo_api/r/R/string_enum_ref.R +++ b/samples/client/echo_api/r/R/string_enum_ref.R @@ -8,13 +8,11 @@ StringEnumRef <- R6::R6Class( "StringEnumRef", public = list( - #' Initialize a new StringEnumRef class. - #' + #' @description #' Initialize a new StringEnumRef class. #' #' @param ... Optional arguments. - #' @export initialize = function(...) { local.optional.var <- list(...) val <- unlist(local.optional.var) @@ -37,48 +35,42 @@ StringEnumRef <- R6::R6Class( } private$value <- val }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return StringEnumRef in JSON format - #' @export toJSON = function() { jsonlite::toJSON(private$value, auto_unbox = TRUE) }, - #' Deserialize JSON string into an instance of StringEnumRef - #' + #' @description #' Deserialize JSON string into an instance of StringEnumRef #' #' @param input_json the JSON input + #' #' @return the instance of StringEnumRef - #' @export fromJSON = function(input_json) { private$value <- jsonlite::fromJSON(input_json, simplifyVector = FALSE) self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return StringEnumRef in JSON format - #' @export toJSONString = function() { as.character(jsonlite::toJSON(private$value, auto_unbox = TRUE)) }, - #' Deserialize JSON string into an instance of StringEnumRef - #' + #' @description #' Deserialize JSON string into an instance of StringEnumRef #' #' @param input_json the JSON input + #' #' @return the instance of StringEnumRef - #' @export fromJSONString = function(input_json) { private$value <- jsonlite::fromJSON(input_json, simplifyVector = FALSE) diff --git a/samples/client/echo_api/r/R/tag.R b/samples/client/echo_api/r/R/tag.R index 829aa0d82067..b23305a43afc 100644 --- a/samples/client/echo_api/r/R/tag.R +++ b/samples/client/echo_api/r/R/tag.R @@ -17,15 +17,13 @@ Tag <- R6::R6Class( public = list( `id` = NULL, `name` = NULL, - #' Initialize a new Tag class. - #' + #' @description #' Initialize a new Tag class. #' #' @param id id #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -40,13 +38,11 @@ Tag <- R6::R6Class( self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSON = function() { TagObject <- list() if (!is.null(self$`id`)) { @@ -59,14 +55,12 @@ Tag <- R6::R6Class( } TagObject }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -77,13 +71,11 @@ Tag <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -106,67 +98,54 @@ Tag <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to Tag - #' + #' @description #' Validate JSON input with respect to Tag and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Tag - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R b/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R index 0be30ca5f6e8..6c523622cde0 100644 --- a/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R +++ b/samples/client/echo_api/r/R/test_form_object_multipart_request_marker.R @@ -15,14 +15,12 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( "TestFormObjectMultipartRequestMarker", public = list( `name` = NULL, - #' Initialize a new TestFormObjectMultipartRequestMarker class. - #' + #' @description #' Initialize a new TestFormObjectMultipartRequestMarker class. #' #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`name` = NULL, ...) { if (!is.null(`name`)) { if (!(is.character(`name`) && length(`name`) == 1)) { @@ -31,13 +29,11 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestFormObjectMultipartRequestMarker in JSON format - #' @export toJSON = function() { TestFormObjectMultipartRequestMarkerObject <- list() if (!is.null(self$`name`)) { @@ -46,14 +42,12 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( } TestFormObjectMultipartRequestMarkerObject }, - #' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker - #' + #' @description #' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker #' #' @param input_json the JSON input #' @return the instance of TestFormObjectMultipartRequestMarker - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`name`)) { @@ -61,13 +55,11 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestFormObjectMultipartRequestMarker in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`name`)) { @@ -82,66 +74,53 @@ TestFormObjectMultipartRequestMarker <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker - #' + #' @description #' Deserialize JSON string into an instance of TestFormObjectMultipartRequestMarker #' #' @param input_json the JSON input #' @return the instance of TestFormObjectMultipartRequestMarker - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to TestFormObjectMultipartRequestMarker - #' + #' @description #' Validate JSON input with respect to TestFormObjectMultipartRequestMarker and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of TestFormObjectMultipartRequestMarker - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R b/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R index 0dc284be8a92..8616e605bf93 100644 --- a/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R +++ b/samples/client/echo_api/r/R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R @@ -21,8 +21,7 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas `color` = NULL, `id` = NULL, `name` = NULL, - #' Initialize a new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter class. - #' + #' @description #' Initialize a new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter class. #' @@ -31,7 +30,6 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas #' @param id id #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`size` = NULL, `color` = NULL, `id` = NULL, `name` = NULL, ...) { if (!is.null(`size`)) { if (!(is.character(`size`) && length(`size`) == 1)) { @@ -58,13 +56,11 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format - #' @export toJSON = function() { TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject <- list() if (!is.null(self$`size`)) { @@ -85,14 +81,12 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas } TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterObject }, - #' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' + #' @description #' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter #' #' @param input_json the JSON input #' @return the instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`size`)) { @@ -109,13 +103,11 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`size`)) { @@ -154,14 +146,12 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' + #' @description #' Deserialize JSON string into an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter #' #' @param input_json the JSON input #' @return the instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` @@ -170,53 +160,42 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter <- R6::R6Clas self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' + #' @description #' Validate JSON input with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R b/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R index 8bd1bc7c273a..a6e69b27f3be 100644 --- a/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R +++ b/samples/client/echo_api/r/R/test_query_style_form_explode_true_array_string_query_object_parameter.R @@ -15,14 +15,12 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", public = list( `values` = NULL, - #' Initialize a new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter class. - #' + #' @description #' Initialize a new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter class. #' #' @param values values #' @param ... Other optional arguments. - #' @export initialize = function(`values` = NULL, ...) { if (!is.null(`values`)) { stopifnot(is.vector(`values`), length(`values`) != 0) @@ -30,13 +28,11 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( self$`values` <- `values` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format - #' @export toJSON = function() { TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject <- list() if (!is.null(self$`values`)) { @@ -45,14 +41,12 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( } TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterObject }, - #' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' + #' @description #' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter #' #' @param input_json the JSON input #' @return the instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`values`)) { @@ -60,13 +54,11 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`values`)) { @@ -81,66 +73,53 @@ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' + #' @description #' Deserialize JSON string into an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter #' #' @param input_json the JSON input #' @return the instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`values` <- ApiClient$new()$deserializeObj(this_object$`values`, "array[character]", loadNamespace("openapi")) self }, - #' Validate JSON input with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' + #' @description #' Validate JSON input with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 7cfd85917e92..454e378a5c16 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 @@ -27,8 +27,7 @@ AllofTagApiResponse <- R6::R6Class( `message` = NULL, `_field_list` = c("id", "name", "code", "type", "message"), `additional_properties` = list(), - #' Initialize a new AllofTagApiResponse class. - #' + #' @description #' Initialize a new AllofTagApiResponse class. #' @@ -39,7 +38,6 @@ AllofTagApiResponse <- R6::R6Class( #' @param message message #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -77,13 +75,11 @@ AllofTagApiResponse <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSON = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { @@ -112,14 +108,12 @@ AllofTagApiResponse <- R6::R6Class( AllofTagApiResponseObject }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -146,13 +140,11 @@ AllofTagApiResponse <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -204,14 +196,12 @@ AllofTagApiResponse <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -228,53 +218,42 @@ AllofTagApiResponse <- R6::R6Class( self }, - #' Validate JSON input with respect to AllofTagApiResponse - #' + #' @description #' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of AllofTagApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/animal.R b/samples/client/petstore/R-httr2-wrapper/R/animal.R index a1689f8394fd..471a01afef3b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/animal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/animal.R @@ -23,8 +23,7 @@ Animal <- R6::R6Class( `additional_properties` = list(), `_discriminator_property_name` = 'className', `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), - #' Initialize a new Animal class. - #' + #' @description #' Initialize a new Animal class. #' @@ -32,7 +31,6 @@ Animal <- R6::R6Class( #' @param color color. Default to "red". #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -52,13 +50,11 @@ Animal <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSON = function() { AnimalObject <- list() if (!is.null(self$`className`)) { @@ -75,14 +71,12 @@ Animal <- R6::R6Class( AnimalObject }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -100,13 +94,11 @@ Animal <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -134,14 +126,12 @@ Animal <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -155,13 +145,11 @@ Animal <- R6::R6Class( self }, - #' Validate JSON input with respect to Animal - #' + #' @description #' Validate JSON input with respect to Animal and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -173,23 +161,19 @@ Animal <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Animal - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -198,13 +182,11 @@ Animal <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -214,12 +196,9 @@ Animal <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R index 53213832fc94..ba3c8ea856d9 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R @@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class( actual_type = NULL, #' @field any_of a list of object types defined in the anyOf schema. any_of = list("BasquePig", "DanishPig"), - #' Initialize a new AnyOfPig. - #' + #' @description #' Initialize a new AnyOfPig. #' #' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' An alias to the method `fromJSON`. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSON = function(input) { error_messages <- list() @@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class( stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>", paste(error_messages, collapse = " >> "))) }, - #' Serialize AnyOfPig to JSON string. - #' + #' @description #' Serialize AnyOfPig to JSON string. #' #' @return JSON string representation of the AnyOfPig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify((self$actual_instance$toJSONString()))) @@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Serialize AnyOfPig to JSON. - #' + #' @description #' Serialize AnyOfPig to JSON. #' #' @return JSON representation of the AnyOfPig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPig. - #' + #' @description #' Validate the input JSON with respect to AnyOfPig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R index 9b8d2a4d15b1..99aa52c73427 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R @@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new AnyOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new AnyOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the AnyOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/api_exception.R b/samples/client/petstore/R-httr2-wrapper/R/api_exception.R index f31f27858b61..cc6e7b0e7b40 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/api_exception.R +++ b/samples/client/petstore/R-httr2-wrapper/R/api_exception.R @@ -23,15 +23,13 @@ ApiException <- R6::R6Class( body = NULL, headers = NULL, error_object = NULL, - #' Initialize a new ApiException class. - #' + #' @description - #' Initialize a new ApiExceptino class. + #' Initialize a new ApiException class. #' #' @param status HTTP status. #' @param reason Reason of the ApiException. #' @param http_response HTTP response object. - #' @export initialize = function(status = NULL, reason = NULL, http_response = NULL) { if (!is.null(http_response)) { self$status <- http_response$status_code @@ -51,13 +49,11 @@ ApiException <- R6::R6Class( self$error_object <- NULL } }, - #' Returns the string format of ApiException. - #' + #' @description #' Returns the string format of ApiException. #' #' @return the string format of ApiException. - #' @export toString = function() { errorMsg <- "" errorMsg <- paste("status : ", self$status, "\n", sep = "") diff --git a/samples/client/petstore/R-httr2-wrapper/R/api_response.R b/samples/client/petstore/R-httr2-wrapper/R/api_response.R index 2916fd07d45a..95dc6428290e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/api_response.R @@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class( status_code = NULL, status_code_desc = NULL, headers = NULL, - #' Initialize a new ApiResponse class. - #' + #' @description #' Initialize a new ApiResponse class. #' @@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class( #' @param status_code The HTTP response status code. #' @param status_code_desc The brief description of the HTTP response status code. #' @param headers The HTTP response headers. - #' @export initialize = function(content = NULL, response = NULL, status_code = NULL, @@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class( self$headers <- headers }, - #' Return the response as text - #' + #' @description #' The response is stored as a raw vector. Use this to access the response after #' converting it to text. If the response is not coercible to text NA is returned. #' #' @param from_encoding The encoding of the raw response. #' @param to_encoding The target encoding of the return value. - #' @export response_as_text = function(from_encoding = "", to_encoding = "UTF-8") { if (is.null(self$response)) { self$response <- charToRaw(jsonlite::toJSON("NULL")) 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 048bff78e75c..cce82cd7d932 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R @@ -21,8 +21,7 @@ BasquePig <- R6::R6Class( `color` = NULL, `_field_list` = c("className", "color"), `additional_properties` = list(), - #' Initialize a new BasquePig class. - #' + #' @description #' Initialize a new BasquePig class. #' @@ -30,7 +29,6 @@ BasquePig <- R6::R6Class( #' @param color color #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ BasquePig <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSON = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ BasquePig <- R6::R6Class( BasquePigObject }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -98,13 +92,11 @@ BasquePig <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -132,14 +124,12 @@ BasquePig <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -153,13 +143,11 @@ BasquePig <- R6::R6Class( self }, - #' Validate JSON input with respect to BasquePig - #' + #' @description #' Validate JSON input with respect to BasquePig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -179,23 +167,19 @@ BasquePig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of BasquePig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -209,13 +193,11 @@ BasquePig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -230,12 +212,9 @@ BasquePig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat.R b/samples/client/petstore/R-httr2-wrapper/R/cat.R index 9198500c01a2..b4014681ba49 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat.R @@ -24,8 +24,7 @@ Cat <- R6::R6Class( `declawed` = NULL, `_field_list` = c("className", "color", "declawed"), `additional_properties` = list(), - #' Initialize a new Cat class. - #' + #' @description #' Initialize a new Cat class. #' @@ -34,7 +33,6 @@ Cat <- R6::R6Class( #' @param declawed declawed #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -60,13 +58,11 @@ Cat <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSON = function() { CatObject <- list() if (!is.null(self$`className`)) { @@ -87,14 +83,12 @@ Cat <- R6::R6Class( CatObject }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -115,13 +109,11 @@ Cat <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -157,14 +149,12 @@ Cat <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -179,13 +169,11 @@ Cat <- R6::R6Class( self }, - #' Validate JSON input with respect to Cat - #' + #' @description #' Validate JSON input with respect to Cat and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -197,23 +185,19 @@ Cat <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Cat - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -222,13 +206,11 @@ Cat <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -238,12 +220,9 @@ Cat <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/category.R b/samples/client/petstore/R-httr2-wrapper/R/category.R index 175b3cbb9aeb..31106a3bc9e2 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/category.R +++ b/samples/client/petstore/R-httr2-wrapper/R/category.R @@ -21,8 +21,7 @@ Category <- R6::R6Class( `name` = NULL, `_field_list` = c("id", "name"), `additional_properties` = list(), - #' Initialize a new Category class. - #' + #' @description #' Initialize a new Category class. #' @@ -30,7 +29,6 @@ Category <- R6::R6Class( #' @param name name #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -50,13 +48,11 @@ Category <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSON = function() { CategoryObject <- list() if (!is.null(self$`id`)) { @@ -73,14 +69,12 @@ Category <- R6::R6Class( CategoryObject }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -98,13 +92,11 @@ Category <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -132,14 +124,12 @@ Category <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -153,33 +143,27 @@ Category <- R6::R6Class( self }, - #' Validate JSON input with respect to Category - #' + #' @description #' Validate JSON input with respect to Category and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Category - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { return(FALSE) @@ -187,13 +171,11 @@ Category <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { @@ -202,12 +184,9 @@ Category <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 627bd413163e..08ca2b9e3eea 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R @@ -21,8 +21,7 @@ DanishPig <- R6::R6Class( `size` = NULL, `_field_list` = c("className", "size"), `additional_properties` = list(), - #' Initialize a new DanishPig class. - #' + #' @description #' Initialize a new DanishPig class. #' @@ -30,7 +29,6 @@ DanishPig <- R6::R6Class( #' @param size size #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ DanishPig <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSON = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ DanishPig <- R6::R6Class( DanishPigObject }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -98,13 +92,11 @@ DanishPig <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -132,14 +124,12 @@ DanishPig <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -153,13 +143,11 @@ DanishPig <- R6::R6Class( self }, - #' Validate JSON input with respect to DanishPig - #' + #' @description #' Validate JSON input with respect to DanishPig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -179,23 +167,19 @@ DanishPig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DanishPig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -209,13 +193,11 @@ DanishPig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -230,12 +212,9 @@ DanishPig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/date.R b/samples/client/petstore/R-httr2-wrapper/R/date.R index 3299b6658ad1..d9b6ec0beb1b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/date.R +++ b/samples/client/petstore/R-httr2-wrapper/R/date.R @@ -23,8 +23,7 @@ Date <- R6::R6Class( `url_property` = NULL, `_field_list` = c("className", "percent_description", "url_property"), `additional_properties` = list(), - #' Initialize a new Date class. - #' + #' @description #' Initialize a new Date class. #' @@ -33,7 +32,6 @@ Date <- R6::R6Class( #' @param percent_description using \% in the description #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -63,13 +61,11 @@ Date <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSON = function() { DateObject <- list() if (!is.null(self$`className`)) { @@ -90,14 +86,12 @@ Date <- R6::R6Class( DateObject }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -122,13 +116,11 @@ Date <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -164,14 +156,12 @@ Date <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -190,13 +180,11 @@ Date <- R6::R6Class( self }, - #' Validate JSON input with respect to Date - #' + #' @description #' Validate JSON input with respect to Date and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -220,23 +208,19 @@ Date <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Date - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -250,13 +234,11 @@ Date <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -271,12 +253,9 @@ Date <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog.R b/samples/client/petstore/R-httr2-wrapper/R/dog.R index 068eec8eca83..34ae29121163 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog.R @@ -24,8 +24,7 @@ Dog <- R6::R6Class( `breed` = NULL, `_field_list` = c("className", "color", "breed"), `additional_properties` = list(), - #' Initialize a new Dog class. - #' + #' @description #' Initialize a new Dog class. #' @@ -34,7 +33,6 @@ Dog <- R6::R6Class( #' @param breed breed #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -60,13 +58,11 @@ Dog <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSON = function() { DogObject <- list() if (!is.null(self$`className`)) { @@ -87,14 +83,12 @@ Dog <- R6::R6Class( DogObject }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -115,13 +109,11 @@ Dog <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -157,14 +149,12 @@ Dog <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -179,13 +169,11 @@ Dog <- R6::R6Class( self }, - #' Validate JSON input with respect to Dog - #' + #' @description #' Validate JSON input with respect to Dog and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -197,23 +185,19 @@ Dog <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Dog - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -222,13 +206,11 @@ Dog <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -238,12 +220,9 @@ Dog <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R b/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R index 75c7c5f8a567..12d3ab52a155 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dummy_model.R @@ -19,15 +19,13 @@ DummyModel <- R6::R6Class( `property` = NULL, `_field_list` = c("property"), `additional_properties` = list(), - #' Initialize a new DummyModel class. - #' + #' @description #' Initialize a new DummyModel class. #' #' @param property property #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`property` = NULL, additional_properties = NULL, ...) { if (!is.null(`property`)) { if (!(is.character(`property`) && length(`property`) == 1)) { @@ -41,13 +39,11 @@ DummyModel <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DummyModel in JSON format - #' @export toJSON = function() { DummyModelObject <- list() if (!is.null(self$`property`)) { @@ -60,14 +56,12 @@ DummyModel <- R6::R6Class( DummyModelObject }, - #' Deserialize JSON string into an instance of DummyModel - #' + #' @description #' Deserialize JSON string into an instance of DummyModel #' #' @param input_json the JSON input #' @return the instance of DummyModel - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`property`)) { @@ -82,13 +76,11 @@ DummyModel <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DummyModel in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`property`)) { @@ -108,14 +100,12 @@ DummyModel <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of DummyModel - #' + #' @description #' Deserialize JSON string into an instance of DummyModel #' #' @param input_json the JSON input #' @return the instance of DummyModel - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`property` <- this_object$`property` @@ -128,53 +118,42 @@ DummyModel <- R6::R6Class( self }, - #' Validate JSON input with respect to DummyModel - #' + #' @description #' Validate JSON input with respect to DummyModel and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DummyModel - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 747da5d45c30..9493c19e70b7 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R @@ -11,107 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ add_pet_optional } \emph{ Add a new pet to the store (optional body) } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_data_file } \emph{ test data_file to ensure it's escaped correctly } -#' -#' -#' \itemize{ -#' \item \emph{ @param } dummy character -#' \item \emph{ @param } var_data_file character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_path_array } \emph{ test array parameter in path } -#' -#' -#' \itemize{ -#' \item \emph{ @param } path_array list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_regular_expression } \emph{ test regular expression to ensure no exception } -#' -#' -#' \itemize{ -#' \item \emph{ @param } reg_exp_test character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_set_query } \emph{ test set query parameter } -#' -#' -#' \itemize{ -#' \item \emph{ @param } set_dummy list( character ) -#' \item \emph{ @param } array_dummy list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### add_pet_optional #################### @@ -270,13 +169,11 @@ FakeApi <- R6::R6Class( "FakeApi", public = list( api_client = NULL, - #' Initialize a new FakeApi. - #' + #' @description #' Initialize a new FakeApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -284,16 +181,15 @@ FakeApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export add_pet_optional = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -306,16 +202,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -400,8 +295,7 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -409,8 +303,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ...) { local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -423,8 +317,7 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -432,8 +325,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -520,15 +413,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array dummy path parameter #' @param ... Other optional arguments + #' #' @return void - #' @export fake_path_array = function(path_array, ...) { local_var_response <- self$fake_path_array_with_http_info(path_array, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -541,15 +433,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array dummy path parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_path_array_with_http_info = function(path_array, ...) { args <- list(...) query_params <- list() @@ -622,15 +513,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return void - #' @export fake_regular_expression = function(reg_exp_test, ...) { local_var_response <- self$fake_regular_expression_with_http_info(reg_exp_test, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -643,15 +533,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_regular_expression_with_http_info = function(reg_exp_test, ...) { args <- list(...) query_params <- list() @@ -728,16 +617,15 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return void - #' @export fake_set_query = function(set_dummy, array_dummy, ...) { local_var_response <- self$fake_set_query_with_http_info(set_dummy, array_dummy, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -750,16 +638,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_set_query_with_http_info = function(set_dummy, array_dummy, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2-wrapper/R/format_test.R b/samples/client/petstore/R-httr2-wrapper/R/format_test.R index 85894ec7b1f5..f93bf1435c9a 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/format_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/format_test.R @@ -47,8 +47,7 @@ FormatTest <- R6::R6Class( `pattern_with_digits_and_delimiter` = NULL, `_field_list` = c("integer", "int32", "int64", "number", "float", "double", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"), `additional_properties` = list(), - #' Initialize a new FormatTest class. - #' + #' @description #' Initialize a new FormatTest class. #' @@ -69,7 +68,6 @@ FormatTest <- R6::R6Class( #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, additional_properties = NULL, ...) { if (!missing(`number`)) { self$`number` <- `number` @@ -158,13 +156,11 @@ FormatTest <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSON = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { @@ -233,14 +229,12 @@ FormatTest <- R6::R6Class( FormatTestObject }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`integer`)) { @@ -297,13 +291,11 @@ FormatTest <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`integer`)) { @@ -435,14 +427,12 @@ FormatTest <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`integer` <- this_object$`integer` @@ -469,13 +459,11 @@ FormatTest <- R6::R6Class( self }, - #' Validate JSON input with respect to FormatTest - #' + #' @description #' Validate JSON input with respect to FormatTest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `number` @@ -505,23 +493,19 @@ FormatTest <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of FormatTest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (self$`integer` > 100) { return(FALSE) @@ -599,13 +583,11 @@ FormatTest <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (self$`integer` > 100) { @@ -684,12 +666,9 @@ FormatTest <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/mammal.R b/samples/client/petstore/R-httr2-wrapper/R/mammal.R index cfefc92a83fe..fe4f3577d0ce 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/mammal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/mammal.R @@ -17,13 +17,11 @@ Mammal <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("Whale", "Zebra"), - #' Initialize a new Mammal. - #' + #' @description #' Initialize a new Mammal. #' #' @param instance an instance of the object defined in the oneOf schemas: "Whale", "Zebra" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Mammal <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -136,13 +132,11 @@ Mammal <- R6::R6Class( self }, - #' Serialize Mammal to JSON string. - #' + #' @description #' Serialize Mammal to JSON string. #' #' @return JSON string representation of the Mammal. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -150,13 +144,11 @@ Mammal <- R6::R6Class( NULL } }, - #' Serialize Mammal to JSON. - #' + #' @description #' Serialize Mammal to JSON. #' #' @return JSON representation of the Mammal. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -164,14 +156,12 @@ Mammal <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Mammal. - #' + #' @description #' Validate the input JSON with respect to Mammal and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -184,13 +174,11 @@ Mammal <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -200,12 +188,9 @@ Mammal <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 028c66c72305..9116e438fedc 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 @@ -23,8 +23,7 @@ ModelApiResponse <- R6::R6Class( `message` = NULL, `_field_list` = c("code", "type", "message"), `additional_properties` = list(), - #' Initialize a new ModelApiResponse class. - #' + #' @description #' Initialize a new ModelApiResponse class. #' @@ -33,7 +32,6 @@ ModelApiResponse <- R6::R6Class( #' @param message message #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { if (!(is.numeric(`code`) && length(`code`) == 1)) { @@ -59,13 +57,11 @@ ModelApiResponse <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSON = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { @@ -86,14 +82,12 @@ ModelApiResponse <- R6::R6Class( ModelApiResponseObject }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`code`)) { @@ -114,13 +108,11 @@ ModelApiResponse <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`code`)) { @@ -156,14 +148,12 @@ ModelApiResponse <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`code` <- this_object$`code` @@ -178,53 +168,42 @@ ModelApiResponse <- R6::R6Class( self }, - #' Validate JSON input with respect to ModelApiResponse - #' + #' @description #' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of ModelApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 8fbdf43b466e..e04a31a69acd 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 @@ -21,8 +21,7 @@ NestedOneOf <- R6::R6Class( `nested_pig` = NULL, `_field_list` = c("size", "nested_pig"), `additional_properties` = list(), - #' Initialize a new NestedOneOf class. - #' + #' @description #' Initialize a new NestedOneOf class. #' @@ -30,7 +29,6 @@ NestedOneOf <- R6::R6Class( #' @param nested_pig nested_pig #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { if (!(is.numeric(`size`) && length(`size`) == 1)) { @@ -48,13 +46,11 @@ NestedOneOf <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSON = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { @@ -71,14 +67,12 @@ NestedOneOf <- R6::R6Class( NestedOneOfObject }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`size`)) { @@ -98,13 +92,11 @@ NestedOneOf <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`size`)) { @@ -132,14 +124,12 @@ NestedOneOf <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` @@ -153,53 +143,42 @@ NestedOneOf <- R6::R6Class( self }, - #' Validate JSON input with respect to NestedOneOf - #' + #' @description #' Validate JSON input with respect to NestedOneOf and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of NestedOneOf - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R index da4d226dd3bb..8a9280a9b213 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R @@ -17,13 +17,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new OneOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new OneOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ OneOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the OneOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the OneOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to OneOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to OneOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ OneOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/order.R b/samples/client/petstore/R-httr2-wrapper/R/order.R index 08c080464e64..cd84eed74eef 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/order.R +++ b/samples/client/petstore/R-httr2-wrapper/R/order.R @@ -29,8 +29,7 @@ Order <- R6::R6Class( `complete` = NULL, `_field_list` = c("id", "petId", "quantity", "shipDate", "status", "complete"), `additional_properties` = list(), - #' Initialize a new Order class. - #' + #' @description #' Initialize a new Order class. #' @@ -42,7 +41,6 @@ Order <- R6::R6Class( #' @param complete complete. Default to FALSE. #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -89,13 +87,11 @@ Order <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSON = function() { OrderObject <- list() if (!is.null(self$`id`)) { @@ -128,14 +124,12 @@ Order <- R6::R6Class( OrderObject }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -168,13 +162,11 @@ Order <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -234,14 +226,12 @@ Order <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -262,53 +252,42 @@ Order <- R6::R6Class( self }, - #' Validate JSON input with respect to Order - #' + #' @description #' Validate JSON input with respect to Order and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Order - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet.R b/samples/client/petstore/R-httr2-wrapper/R/pet.R index ea3b23ce9680..28e1693c419f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet.R @@ -29,8 +29,7 @@ Pet <- R6::R6Class( `status` = NULL, `_field_list` = c("id", "category", "name", "photoUrls", "tags", "status"), `additional_properties` = list(), - #' Initialize a new Pet class. - #' + #' @description #' Initialize a new Pet class. #' @@ -42,7 +41,6 @@ Pet <- R6::R6Class( #' @param status pet status in the store #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { if (!(is.character(`name`) && length(`name`) == 1)) { @@ -85,13 +83,11 @@ Pet <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSON = function() { PetObject <- list() if (!is.null(self$`id`)) { @@ -124,14 +120,12 @@ Pet <- R6::R6Class( PetObject }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -166,13 +160,11 @@ Pet <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -232,14 +224,12 @@ Pet <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -260,13 +250,11 @@ Pet <- R6::R6Class( self }, - #' Validate JSON input with respect to Pet - #' + #' @description #' Validate JSON input with respect to Pet and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `name` @@ -285,23 +273,19 @@ Pet <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Pet - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `name` is null if (is.null(self$`name`)) { @@ -315,13 +299,11 @@ Pet <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `name` is null @@ -336,12 +318,9 @@ Pet <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 22bba7ad4116..8619642a8321 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -11,278 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ add_pet } \emph{ Add a new pet to the store } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ delete_pet } \emph{ Deletes a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } api_key character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid pet value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ find_pets_by_status } \emph{ Finds Pets by status } -#' Multiple status values can be provided with comma separated strings -#' -#' \itemize{ -#' \item \emph{ @param } status Enum < [available, pending, sold] > -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid status value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ find_pets_by_tags } \emph{ Finds Pets by tags } -#' Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -#' -#' \itemize{ -#' \item \emph{ @param } tags list( character ) -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid tag value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_pet_by_id } \emph{ Find pet by ID } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_pet_by_id_streaming } \emph{ Find pet by ID (streaming) } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ test_header } \emph{ Header test } -#' Header test -#' -#' \itemize{ -#' \item \emph{ @param } header_test_int integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_pet } \emph{ Update an existing pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Validation exception -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_pet_with_form } \emph{ Updates a pet in the store with form data } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } name character -#' \item \emph{ @param } status character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ upload_file } \emph{ uploads an image } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } additional_metadata character -#' \item \emph{ @param } file data.frame -#' \item \emph{ @returnType } \link{ModelApiResponse} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : ModelApiResponse -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### add_pet #################### @@ -644,13 +372,11 @@ PetApi <- R6::R6Class( "PetApi", public = list( api_client = NULL, - #' Initialize a new PetApi. - #' + #' @description #' Initialize a new PetApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -658,16 +384,15 @@ PetApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export add_pet = function(pet, data_file = NULL, ...) { local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -680,16 +405,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export add_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -781,16 +505,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return void - #' @export delete_pet = function(pet_id, api_key = NULL, ...) { local_var_response <- self$delete_pet_with_http_info(pet_id, api_key, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,16 +526,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_pet_with_http_info = function(pet_id, api_key = NULL, ...) { args <- list(...) query_params <- list() @@ -891,16 +613,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export find_pets_by_status = function(status, data_file = NULL, ...) { local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -913,16 +634,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1019,16 +739,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export find_pets_by_tags = function(tags, data_file = NULL, ...) { local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1041,16 +760,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1135,16 +853,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export get_pet_by_id = function(pet_id, data_file = NULL, ...) { local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1157,16 +874,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1256,8 +972,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1265,8 +980,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1283,8 +998,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1292,8 +1006,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1388,8 +1102,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Header test - #' + #' @description #' Header test #' @@ -1397,8 +1110,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1415,8 +1128,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Header test - #' + #' @description #' Header test #' @@ -1424,8 +1136,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1518,16 +1230,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export update_pet = function(pet, data_file = NULL, ...) { local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1540,16 +1251,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export update_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1640,8 +1350,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1649,8 +1358,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return void - #' @export update_pet_with_form = function(pet_id, name = NULL, status = NULL, ...) { local_var_response <- self$update_pet_with_form_with_http_info(pet_id, name, status, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1663,8 +1372,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1672,8 +1380,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export update_pet_with_form_with_http_info = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) query_params <- list() @@ -1750,8 +1458,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1760,8 +1467,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return ModelApiResponse - #' @export upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1774,8 +1481,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1784,8 +1490,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - #' @export upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_map.R b/samples/client/petstore/R-httr2-wrapper/R/pet_map.R index 80d9eb3abf89..1fc910ac1da2 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_map.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_map.R @@ -19,15 +19,13 @@ PetMap <- R6::R6Class( `pet` = NULL, `_field_list` = c("pet"), `additional_properties` = list(), - #' Initialize a new PetMap class. - #' + #' @description #' Initialize a new PetMap class. #' #' @param pet pet #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`pet` = NULL, additional_properties = NULL, ...) { if (!is.null(`pet`)) { stopifnot(is.vector(`pet`), length(`pet`) != 0) @@ -40,13 +38,11 @@ PetMap <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSON = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { @@ -59,14 +55,12 @@ PetMap <- R6::R6Class( PetMapObject }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`pet`)) { @@ -81,13 +75,11 @@ PetMap <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`pet`)) { @@ -107,14 +99,12 @@ PetMap <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`pet` <- ApiClient$new()$deserializeObj(this_object$`pet`, "map(character)", loadNamespace("petstore")) @@ -127,53 +117,42 @@ PetMap <- R6::R6Class( self }, - #' Validate JSON input with respect to PetMap - #' + #' @description #' Validate JSON input with respect to PetMap and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of PetMap - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/pig.R b/samples/client/petstore/R-httr2-wrapper/R/pig.R index e44ae074eccd..6e0242ca3e9e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pig.R @@ -17,13 +17,11 @@ Pig <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("BasquePig", "DanishPig"), - #' Initialize a new Pig. - #' + #' @description #' Initialize a new Pig. #' #' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Pig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -136,13 +132,11 @@ Pig <- R6::R6Class( self }, - #' Serialize Pig to JSON string. - #' + #' @description #' Serialize Pig to JSON string. #' #' @return JSON string representation of the Pig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -150,13 +144,11 @@ Pig <- R6::R6Class( NULL } }, - #' Serialize Pig to JSON. - #' + #' @description #' Serialize Pig to JSON. #' #' @return JSON representation of the Pig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -164,14 +156,12 @@ Pig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Pig. - #' + #' @description #' Validate the input JSON with respect to Pig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -184,13 +174,11 @@ Pig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -200,12 +188,9 @@ Pig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/special.R b/samples/client/petstore/R-httr2-wrapper/R/special.R index 27a23809a070..5841fc79dd39 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/special.R +++ b/samples/client/petstore/R-httr2-wrapper/R/special.R @@ -31,8 +31,7 @@ Special <- R6::R6Class( `empty_string` = NULL, `_field_list` = c("set_test", "item_self", "item_private", "item_super", "123_number", "array[test]", "empty_string"), `additional_properties` = list(), - #' Initialize a new Special class. - #' + #' @description #' Initialize a new Special class. #' @@ -45,7 +44,6 @@ Special <- R6::R6Class( #' @param empty_string empty_string #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, additional_properties = NULL, ...) { if (!is.null(`set_test`)) { stopifnot(is.vector(`set_test`), length(`set_test`) != 0) @@ -97,13 +95,11 @@ Special <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSON = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { @@ -140,14 +136,12 @@ Special <- R6::R6Class( SpecialObject }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`set_test`)) { @@ -183,13 +177,11 @@ Special <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`set_test`)) { @@ -257,14 +249,12 @@ Special <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`set_test` <- ApiClient$new()$deserializeObj(this_object$`set_test`, "set[character]", loadNamespace("petstore")) @@ -286,55 +276,44 @@ Special <- R6::R6Class( self }, - #' Validate JSON input with respect to Special - #' + #' @description #' Validate JSON input with respect to Special and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Special - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 7e731571d644..03b65c4104a8 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/store_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/store_api.R @@ -11,108 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ delete_order } \emph{ Delete purchase order by ID } -#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -#' -#' \itemize{ -#' \item \emph{ @param } order_id character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_inventory } \emph{ Returns pet inventories by status } -#' Returns a map of status codes to quantities -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : map(integer) -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_order_by_id } \emph{ Find purchase order by ID } -#' For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -#' -#' \itemize{ -#' \item \emph{ @param } order_id integer -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ place_order } \emph{ Place an order for a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } order \link{Order} -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid Order -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### delete_order #################### @@ -250,13 +148,11 @@ StoreApi <- R6::R6Class( "StoreApi", public = list( api_client = NULL, - #' Initialize a new StoreApi. - #' + #' @description #' Initialize a new StoreApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -264,15 +160,14 @@ StoreApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export delete_order = function(order_id, ...) { local_var_response <- self$delete_order_with_http_info(order_id, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -285,15 +180,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_order_with_http_info = function(order_id, ...) { args <- list(...) query_params <- list() @@ -366,15 +260,14 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return map(integer) - #' @export get_inventory = function(data_file = NULL, ...) { local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -387,15 +280,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - #' @export get_inventory_with_http_info = function(data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -473,16 +365,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export get_order_by_id = function(order_id, data_file = NULL, ...) { local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -495,16 +386,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -602,16 +492,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export place_order = function(order, data_file = NULL, ...) { local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -624,16 +513,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export place_order_with_http_info = function(order, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2-wrapper/R/tag.R b/samples/client/petstore/R-httr2-wrapper/R/tag.R index 52079beeb09f..c9ec58ae6b82 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/tag.R +++ b/samples/client/petstore/R-httr2-wrapper/R/tag.R @@ -21,8 +21,7 @@ Tag <- R6::R6Class( `name` = NULL, `_field_list` = c("id", "name"), `additional_properties` = list(), - #' Initialize a new Tag class. - #' + #' @description #' Initialize a new Tag class. #' @@ -30,7 +29,6 @@ Tag <- R6::R6Class( #' @param name name #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -50,13 +48,11 @@ Tag <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSON = function() { TagObject <- list() if (!is.null(self$`id`)) { @@ -73,14 +69,12 @@ Tag <- R6::R6Class( TagObject }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -98,13 +92,11 @@ Tag <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -132,14 +124,12 @@ Tag <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -153,53 +143,42 @@ Tag <- R6::R6Class( self }, - #' Validate JSON input with respect to Tag - #' + #' @description #' Validate JSON input with respect to Tag and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Tag - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 c29abc945abc..47369030cfac 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 @@ -21,8 +21,7 @@ UpdatePetRequest <- R6::R6Class( `binaryDataN2Information` = NULL, `_field_list` = c("jsonData", "binaryDataN2Information"), `additional_properties` = list(), - #' Initialize a new UpdatePetRequest class. - #' + #' @description #' Initialize a new UpdatePetRequest class. #' @@ -30,7 +29,6 @@ UpdatePetRequest <- R6::R6Class( #' @param binaryDataN2Information binaryDataN2Information #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) @@ -45,13 +43,11 @@ UpdatePetRequest <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSON = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { @@ -68,14 +64,12 @@ UpdatePetRequest <- R6::R6Class( UpdatePetRequestObject }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { @@ -95,13 +89,11 @@ UpdatePetRequest <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`jsonData`)) { @@ -129,14 +121,12 @@ UpdatePetRequest <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) @@ -150,53 +140,42 @@ UpdatePetRequest <- R6::R6Class( self }, - #' Validate JSON input with respect to UpdatePetRequest - #' + #' @description #' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of UpdatePetRequest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/user.R b/samples/client/petstore/R-httr2-wrapper/R/user.R index 533469b64229..df4396abb2ca 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user.R @@ -33,8 +33,7 @@ User <- R6::R6Class( `userStatus` = NULL, `_field_list` = c("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"), `additional_properties` = list(), - #' Initialize a new User class. - #' + #' @description #' Initialize a new User class. #' @@ -48,7 +47,6 @@ User <- R6::R6Class( #' @param userStatus User Status #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -104,13 +102,11 @@ User <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSON = function() { UserObject <- list() if (!is.null(self$`id`)) { @@ -151,14 +147,12 @@ User <- R6::R6Class( UserObject }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -194,13 +188,11 @@ User <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -276,14 +268,12 @@ User <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -303,53 +293,42 @@ User <- R6::R6Class( self }, - #' Validate JSON input with respect to User - #' + #' @description #' Validate JSON input with respect to User and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of User - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 c72516848343..484cf99eecc4 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user_api.R @@ -11,187 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ create_user } \emph{ Create user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ create_users_with_array_input } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ create_users_with_list_input } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ delete_user } \emph{ Delete user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_user_by_name } \emph{ Get user by user name } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ login_user } \emph{ Logs user into the system } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } password character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr -#' X-Rate-Limit \tab calls per hour allowed by the user \cr -#' X-Expires-After \tab date in UTC when token expires \cr -#' } -#' \item status code : 400 | Invalid username/password supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ logout_user } \emph{ Logs out current logged in user session } -#' -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_user } \emph{ Updated user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid user supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### create_user #################### @@ -438,13 +257,11 @@ UserApi <- R6::R6Class( "UserApi", public = list( api_client = NULL, - #' Initialize a new UserApi. - #' + #' @description #' Initialize a new UserApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -452,15 +269,14 @@ UserApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_user = function(user, ...) { local_var_response <- self$create_user_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -473,15 +289,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_user_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -560,15 +375,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_users_with_array_input = function(user, ...) { local_var_response <- self$create_users_with_array_input_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -581,15 +395,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_users_with_array_input_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -671,15 +484,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_users_with_list_input = function(user, ...) { local_var_response <- self$create_users_with_list_input_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -692,15 +504,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_users_with_list_input_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -782,15 +593,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export delete_user = function(username, ...) { local_var_response <- self$delete_user_with_http_info(username, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,15 +613,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_user_with_http_info = function(username, ...) { args <- list(...) query_params <- list() @@ -888,16 +697,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export get_user_by_name = function(username, data_file = NULL, ...) { local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -910,16 +718,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export get_user_by_name_with_http_info = function(username, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1005,8 +812,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1014,8 +820,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export login_user = function(username, password, data_file = NULL, ...) { local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1028,8 +834,7 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1037,8 +842,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export login_user_with_http_info = function(username, password, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1138,14 +943,13 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return void - #' @export logout_user = function(...) { local_var_response <- self$logout_user_with_http_info(...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1158,14 +962,13 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export logout_user_with_http_info = function(...) { args <- list(...) query_params <- list() @@ -1230,16 +1033,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return void - #' @export update_user = function(username, user, ...) { local_var_response <- self$update_user_with_http_info(username, user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1252,16 +1054,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export update_user_with_http_info = function(username, user, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2-wrapper/R/whale.R b/samples/client/petstore/R-httr2-wrapper/R/whale.R index 3305ab6ce6d7..e39211045a76 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/whale.R +++ b/samples/client/petstore/R-httr2-wrapper/R/whale.R @@ -23,8 +23,7 @@ Whale <- R6::R6Class( `className` = NULL, `_field_list` = c("hasBaleen", "hasTeeth", "className"), `additional_properties` = list(), - #' Initialize a new Whale class. - #' + #' @description #' Initialize a new Whale class. #' @@ -33,7 +32,6 @@ Whale <- R6::R6Class( #' @param hasTeeth hasTeeth #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -59,13 +57,11 @@ Whale <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSON = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { @@ -86,14 +82,12 @@ Whale <- R6::R6Class( WhaleObject }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`hasBaleen`)) { @@ -114,13 +108,11 @@ Whale <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`hasBaleen`)) { @@ -156,14 +148,12 @@ Whale <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`hasBaleen` <- this_object$`hasBaleen` @@ -178,13 +168,11 @@ Whale <- R6::R6Class( self }, - #' Validate JSON input with respect to Whale - #' + #' @description #' Validate JSON input with respect to Whale and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -196,23 +184,19 @@ Whale <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Whale - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -221,13 +205,11 @@ Whale <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -237,12 +219,9 @@ Whale <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2-wrapper/R/zebra.R b/samples/client/petstore/R-httr2-wrapper/R/zebra.R index 122e76d20ea3..fb6d90d4d983 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/zebra.R +++ b/samples/client/petstore/R-httr2-wrapper/R/zebra.R @@ -21,8 +21,7 @@ Zebra <- R6::R6Class( `className` = NULL, `_field_list` = c("type", "className"), `additional_properties` = list(), - #' Initialize a new Zebra class. - #' + #' @description #' Initialize a new Zebra class. #' @@ -30,7 +29,6 @@ Zebra <- R6::R6Class( #' @param type type #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -53,13 +51,11 @@ Zebra <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSON = function() { ZebraObject <- list() if (!is.null(self$`type`)) { @@ -76,14 +72,12 @@ Zebra <- R6::R6Class( ZebraObject }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`)) { @@ -104,13 +98,11 @@ Zebra <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`type`)) { @@ -138,14 +130,12 @@ Zebra <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`) && !(this_object$`type` %in% c("plains", "mountain", "grevys"))) { @@ -162,13 +152,11 @@ Zebra <- R6::R6Class( self }, - #' Validate JSON input with respect to Zebra - #' + #' @description #' Validate JSON input with respect to Zebra and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -180,23 +168,19 @@ Zebra <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Zebra - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -205,13 +189,11 @@ Zebra <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -221,12 +203,9 @@ Zebra <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 98a3cd8fd657..ff239b9cda9e 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 @@ -23,8 +23,7 @@ AllofTagApiResponse <- R6::R6Class( `code` = NULL, `type` = NULL, `message` = NULL, - #' Initialize a new AllofTagApiResponse class. - #' + #' @description #' Initialize a new AllofTagApiResponse class. #' @@ -34,7 +33,6 @@ AllofTagApiResponse <- R6::R6Class( #' @param type type #' @param message message #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -67,13 +65,11 @@ AllofTagApiResponse <- R6::R6Class( self$`message` <- `message` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSON = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { @@ -98,14 +94,12 @@ AllofTagApiResponse <- R6::R6Class( } AllofTagApiResponseObject }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -125,13 +119,11 @@ AllofTagApiResponse <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -178,14 +170,12 @@ AllofTagApiResponse <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -195,53 +185,42 @@ AllofTagApiResponse <- R6::R6Class( self$`message` <- this_object$`message` self }, - #' Validate JSON input with respect to AllofTagApiResponse - #' + #' @description #' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of AllofTagApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/animal.R b/samples/client/petstore/R-httr2/R/animal.R index 3c62c6687e4f..4f1f8ab507c6 100644 --- a/samples/client/petstore/R-httr2/R/animal.R +++ b/samples/client/petstore/R-httr2/R/animal.R @@ -19,15 +19,13 @@ Animal <- R6::R6Class( `color` = NULL, `_discriminator_property_name` = 'className', `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), - #' Initialize a new Animal class. - #' + #' @description #' Initialize a new Animal class. #' #' @param className className #' @param color color. Default to "red". #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -42,13 +40,11 @@ Animal <- R6::R6Class( self$`color` <- `color` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSON = function() { AnimalObject <- list() if (!is.null(self$`className`)) { @@ -61,14 +57,12 @@ Animal <- R6::R6Class( } AnimalObject }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -79,13 +73,11 @@ Animal <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -108,27 +100,23 @@ Animal <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` self$`color` <- this_object$`color` self }, - #' Validate JSON input with respect to Animal - #' + #' @description #' Validate JSON input with respect to Animal and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -140,23 +128,19 @@ Animal <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Animal - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -165,13 +149,11 @@ Animal <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -181,12 +163,9 @@ Animal <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/any_of_pig.R b/samples/client/petstore/R-httr2/R/any_of_pig.R index 53213832fc94..ba3c8ea856d9 100644 --- a/samples/client/petstore/R-httr2/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2/R/any_of_pig.R @@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class( actual_type = NULL, #' @field any_of a list of object types defined in the anyOf schema. any_of = list("BasquePig", "DanishPig"), - #' Initialize a new AnyOfPig. - #' + #' @description #' Initialize a new AnyOfPig. #' #' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' An alias to the method `fromJSON`. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSON = function(input) { error_messages <- list() @@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class( stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>", paste(error_messages, collapse = " >> "))) }, - #' Serialize AnyOfPig to JSON string. - #' + #' @description #' Serialize AnyOfPig to JSON string. #' #' @return JSON string representation of the AnyOfPig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify((self$actual_instance$toJSONString()))) @@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Serialize AnyOfPig to JSON. - #' + #' @description #' Serialize AnyOfPig to JSON. #' #' @return JSON representation of the AnyOfPig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPig. - #' + #' @description #' Validate the input JSON with respect to AnyOfPig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R index 9b8d2a4d15b1..99aa52c73427 100644 --- a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R @@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new AnyOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new AnyOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the AnyOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/api_exception.R b/samples/client/petstore/R-httr2/R/api_exception.R index f31f27858b61..cc6e7b0e7b40 100644 --- a/samples/client/petstore/R-httr2/R/api_exception.R +++ b/samples/client/petstore/R-httr2/R/api_exception.R @@ -23,15 +23,13 @@ ApiException <- R6::R6Class( body = NULL, headers = NULL, error_object = NULL, - #' Initialize a new ApiException class. - #' + #' @description - #' Initialize a new ApiExceptino class. + #' Initialize a new ApiException class. #' #' @param status HTTP status. #' @param reason Reason of the ApiException. #' @param http_response HTTP response object. - #' @export initialize = function(status = NULL, reason = NULL, http_response = NULL) { if (!is.null(http_response)) { self$status <- http_response$status_code @@ -51,13 +49,11 @@ ApiException <- R6::R6Class( self$error_object <- NULL } }, - #' Returns the string format of ApiException. - #' + #' @description #' Returns the string format of ApiException. #' #' @return the string format of ApiException. - #' @export toString = function() { errorMsg <- "" errorMsg <- paste("status : ", self$status, "\n", sep = "") diff --git a/samples/client/petstore/R-httr2/R/api_response.R b/samples/client/petstore/R-httr2/R/api_response.R index 2916fd07d45a..95dc6428290e 100644 --- a/samples/client/petstore/R-httr2/R/api_response.R +++ b/samples/client/petstore/R-httr2/R/api_response.R @@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class( status_code = NULL, status_code_desc = NULL, headers = NULL, - #' Initialize a new ApiResponse class. - #' + #' @description #' Initialize a new ApiResponse class. #' @@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class( #' @param status_code The HTTP response status code. #' @param status_code_desc The brief description of the HTTP response status code. #' @param headers The HTTP response headers. - #' @export initialize = function(content = NULL, response = NULL, status_code = NULL, @@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class( self$headers <- headers }, - #' Return the response as text - #' + #' @description #' The response is stored as a raw vector. Use this to access the response after #' converting it to text. If the response is not coercible to text NA is returned. #' #' @param from_encoding The encoding of the raw response. #' @param to_encoding The target encoding of the return value. - #' @export response_as_text = function(from_encoding = "", to_encoding = "UTF-8") { if (is.null(self$response)) { self$response <- charToRaw(jsonlite::toJSON("NULL")) diff --git a/samples/client/petstore/R-httr2/R/basque_pig.R b/samples/client/petstore/R-httr2/R/basque_pig.R index 53756e06c441..6833f264bc7a 100644 --- a/samples/client/petstore/R-httr2/R/basque_pig.R +++ b/samples/client/petstore/R-httr2/R/basque_pig.R @@ -17,15 +17,13 @@ BasquePig <- R6::R6Class( public = list( `className` = NULL, `color` = NULL, - #' Initialize a new BasquePig class. - #' + #' @description #' Initialize a new BasquePig class. #' #' @param className className #' @param color color #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color`, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -40,13 +38,11 @@ BasquePig <- R6::R6Class( self$`color` <- `color` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSON = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { @@ -59,14 +55,12 @@ BasquePig <- R6::R6Class( } BasquePigObject }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -77,13 +71,11 @@ BasquePig <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -106,27 +98,23 @@ BasquePig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` self$`color` <- this_object$`color` self }, - #' Validate JSON input with respect to BasquePig - #' + #' @description #' Validate JSON input with respect to BasquePig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -146,23 +134,19 @@ BasquePig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of BasquePig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -176,13 +160,11 @@ BasquePig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -197,12 +179,9 @@ BasquePig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/cat.R b/samples/client/petstore/R-httr2/R/cat.R index 861a3b174ae4..d50bf428d8eb 100644 --- a/samples/client/petstore/R-httr2/R/cat.R +++ b/samples/client/petstore/R-httr2/R/cat.R @@ -20,8 +20,7 @@ Cat <- R6::R6Class( `className` = NULL, `color` = NULL, `declawed` = NULL, - #' Initialize a new Cat class. - #' + #' @description #' Initialize a new Cat class. #' @@ -29,7 +28,6 @@ Cat <- R6::R6Class( #' @param color color. Default to "red". #' @param declawed declawed #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ Cat <- R6::R6Class( self$`declawed` <- `declawed` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSON = function() { CatObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ Cat <- R6::R6Class( } CatObject }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -94,13 +88,11 @@ Cat <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -131,14 +123,12 @@ Cat <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -146,13 +136,11 @@ Cat <- R6::R6Class( self$`declawed` <- this_object$`declawed` self }, - #' Validate JSON input with respect to Cat - #' + #' @description #' Validate JSON input with respect to Cat and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -164,23 +152,19 @@ Cat <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Cat - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -189,13 +173,11 @@ Cat <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -205,12 +187,9 @@ Cat <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/category.R b/samples/client/petstore/R-httr2/R/category.R index 67c8059bc8fe..752d9b8024b1 100644 --- a/samples/client/petstore/R-httr2/R/category.R +++ b/samples/client/petstore/R-httr2/R/category.R @@ -17,15 +17,13 @@ Category <- R6::R6Class( public = list( `id` = NULL, `name` = NULL, - #' Initialize a new Category class. - #' + #' @description #' Initialize a new Category class. #' #' @param id id #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -40,13 +38,11 @@ Category <- R6::R6Class( self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSON = function() { CategoryObject <- list() if (!is.null(self$`id`)) { @@ -59,14 +55,12 @@ Category <- R6::R6Class( } CategoryObject }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -77,13 +71,11 @@ Category <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -106,47 +98,39 @@ Category <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to Category - #' + #' @description #' Validate JSON input with respect to Category and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Category - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { return(FALSE) @@ -154,13 +138,11 @@ Category <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { @@ -169,12 +151,9 @@ Category <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/danish_pig.R b/samples/client/petstore/R-httr2/R/danish_pig.R index 84e4b50ea893..d7e35b52e5e6 100644 --- a/samples/client/petstore/R-httr2/R/danish_pig.R +++ b/samples/client/petstore/R-httr2/R/danish_pig.R @@ -17,15 +17,13 @@ DanishPig <- R6::R6Class( public = list( `className` = NULL, `size` = NULL, - #' Initialize a new DanishPig class. - #' + #' @description #' Initialize a new DanishPig class. #' #' @param className className #' @param size size #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `size`, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -40,13 +38,11 @@ DanishPig <- R6::R6Class( self$`size` <- `size` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSON = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { @@ -59,14 +55,12 @@ DanishPig <- R6::R6Class( } DanishPigObject }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -77,13 +71,11 @@ DanishPig <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -106,27 +98,23 @@ DanishPig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` self$`size` <- this_object$`size` self }, - #' Validate JSON input with respect to DanishPig - #' + #' @description #' Validate JSON input with respect to DanishPig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -146,23 +134,19 @@ DanishPig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DanishPig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -176,13 +160,11 @@ DanishPig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -197,12 +179,9 @@ DanishPig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/date.R b/samples/client/petstore/R-httr2/R/date.R index 9a09f05a5a99..a822606b6b7b 100644 --- a/samples/client/petstore/R-httr2/R/date.R +++ b/samples/client/petstore/R-httr2/R/date.R @@ -19,8 +19,7 @@ Date <- R6::R6Class( `className` = NULL, `percent` = NULL, `url_property` = NULL, - #' Initialize a new Date class. - #' + #' @description #' Initialize a new Date class. #' @@ -28,7 +27,6 @@ Date <- R6::R6Class( #' @param url_property url_property #' @param percent using \% in the description #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `url_property`, `percent` = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -53,13 +51,11 @@ Date <- R6::R6Class( self$`percent` <- `percent` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSON = function() { DateObject <- list() if (!is.null(self$`className`)) { @@ -76,14 +72,12 @@ Date <- R6::R6Class( } DateObject }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -101,13 +95,11 @@ Date <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -138,14 +130,12 @@ Date <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -157,13 +147,11 @@ Date <- R6::R6Class( self$`url_property` <- this_object$`url_property` self }, - #' Validate JSON input with respect to Date - #' + #' @description #' Validate JSON input with respect to Date and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -187,23 +175,19 @@ Date <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Date - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -217,13 +201,11 @@ Date <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -238,12 +220,9 @@ Date <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/dog.R b/samples/client/petstore/R-httr2/R/dog.R index 9916c7bb2e33..0851d7461d99 100644 --- a/samples/client/petstore/R-httr2/R/dog.R +++ b/samples/client/petstore/R-httr2/R/dog.R @@ -20,8 +20,7 @@ Dog <- R6::R6Class( `className` = NULL, `color` = NULL, `breed` = NULL, - #' Initialize a new Dog class. - #' + #' @description #' Initialize a new Dog class. #' @@ -29,7 +28,6 @@ Dog <- R6::R6Class( #' @param color color. Default to "red". #' @param breed breed #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ Dog <- R6::R6Class( self$`breed` <- `breed` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSON = function() { DogObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ Dog <- R6::R6Class( } DogObject }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -94,13 +88,11 @@ Dog <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -131,14 +123,12 @@ Dog <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -146,13 +136,11 @@ Dog <- R6::R6Class( self$`breed` <- this_object$`breed` self }, - #' Validate JSON input with respect to Dog - #' + #' @description #' Validate JSON input with respect to Dog and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -164,23 +152,19 @@ Dog <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Dog - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -189,13 +173,11 @@ Dog <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -205,12 +187,9 @@ Dog <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 40acaae69d2e..d12e602f269d 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -11,107 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ add_pet_optional } \emph{ Add a new pet to the store (optional body) } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_data_file } \emph{ test data_file to ensure it's escaped correctly } -#' -#' -#' \itemize{ -#' \item \emph{ @param } dummy character -#' \item \emph{ @param } var_data_file character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_path_array } \emph{ test array parameter in path } -#' -#' -#' \itemize{ -#' \item \emph{ @param } path_array_parameter list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_regular_expression } \emph{ test regular expression to ensure no exception } -#' -#' -#' \itemize{ -#' \item \emph{ @param } reg_exp_test character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ fake_set_query } \emph{ test set query parameter } -#' -#' -#' \itemize{ -#' \item \emph{ @param } set_dummy list( character ) -#' \item \emph{ @param } array_dummy list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### add_pet_optional #################### @@ -270,13 +169,11 @@ FakeApi <- R6::R6Class( "FakeApi", public = list( api_client = NULL, - #' Initialize a new FakeApi. - #' + #' @description #' Initialize a new FakeApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -284,16 +181,15 @@ FakeApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export add_pet_optional = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -306,16 +202,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -400,8 +295,7 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -409,8 +303,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ...) { local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -423,8 +317,7 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -432,8 +325,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -520,15 +413,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array_parameter dummy path parameter #' @param ... Other optional arguments + #' #' @return void - #' @export fake_path_array = function(path_array_parameter, ...) { local_var_response <- self$fake_path_array_with_http_info(path_array_parameter, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -541,15 +433,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array_parameter dummy path parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_path_array_with_http_info = function(path_array_parameter, ...) { args <- list(...) query_params <- list() @@ -622,15 +513,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return void - #' @export fake_regular_expression = function(reg_exp_test, ...) { local_var_response <- self$fake_regular_expression_with_http_info(reg_exp_test, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -643,15 +533,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_regular_expression_with_http_info = function(reg_exp_test, ...) { args <- list(...) query_params <- list() @@ -728,16 +617,15 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return void - #' @export fake_set_query = function(set_dummy, array_dummy, ...) { local_var_response <- self$fake_set_query_with_http_info(set_dummy, array_dummy, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -750,16 +638,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export fake_set_query_with_http_info = function(set_dummy, array_dummy, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2/R/format_test.R b/samples/client/petstore/R-httr2/R/format_test.R index e07519373d3d..117497304980 100644 --- a/samples/client/petstore/R-httr2/R/format_test.R +++ b/samples/client/petstore/R-httr2/R/format_test.R @@ -43,8 +43,7 @@ FormatTest <- R6::R6Class( `password` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, - #' Initialize a new FormatTest class. - #' + #' @description #' Initialize a new FormatTest class. #' @@ -64,7 +63,6 @@ FormatTest <- R6::R6Class( #' @param pattern_with_digits A string that is a 10 digit number. Can have leading zeros. #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. #' @param ... Other optional arguments. - #' @export initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, ...) { if (!missing(`number`)) { self$`number` <- `number` @@ -148,13 +146,11 @@ FormatTest <- R6::R6Class( self$`pattern_with_digits_and_delimiter` <- `pattern_with_digits_and_delimiter` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSON = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { @@ -219,14 +215,12 @@ FormatTest <- R6::R6Class( } FormatTestObject }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`integer`)) { @@ -276,13 +270,11 @@ FormatTest <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`integer`)) { @@ -409,14 +401,12 @@ FormatTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`integer` <- this_object$`integer` @@ -436,13 +426,11 @@ FormatTest <- R6::R6Class( self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` self }, - #' Validate JSON input with respect to FormatTest - #' + #' @description #' Validate JSON input with respect to FormatTest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `number` @@ -472,23 +460,19 @@ FormatTest <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of FormatTest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (self$`integer` > 100) { return(FALSE) @@ -566,13 +550,11 @@ FormatTest <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (self$`integer` > 100) { @@ -651,12 +633,9 @@ FormatTest <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/just_model.R b/samples/client/petstore/R-httr2/R/just_model.R index 163e3721638d..780533eb3db0 100644 --- a/samples/client/petstore/R-httr2/R/just_model.R +++ b/samples/client/petstore/R-httr2/R/just_model.R @@ -15,14 +15,12 @@ JustModel <- R6::R6Class( "JustModel", public = list( `property` = NULL, - #' Initialize a new JustModel class. - #' + #' @description #' Initialize a new JustModel class. #' #' @param property property #' @param ... Other optional arguments. - #' @export initialize = function(`property` = NULL, ...) { if (!is.null(`property`)) { if (!(is.character(`property`) && length(`property`) == 1)) { @@ -31,13 +29,11 @@ JustModel <- R6::R6Class( self$`property` <- `property` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return JustModel in JSON format - #' @export toJSON = function() { JustModelObject <- list() if (!is.null(self$`property`)) { @@ -46,14 +42,12 @@ JustModel <- R6::R6Class( } JustModelObject }, - #' Deserialize JSON string into an instance of JustModel - #' + #' @description #' Deserialize JSON string into an instance of JustModel #' #' @param input_json the JSON input #' @return the instance of JustModel - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`property`)) { @@ -61,13 +55,11 @@ JustModel <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return JustModel in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`property`)) { @@ -82,66 +74,53 @@ JustModel <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of JustModel - #' + #' @description #' Deserialize JSON string into an instance of JustModel #' #' @param input_json the JSON input #' @return the instance of JustModel - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`property` <- this_object$`property` self }, - #' Validate JSON input with respect to JustModel - #' + #' @description #' Validate JSON input with respect to JustModel and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of JustModel - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/mammal.R b/samples/client/petstore/R-httr2/R/mammal.R index 13bb0da875e2..bbd57ed00acb 100644 --- a/samples/client/petstore/R-httr2/R/mammal.R +++ b/samples/client/petstore/R-httr2/R/mammal.R @@ -17,13 +17,11 @@ Mammal <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("Whale", "Zebra"), - #' Initialize a new Mammal. - #' + #' @description #' Initialize a new Mammal. #' #' @param instance an instance of the object defined in the oneOf schemas: "Whale", "Zebra" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Mammal <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -110,13 +106,11 @@ Mammal <- R6::R6Class( self }, - #' Serialize Mammal to JSON string. - #' + #' @description #' Serialize Mammal to JSON string. #' #' @return JSON string representation of the Mammal. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -124,13 +118,11 @@ Mammal <- R6::R6Class( NULL } }, - #' Serialize Mammal to JSON. - #' + #' @description #' Serialize Mammal to JSON. #' #' @return JSON representation of the Mammal. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -138,14 +130,12 @@ Mammal <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Mammal. - #' + #' @description #' Validate the input JSON with respect to Mammal and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -158,13 +148,11 @@ Mammal <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -174,12 +162,9 @@ Mammal <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 de62918e893a..98814bedafbb 100644 --- a/samples/client/petstore/R-httr2/R/model_api_response.R +++ b/samples/client/petstore/R-httr2/R/model_api_response.R @@ -19,8 +19,7 @@ ModelApiResponse <- R6::R6Class( `code` = NULL, `type` = NULL, `message` = NULL, - #' Initialize a new ModelApiResponse class. - #' + #' @description #' Initialize a new ModelApiResponse class. #' @@ -28,7 +27,6 @@ ModelApiResponse <- R6::R6Class( #' @param type type #' @param message message #' @param ... Other optional arguments. - #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`code`)) { if (!(is.numeric(`code`) && length(`code`) == 1)) { @@ -49,13 +47,11 @@ ModelApiResponse <- R6::R6Class( self$`message` <- `message` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSON = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { @@ -72,14 +68,12 @@ ModelApiResponse <- R6::R6Class( } ModelApiResponseObject }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`code`)) { @@ -93,13 +87,11 @@ ModelApiResponse <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`code`)) { @@ -130,14 +122,12 @@ ModelApiResponse <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`code` <- this_object$`code` @@ -145,53 +135,42 @@ ModelApiResponse <- R6::R6Class( self$`message` <- this_object$`message` self }, - #' Validate JSON input with respect to ModelApiResponse - #' + #' @description #' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of ModelApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 a62902ac4fb1..c1abefcacd8b 100644 --- a/samples/client/petstore/R-httr2/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2/R/nested_one_of.R @@ -17,15 +17,13 @@ NestedOneOf <- R6::R6Class( public = list( `size` = NULL, `nested_pig` = NULL, - #' Initialize a new NestedOneOf class. - #' + #' @description #' Initialize a new NestedOneOf class. #' #' @param size size #' @param nested_pig nested_pig #' @param ... Other optional arguments. - #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, ...) { if (!is.null(`size`)) { if (!(is.numeric(`size`) && length(`size`) == 1)) { @@ -38,13 +36,11 @@ NestedOneOf <- R6::R6Class( self$`nested_pig` <- `nested_pig` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSON = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { @@ -57,14 +53,12 @@ NestedOneOf <- R6::R6Class( } NestedOneOfObject }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`size`)) { @@ -77,13 +71,11 @@ NestedOneOf <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`size`)) { @@ -106,67 +98,54 @@ NestedOneOf <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) self }, - #' Validate JSON input with respect to NestedOneOf - #' + #' @description #' Validate JSON input with respect to NestedOneOf and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of NestedOneOf - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R index da4d226dd3bb..8a9280a9b213 100644 --- a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R @@ -17,13 +17,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new OneOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new OneOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ OneOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the OneOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the OneOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to OneOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to OneOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ OneOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/order.R b/samples/client/petstore/R-httr2/R/order.R index 38975d63ee94..4155b311f316 100644 --- a/samples/client/petstore/R-httr2/R/order.R +++ b/samples/client/petstore/R-httr2/R/order.R @@ -25,8 +25,7 @@ Order <- R6::R6Class( `shipDate` = NULL, `status` = NULL, `complete` = NULL, - #' Initialize a new Order class. - #' + #' @description #' Initialize a new Order class. #' @@ -37,7 +36,6 @@ Order <- R6::R6Class( #' @param status Order Status #' @param complete complete. Default to FALSE. #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -79,13 +77,11 @@ Order <- R6::R6Class( self$`complete` <- `complete` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSON = function() { OrderObject <- list() if (!is.null(self$`id`)) { @@ -114,14 +110,12 @@ Order <- R6::R6Class( } OrderObject }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -147,13 +141,11 @@ Order <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -208,14 +200,12 @@ Order <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -229,53 +219,42 @@ Order <- R6::R6Class( self$`complete` <- this_object$`complete` self }, - #' Validate JSON input with respect to Order - #' + #' @description #' Validate JSON input with respect to Order and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Order - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/pet.R b/samples/client/petstore/R-httr2/R/pet.R index 7ce7c6336774..e3f3274dbc83 100644 --- a/samples/client/petstore/R-httr2/R/pet.R +++ b/samples/client/petstore/R-httr2/R/pet.R @@ -25,8 +25,7 @@ Pet <- R6::R6Class( `photoUrls` = NULL, `tags` = NULL, `status` = NULL, - #' Initialize a new Pet class. - #' + #' @description #' Initialize a new Pet class. #' @@ -37,7 +36,6 @@ Pet <- R6::R6Class( #' @param tags tags #' @param status pet status in the store #' @param ... Other optional arguments. - #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) { if (!missing(`name`)) { if (!(is.character(`name`) && length(`name`) == 1)) { @@ -75,13 +73,11 @@ Pet <- R6::R6Class( self$`status` <- `status` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSON = function() { PetObject <- list() if (!is.null(self$`id`)) { @@ -110,14 +106,12 @@ Pet <- R6::R6Class( } PetObject }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -145,13 +139,11 @@ Pet <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -206,14 +198,12 @@ Pet <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -227,13 +217,11 @@ Pet <- R6::R6Class( self$`status` <- this_object$`status` self }, - #' Validate JSON input with respect to Pet - #' + #' @description #' Validate JSON input with respect to Pet and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `name` @@ -252,23 +240,19 @@ Pet <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Pet - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `name` is null if (is.null(self$`name`)) { @@ -282,13 +266,11 @@ Pet <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `name` is null @@ -303,12 +285,9 @@ Pet <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index d79e53aa7189..407235e30b5a 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -11,278 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ add_pet } \emph{ Add a new pet to the store } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ delete_pet } \emph{ Deletes a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } api_key character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid pet value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ find_pets_by_status } \emph{ Finds Pets by status } -#' Multiple status values can be provided with comma separated strings -#' -#' \itemize{ -#' \item \emph{ @param } status Enum < [available, pending, sold] > -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid status value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ find_pets_by_tags } \emph{ Finds Pets by tags } -#' Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -#' -#' \itemize{ -#' \item \emph{ @param } tags list( character ) -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid tag value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_pet_by_id } \emph{ Find pet by ID } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_pet_by_id_streaming } \emph{ Find pet by ID (streaming) } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ test_header } \emph{ Header test } -#' Header test -#' -#' \itemize{ -#' \item \emph{ @param } header_test_int integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_pet } \emph{ Update an existing pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Validation exception -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_pet_with_form } \emph{ Updates a pet in the store with form data } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } name character -#' \item \emph{ @param } status character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ upload_file } \emph{ uploads an image } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } additional_metadata character -#' \item \emph{ @param } file data.frame -#' \item \emph{ @returnType } \link{ModelApiResponse} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : ModelApiResponse -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### add_pet #################### @@ -644,13 +372,11 @@ PetApi <- R6::R6Class( "PetApi", public = list( api_client = NULL, - #' Initialize a new PetApi. - #' + #' @description #' Initialize a new PetApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -658,16 +384,15 @@ PetApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export add_pet = function(pet, data_file = NULL, ...) { local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -680,16 +405,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export add_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -781,16 +505,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return void - #' @export delete_pet = function(pet_id, api_key = NULL, ...) { local_var_response <- self$delete_pet_with_http_info(pet_id, api_key, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,16 +526,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_pet_with_http_info = function(pet_id, api_key = NULL, ...) { args <- list(...) query_params <- list() @@ -891,16 +613,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export find_pets_by_status = function(status, data_file = NULL, ...) { local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -913,16 +634,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1019,16 +739,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export find_pets_by_tags = function(tags, data_file = NULL, ...) { local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1041,16 +760,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1135,16 +853,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export get_pet_by_id = function(pet_id, data_file = NULL, ...) { local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1157,16 +874,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1256,8 +972,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1265,8 +980,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1283,8 +998,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1292,8 +1006,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1388,8 +1102,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Header test - #' + #' @description #' Header test #' @@ -1397,8 +1110,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1415,8 +1128,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Header test - #' + #' @description #' Header test #' @@ -1424,8 +1136,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1518,16 +1230,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export update_pet = function(pet, data_file = NULL, ...) { local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1540,16 +1251,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export update_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1640,8 +1350,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1649,8 +1358,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return void - #' @export update_pet_with_form = function(pet_id, name = NULL, status = NULL, ...) { local_var_response <- self$update_pet_with_form_with_http_info(pet_id, name, status, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1663,8 +1372,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1672,8 +1380,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export update_pet_with_form_with_http_info = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) query_params <- list() @@ -1750,8 +1458,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1760,8 +1467,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return ModelApiResponse - #' @export upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1774,8 +1481,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1784,8 +1490,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - #' @export upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2/R/pet_map.R b/samples/client/petstore/R-httr2/R/pet_map.R index 5fe81b5dd05e..6a8b62a0a695 100644 --- a/samples/client/petstore/R-httr2/R/pet_map.R +++ b/samples/client/petstore/R-httr2/R/pet_map.R @@ -15,14 +15,12 @@ PetMap <- R6::R6Class( "PetMap", public = list( `pet` = NULL, - #' Initialize a new PetMap class. - #' + #' @description #' Initialize a new PetMap class. #' #' @param pet pet #' @param ... Other optional arguments. - #' @export initialize = function(`pet` = NULL, ...) { if (!is.null(`pet`)) { stopifnot(is.vector(`pet`), length(`pet`) != 0) @@ -30,13 +28,11 @@ PetMap <- R6::R6Class( self$`pet` <- `pet` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSON = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { @@ -45,14 +41,12 @@ PetMap <- R6::R6Class( } PetMapObject }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`pet`)) { @@ -60,13 +54,11 @@ PetMap <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`pet`)) { @@ -81,66 +73,53 @@ PetMap <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`pet` <- ApiClient$new()$deserializeObj(this_object$`pet`, "map(character)", loadNamespace("petstore")) self }, - #' Validate JSON input with respect to PetMap - #' + #' @description #' Validate JSON input with respect to PetMap and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of PetMap - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/pig.R b/samples/client/petstore/R-httr2/R/pig.R index 05bfeebe4ced..596a9307d4dc 100644 --- a/samples/client/petstore/R-httr2/R/pig.R +++ b/samples/client/petstore/R-httr2/R/pig.R @@ -17,13 +17,11 @@ Pig <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("BasquePig", "DanishPig"), - #' Initialize a new Pig. - #' + #' @description #' Initialize a new Pig. #' #' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Pig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -110,13 +106,11 @@ Pig <- R6::R6Class( self }, - #' Serialize Pig to JSON string. - #' + #' @description #' Serialize Pig to JSON string. #' #' @return JSON string representation of the Pig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -124,13 +118,11 @@ Pig <- R6::R6Class( NULL } }, - #' Serialize Pig to JSON. - #' + #' @description #' Serialize Pig to JSON. #' #' @return JSON representation of the Pig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -138,14 +130,12 @@ Pig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Pig. - #' + #' @description #' Validate the input JSON with respect to Pig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -158,13 +148,11 @@ Pig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -174,12 +162,9 @@ Pig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/special.R b/samples/client/petstore/R-httr2/R/special.R index 34119a5ce55a..4e4250f78d3c 100644 --- a/samples/client/petstore/R-httr2/R/special.R +++ b/samples/client/petstore/R-httr2/R/special.R @@ -27,8 +27,7 @@ Special <- R6::R6Class( `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, - #' Initialize a new Special class. - #' + #' @description #' Initialize a new Special class. #' @@ -40,7 +39,6 @@ Special <- R6::R6Class( #' @param array[test] array[test] #' @param empty_string empty_string #' @param ... Other optional arguments. - #' @export initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ...) { if (!is.null(`set_test`)) { stopifnot(is.vector(`set_test`), length(`set_test`) != 0) @@ -87,13 +85,11 @@ Special <- R6::R6Class( self$`empty_string` <- `empty_string` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSON = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { @@ -126,14 +122,12 @@ Special <- R6::R6Class( } SpecialObject }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`set_test`)) { @@ -162,13 +156,11 @@ Special <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`set_test`)) { @@ -231,14 +223,12 @@ Special <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`set_test` <- ApiClient$new()$deserializeObj(this_object$`set_test`, "set[character]", loadNamespace("petstore")) @@ -253,55 +243,44 @@ Special <- R6::R6Class( self$`empty_string` <- this_object$`empty_string` self }, - #' Validate JSON input with respect to Special - #' + #' @description #' Validate JSON input with respect to Special and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Special - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index b247ecb44c05..b0526273367b 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -11,108 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ delete_order } \emph{ Delete purchase order by ID } -#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -#' -#' \itemize{ -#' \item \emph{ @param } order_id character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_inventory } \emph{ Returns pet inventories by status } -#' Returns a map of status codes to quantities -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : map(integer) -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_order_by_id } \emph{ Find purchase order by ID } -#' For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -#' -#' \itemize{ -#' \item \emph{ @param } order_id integer -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ place_order } \emph{ Place an order for a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } order \link{Order} -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid Order -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### delete_order #################### @@ -250,13 +148,11 @@ StoreApi <- R6::R6Class( "StoreApi", public = list( api_client = NULL, - #' Initialize a new StoreApi. - #' + #' @description #' Initialize a new StoreApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -264,15 +160,14 @@ StoreApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export delete_order = function(order_id, ...) { local_var_response <- self$delete_order_with_http_info(order_id, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -285,15 +180,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_order_with_http_info = function(order_id, ...) { args <- list(...) query_params <- list() @@ -366,15 +260,14 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return map(integer) - #' @export get_inventory = function(data_file = NULL, ...) { local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -387,15 +280,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - #' @export get_inventory_with_http_info = function(data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -473,16 +365,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export get_order_by_id = function(order_id, data_file = NULL, ...) { local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -495,16 +386,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -602,16 +492,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export place_order = function(order, data_file = NULL, ...) { local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -624,16 +513,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export place_order_with_http_info = function(order, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2/R/tag.R b/samples/client/petstore/R-httr2/R/tag.R index 97c9906129a3..574b5c0395af 100644 --- a/samples/client/petstore/R-httr2/R/tag.R +++ b/samples/client/petstore/R-httr2/R/tag.R @@ -17,15 +17,13 @@ Tag <- R6::R6Class( public = list( `id` = NULL, `name` = NULL, - #' Initialize a new Tag class. - #' + #' @description #' Initialize a new Tag class. #' #' @param id id #' @param name name #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -40,13 +38,11 @@ Tag <- R6::R6Class( self$`name` <- `name` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSON = function() { TagObject <- list() if (!is.null(self$`id`)) { @@ -59,14 +55,12 @@ Tag <- R6::R6Class( } TagObject }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -77,13 +71,11 @@ Tag <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -106,67 +98,54 @@ Tag <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` self$`name` <- this_object$`name` self }, - #' Validate JSON input with respect to Tag - #' + #' @description #' Validate JSON input with respect to Tag and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Tag - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 62f5c7948839..a5070554b03b 100644 --- a/samples/client/petstore/R-httr2/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2/R/update_pet_request.R @@ -17,15 +17,13 @@ UpdatePetRequest <- R6::R6Class( public = list( `jsonData` = NULL, `binaryDataN2Information` = NULL, - #' Initialize a new UpdatePetRequest class. - #' + #' @description #' Initialize a new UpdatePetRequest class. #' #' @param jsonData jsonData #' @param binaryDataN2Information binaryDataN2Information #' @param ... Other optional arguments. - #' @export initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) @@ -35,13 +33,11 @@ UpdatePetRequest <- R6::R6Class( self$`binaryDataN2Information` <- `binaryDataN2Information` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSON = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { @@ -54,14 +50,12 @@ UpdatePetRequest <- R6::R6Class( } UpdatePetRequestObject }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { @@ -74,13 +68,11 @@ UpdatePetRequest <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`jsonData`)) { @@ -103,67 +95,54 @@ UpdatePetRequest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` self }, - #' Validate JSON input with respect to UpdatePetRequest - #' + #' @description #' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of UpdatePetRequest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/user.R b/samples/client/petstore/R-httr2/R/user.R index d37c45f4fa22..e7b911abc312 100644 --- a/samples/client/petstore/R-httr2/R/user.R +++ b/samples/client/petstore/R-httr2/R/user.R @@ -29,8 +29,7 @@ User <- R6::R6Class( `password` = NULL, `phone` = NULL, `userStatus` = NULL, - #' Initialize a new User class. - #' + #' @description #' Initialize a new User class. #' @@ -43,7 +42,6 @@ User <- R6::R6Class( #' @param phone phone #' @param userStatus User Status #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -94,13 +92,11 @@ User <- R6::R6Class( self$`userStatus` <- `userStatus` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSON = function() { UserObject <- list() if (!is.null(self$`id`)) { @@ -137,14 +133,12 @@ User <- R6::R6Class( } UserObject }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -173,13 +167,11 @@ User <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -250,14 +242,12 @@ User <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -270,53 +260,42 @@ User <- R6::R6Class( self$`userStatus` <- this_object$`userStatus` self }, - #' Validate JSON input with respect to User - #' + #' @description #' Validate JSON input with respect to User and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of User - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index 3af17151a7ce..0260367ffaa9 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -11,187 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ create_user } \emph{ Create user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ create_users_with_array_input } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ create_users_with_list_input } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ delete_user } \emph{ Delete user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ get_user_by_name } \emph{ Get user by user name } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ login_user } \emph{ Logs user into the system } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } password character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr -#' X-Rate-Limit \tab calls per hour allowed by the user \cr -#' X-Expires-After \tab date in UTC when token expires \cr -#' } -#' \item status code : 400 | Invalid username/password supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ logout_user } \emph{ Logs out current logged in user session } -#' -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ update_user } \emph{ Updated user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid user supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### create_user #################### @@ -438,13 +257,11 @@ UserApi <- R6::R6Class( "UserApi", public = list( api_client = NULL, - #' Initialize a new UserApi. - #' + #' @description #' Initialize a new UserApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -452,15 +269,14 @@ UserApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_user = function(user, ...) { local_var_response <- self$create_user_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -473,15 +289,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_user_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -560,15 +375,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_users_with_array_input = function(user, ...) { local_var_response <- self$create_users_with_array_input_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -581,15 +395,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_users_with_array_input_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -671,15 +484,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export create_users_with_list_input = function(user, ...) { local_var_response <- self$create_users_with_list_input_with_http_info(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -692,15 +504,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export create_users_with_list_input_with_http_info = function(user, ...) { args <- list(...) query_params <- list() @@ -782,15 +593,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export delete_user = function(username, ...) { local_var_response <- self$delete_user_with_http_info(username, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,15 +613,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export delete_user_with_http_info = function(username, ...) { args <- list(...) query_params <- list() @@ -888,16 +697,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export get_user_by_name = function(username, data_file = NULL, ...) { local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -910,16 +718,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export get_user_by_name_with_http_info = function(username, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1005,8 +812,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1014,8 +820,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export login_user = function(username, password, data_file = NULL, ...) { local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1028,8 +834,7 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1037,8 +842,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export login_user_with_http_info = function(username, password, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1138,14 +943,13 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return void - #' @export logout_user = function(...) { local_var_response <- self$logout_user_with_http_info(...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1158,14 +962,13 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export logout_user_with_http_info = function(...) { args <- list(...) query_params <- list() @@ -1230,16 +1033,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return void - #' @export update_user = function(username, user, ...) { local_var_response <- self$update_user_with_http_info(username, user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1252,16 +1054,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export update_user_with_http_info = function(username, user, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R-httr2/R/whale.R b/samples/client/petstore/R-httr2/R/whale.R index 1ccb12a0bc91..4656c11680d5 100644 --- a/samples/client/petstore/R-httr2/R/whale.R +++ b/samples/client/petstore/R-httr2/R/whale.R @@ -19,8 +19,7 @@ Whale <- R6::R6Class( `hasBaleen` = NULL, `hasTeeth` = NULL, `className` = NULL, - #' Initialize a new Whale class. - #' + #' @description #' Initialize a new Whale class. #' @@ -28,7 +27,6 @@ Whale <- R6::R6Class( #' @param hasBaleen hasBaleen #' @param hasTeeth hasTeeth #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -49,13 +47,11 @@ Whale <- R6::R6Class( self$`hasTeeth` <- `hasTeeth` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSON = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { @@ -72,14 +68,12 @@ Whale <- R6::R6Class( } WhaleObject }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`hasBaleen`)) { @@ -93,13 +87,11 @@ Whale <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`hasBaleen`)) { @@ -130,14 +122,12 @@ Whale <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`hasBaleen` <- this_object$`hasBaleen` @@ -145,13 +135,11 @@ Whale <- R6::R6Class( self$`className` <- this_object$`className` self }, - #' Validate JSON input with respect to Whale - #' + #' @description #' Validate JSON input with respect to Whale and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -163,23 +151,19 @@ Whale <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Whale - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -188,13 +172,11 @@ Whale <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -204,12 +186,9 @@ Whale <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R-httr2/R/zebra.R b/samples/client/petstore/R-httr2/R/zebra.R index 09f0e554d63d..95f216c3ce52 100644 --- a/samples/client/petstore/R-httr2/R/zebra.R +++ b/samples/client/petstore/R-httr2/R/zebra.R @@ -17,15 +17,13 @@ Zebra <- R6::R6Class( public = list( `type` = NULL, `className` = NULL, - #' Initialize a new Zebra class. - #' + #' @description #' Initialize a new Zebra class. #' #' @param className className #' @param type type #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `type` = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -43,13 +41,11 @@ Zebra <- R6::R6Class( self$`type` <- `type` } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSON = function() { ZebraObject <- list() if (!is.null(self$`type`)) { @@ -62,14 +58,12 @@ Zebra <- R6::R6Class( } ZebraObject }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`)) { @@ -83,13 +77,11 @@ Zebra <- R6::R6Class( } self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`type`)) { @@ -112,14 +104,12 @@ Zebra <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`) && !(this_object$`type` %in% c("plains", "mountain", "grevys"))) { @@ -129,13 +119,11 @@ Zebra <- R6::R6Class( self$`className` <- this_object$`className` self }, - #' Validate JSON input with respect to Zebra - #' + #' @description #' Validate JSON input with respect to Zebra and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -147,23 +135,19 @@ Zebra <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Zebra - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -172,13 +156,11 @@ Zebra <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -188,12 +170,9 @@ Zebra <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) 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 7cfd85917e92..454e378a5c16 100644 --- a/samples/client/petstore/R/R/allof_tag_api_response.R +++ b/samples/client/petstore/R/R/allof_tag_api_response.R @@ -27,8 +27,7 @@ AllofTagApiResponse <- R6::R6Class( `message` = NULL, `_field_list` = c("id", "name", "code", "type", "message"), `additional_properties` = list(), - #' Initialize a new AllofTagApiResponse class. - #' + #' @description #' Initialize a new AllofTagApiResponse class. #' @@ -39,7 +38,6 @@ AllofTagApiResponse <- R6::R6Class( #' @param message message #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -77,13 +75,11 @@ AllofTagApiResponse <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSON = function() { AllofTagApiResponseObject <- list() if (!is.null(self$`id`)) { @@ -112,14 +108,12 @@ AllofTagApiResponse <- R6::R6Class( AllofTagApiResponseObject }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -146,13 +140,11 @@ AllofTagApiResponse <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return AllofTagApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -204,14 +196,12 @@ AllofTagApiResponse <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of AllofTagApiResponse - #' + #' @description #' Deserialize JSON string into an instance of AllofTagApiResponse #' #' @param input_json the JSON input #' @return the instance of AllofTagApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -228,53 +218,42 @@ AllofTagApiResponse <- R6::R6Class( self }, - #' Validate JSON input with respect to AllofTagApiResponse - #' + #' @description #' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of AllofTagApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/animal.R b/samples/client/petstore/R/R/animal.R index a1689f8394fd..471a01afef3b 100644 --- a/samples/client/petstore/R/R/animal.R +++ b/samples/client/petstore/R/R/animal.R @@ -23,8 +23,7 @@ Animal <- R6::R6Class( `additional_properties` = list(), `_discriminator_property_name` = 'className', `_discriminator_mapping_name` = c('Cat' = 'Cat', 'Dog' = 'Dog'), - #' Initialize a new Animal class. - #' + #' @description #' Initialize a new Animal class. #' @@ -32,7 +31,6 @@ Animal <- R6::R6Class( #' @param color color. Default to "red". #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -52,13 +50,11 @@ Animal <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSON = function() { AnimalObject <- list() if (!is.null(self$`className`)) { @@ -75,14 +71,12 @@ Animal <- R6::R6Class( AnimalObject }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -100,13 +94,11 @@ Animal <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Animal in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -134,14 +126,12 @@ Animal <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Animal - #' + #' @description #' Deserialize JSON string into an instance of Animal #' #' @param input_json the JSON input #' @return the instance of Animal - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -155,13 +145,11 @@ Animal <- R6::R6Class( self }, - #' Validate JSON input with respect to Animal - #' + #' @description #' Validate JSON input with respect to Animal and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -173,23 +161,19 @@ Animal <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Animal - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -198,13 +182,11 @@ Animal <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -214,12 +196,9 @@ Animal <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/any_of_pig.R b/samples/client/petstore/R/R/any_of_pig.R index 53213832fc94..ba3c8ea856d9 100644 --- a/samples/client/petstore/R/R/any_of_pig.R +++ b/samples/client/petstore/R/R/any_of_pig.R @@ -17,13 +17,11 @@ AnyOfPig <- R6::R6Class( actual_type = NULL, #' @field any_of a list of object types defined in the anyOf schema. any_of = list("BasquePig", "DanishPig"), - #' Initialize a new AnyOfPig. - #' + #' @description #' Initialize a new AnyOfPig. #' #' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' An alias to the method `fromJSON`. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPig. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPig. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPig. - #' @export fromJSON = function(input) { error_messages <- list() @@ -93,13 +89,11 @@ AnyOfPig <- R6::R6Class( stop(paste("No match found when deserializing the input into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: >>", paste(error_messages, collapse = " >> "))) }, - #' Serialize AnyOfPig to JSON string. - #' + #' @description #' Serialize AnyOfPig to JSON string. #' #' @return JSON string representation of the AnyOfPig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify((self$actual_instance$toJSONString()))) @@ -107,13 +101,11 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Serialize AnyOfPig to JSON. - #' + #' @description #' Serialize AnyOfPig to JSON. #' #' @return JSON representation of the AnyOfPig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -121,14 +113,12 @@ AnyOfPig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPig. - #' + #' @description #' Validate the input JSON with respect to AnyOfPig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -141,13 +131,11 @@ AnyOfPig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -157,12 +145,9 @@ AnyOfPig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/any_of_primitive_type_test.R b/samples/client/petstore/R/R/any_of_primitive_type_test.R index 9b8d2a4d15b1..99aa52c73427 100644 --- a/samples/client/petstore/R/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/any_of_primitive_type_test.R @@ -17,13 +17,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new AnyOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new AnyOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of AnyOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize AnyOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the AnyOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize AnyOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize AnyOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the AnyOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R index 2fa06773f021..631827298a30 100644 --- a/samples/client/petstore/R/R/api_client.R +++ b/samples/client/petstore/R/R/api_client.R @@ -150,8 +150,7 @@ ApiClient <- R6::R6Class( self$max_retry_attempts <- max_retry_attempts } }, - #' Prepare to make an API call with the retry logic. - #' + #' @description #' Prepare to make an API call with the retry logic. #' @@ -166,8 +165,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process the data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export CallApi = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, body, stream_callback = NULL, ...) { @@ -197,8 +196,7 @@ ApiClient <- R6::R6Class( resp }, - #' Make an API call - #' + #' @description #' Make an API call #' @@ -213,8 +211,8 @@ ApiClient <- R6::R6Class( #' @param body The HTTP request body. #' @param stream_callback Callback function to process data stream #' @param ... Other optional arguments. + #' #' @return HTTP response - #' @export Execute = function(url, method, query_params, header_params, form_params, file_params, accepts, content_types, @@ -297,7 +295,7 @@ ApiClient <- R6::R6Class( # return ApiResponse api_response <- ApiResponse$new() - api_response$status_code <- httr::status_code(httr_response) + api_response$status_code <- httr::status_code(httr_response) api_response$status_code_desc <- httr::http_status(httr_response)$reason api_response$response <- httr::content(httr_response, "raw") api_response$headers <- httr::headers(httr_response) @@ -305,32 +303,31 @@ ApiClient <- R6::R6Class( api_response } }, - #' Deserialize the content of API response to the given type. - #' + #' @description #' Deserialize the content of API response to the given type. #' #' @param raw_response Raw response. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserialize = function(raw_response, return_type, pkg_env) { resp_obj <- jsonlite::fromJSON(raw_response) self$deserializeObj(resp_obj, return_type, pkg_env) }, - #' Deserialize the response from jsonlite object based on the given type - #' + #' @description #' Deserialize the response from jsonlite object based on the given type #' by handling complex and nested types by iterating recursively - #' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc., + #' Example return_types will be like "array[integer]", "map(Pet)", + #' "array[map(Tag)]", etc., #' #' @param obj Response object. #' @param return_type R return type. #' @param pkg_env Package environment. + #' #' @return Deserialized object. - #' @export deserializeObj = function(obj, return_type, pkg_env) { return_obj <- NULL primitive_types <- c("character", "numeric", "integer", "logical", "complex") @@ -392,15 +389,14 @@ ApiClient <- R6::R6Class( } return_obj }, - #' Return a property header (for accept or content-type). - #' + #' @description #' Return a property header (for accept or content-type). If JSON-related MIME is found, #' return it. Otherwise, return the first one, if any. #' #' @param headers A list of headers + #' #' @return A header (e.g. 'application/json') - #' @export select_header = function(headers) { if (length(headers) == 0) { return(invisible(NULL)) diff --git a/samples/client/petstore/R/R/api_exception.R b/samples/client/petstore/R/R/api_exception.R index f31f27858b61..cc6e7b0e7b40 100644 --- a/samples/client/petstore/R/R/api_exception.R +++ b/samples/client/petstore/R/R/api_exception.R @@ -23,15 +23,13 @@ ApiException <- R6::R6Class( body = NULL, headers = NULL, error_object = NULL, - #' Initialize a new ApiException class. - #' + #' @description - #' Initialize a new ApiExceptino class. + #' Initialize a new ApiException class. #' #' @param status HTTP status. #' @param reason Reason of the ApiException. #' @param http_response HTTP response object. - #' @export initialize = function(status = NULL, reason = NULL, http_response = NULL) { if (!is.null(http_response)) { self$status <- http_response$status_code @@ -51,13 +49,11 @@ ApiException <- R6::R6Class( self$error_object <- NULL } }, - #' Returns the string format of ApiException. - #' + #' @description #' Returns the string format of ApiException. #' #' @return the string format of ApiException. - #' @export toString = function() { errorMsg <- "" errorMsg <- paste("status : ", self$status, "\n", sep = "") diff --git a/samples/client/petstore/R/R/api_response.R b/samples/client/petstore/R/R/api_response.R index 2916fd07d45a..95dc6428290e 100644 --- a/samples/client/petstore/R/R/api_response.R +++ b/samples/client/petstore/R/R/api_response.R @@ -23,8 +23,7 @@ ApiResponse <- R6::R6Class( status_code = NULL, status_code_desc = NULL, headers = NULL, - #' Initialize a new ApiResponse class. - #' + #' @description #' Initialize a new ApiResponse class. #' @@ -33,7 +32,6 @@ ApiResponse <- R6::R6Class( #' @param status_code The HTTP response status code. #' @param status_code_desc The brief description of the HTTP response status code. #' @param headers The HTTP response headers. - #' @export initialize = function(content = NULL, response = NULL, status_code = NULL, @@ -46,15 +44,13 @@ ApiResponse <- R6::R6Class( self$headers <- headers }, - #' Return the response as text - #' + #' @description #' The response is stored as a raw vector. Use this to access the response after #' converting it to text. If the response is not coercible to text NA is returned. #' #' @param from_encoding The encoding of the raw response. #' @param to_encoding The target encoding of the return value. - #' @export response_as_text = function(from_encoding = "", to_encoding = "UTF-8") { if (is.null(self$response)) { self$response <- charToRaw(jsonlite::toJSON("NULL")) diff --git a/samples/client/petstore/R/R/basque_pig.R b/samples/client/petstore/R/R/basque_pig.R index 048bff78e75c..cce82cd7d932 100644 --- a/samples/client/petstore/R/R/basque_pig.R +++ b/samples/client/petstore/R/R/basque_pig.R @@ -21,8 +21,7 @@ BasquePig <- R6::R6Class( `color` = NULL, `_field_list` = c("className", "color"), `additional_properties` = list(), - #' Initialize a new BasquePig class. - #' + #' @description #' Initialize a new BasquePig class. #' @@ -30,7 +29,6 @@ BasquePig <- R6::R6Class( #' @param color color #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ BasquePig <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSON = function() { BasquePigObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ BasquePig <- R6::R6Class( BasquePigObject }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -98,13 +92,11 @@ BasquePig <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return BasquePig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -132,14 +124,12 @@ BasquePig <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of BasquePig - #' + #' @description #' Deserialize JSON string into an instance of BasquePig #' #' @param input_json the JSON input #' @return the instance of BasquePig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -153,13 +143,11 @@ BasquePig <- R6::R6Class( self }, - #' Validate JSON input with respect to BasquePig - #' + #' @description #' Validate JSON input with respect to BasquePig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -179,23 +167,19 @@ BasquePig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of BasquePig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -209,13 +193,11 @@ BasquePig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -230,12 +212,9 @@ BasquePig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/cat.R b/samples/client/petstore/R/R/cat.R index 9198500c01a2..b4014681ba49 100644 --- a/samples/client/petstore/R/R/cat.R +++ b/samples/client/petstore/R/R/cat.R @@ -24,8 +24,7 @@ Cat <- R6::R6Class( `declawed` = NULL, `_field_list` = c("className", "color", "declawed"), `additional_properties` = list(), - #' Initialize a new Cat class. - #' + #' @description #' Initialize a new Cat class. #' @@ -34,7 +33,6 @@ Cat <- R6::R6Class( #' @param declawed declawed #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -60,13 +58,11 @@ Cat <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSON = function() { CatObject <- list() if (!is.null(self$`className`)) { @@ -87,14 +83,12 @@ Cat <- R6::R6Class( CatObject }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -115,13 +109,11 @@ Cat <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Cat in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -157,14 +149,12 @@ Cat <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Cat - #' + #' @description #' Deserialize JSON string into an instance of Cat #' #' @param input_json the JSON input #' @return the instance of Cat - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -179,13 +169,11 @@ Cat <- R6::R6Class( self }, - #' Validate JSON input with respect to Cat - #' + #' @description #' Validate JSON input with respect to Cat and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -197,23 +185,19 @@ Cat <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Cat - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -222,13 +206,11 @@ Cat <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -238,12 +220,9 @@ Cat <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/category.R b/samples/client/petstore/R/R/category.R index 175b3cbb9aeb..31106a3bc9e2 100644 --- a/samples/client/petstore/R/R/category.R +++ b/samples/client/petstore/R/R/category.R @@ -21,8 +21,7 @@ Category <- R6::R6Class( `name` = NULL, `_field_list` = c("id", "name"), `additional_properties` = list(), - #' Initialize a new Category class. - #' + #' @description #' Initialize a new Category class. #' @@ -30,7 +29,6 @@ Category <- R6::R6Class( #' @param name name #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -50,13 +48,11 @@ Category <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSON = function() { CategoryObject <- list() if (!is.null(self$`id`)) { @@ -73,14 +69,12 @@ Category <- R6::R6Class( CategoryObject }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -98,13 +92,11 @@ Category <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Category in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -132,14 +124,12 @@ Category <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Category - #' + #' @description #' Deserialize JSON string into an instance of Category #' #' @param input_json the JSON input #' @return the instance of Category - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -153,33 +143,27 @@ Category <- R6::R6Class( self }, - #' Validate JSON input with respect to Category - #' + #' @description #' Validate JSON input with respect to Category and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Category - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { return(FALSE) @@ -187,13 +171,11 @@ Category <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) { @@ -202,12 +184,9 @@ Category <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/danish_pig.R b/samples/client/petstore/R/R/danish_pig.R index 627bd413163e..08ca2b9e3eea 100644 --- a/samples/client/petstore/R/R/danish_pig.R +++ b/samples/client/petstore/R/R/danish_pig.R @@ -21,8 +21,7 @@ DanishPig <- R6::R6Class( `size` = NULL, `_field_list` = c("className", "size"), `additional_properties` = list(), - #' Initialize a new DanishPig class. - #' + #' @description #' Initialize a new DanishPig class. #' @@ -30,7 +29,6 @@ DanishPig <- R6::R6Class( #' @param size size #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -50,13 +48,11 @@ DanishPig <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSON = function() { DanishPigObject <- list() if (!is.null(self$`className`)) { @@ -73,14 +69,12 @@ DanishPig <- R6::R6Class( DanishPigObject }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -98,13 +92,11 @@ DanishPig <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DanishPig in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -132,14 +124,12 @@ DanishPig <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of DanishPig - #' + #' @description #' Deserialize JSON string into an instance of DanishPig #' #' @param input_json the JSON input #' @return the instance of DanishPig - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -153,13 +143,11 @@ DanishPig <- R6::R6Class( self }, - #' Validate JSON input with respect to DanishPig - #' + #' @description #' Validate JSON input with respect to DanishPig and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -179,23 +167,19 @@ DanishPig <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DanishPig - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -209,13 +193,11 @@ DanishPig <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -230,12 +212,9 @@ DanishPig <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/date.R b/samples/client/petstore/R/R/date.R index 3299b6658ad1..d9b6ec0beb1b 100644 --- a/samples/client/petstore/R/R/date.R +++ b/samples/client/petstore/R/R/date.R @@ -23,8 +23,7 @@ Date <- R6::R6Class( `url_property` = NULL, `_field_list` = c("className", "percent_description", "url_property"), `additional_properties` = list(), - #' Initialize a new Date class. - #' + #' @description #' Initialize a new Date class. #' @@ -33,7 +32,6 @@ Date <- R6::R6Class( #' @param percent_description using \% in the description #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -63,13 +61,11 @@ Date <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSON = function() { DateObject <- list() if (!is.null(self$`className`)) { @@ -90,14 +86,12 @@ Date <- R6::R6Class( DateObject }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -122,13 +116,11 @@ Date <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Date in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -164,14 +156,12 @@ Date <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Date - #' + #' @description #' Deserialize JSON string into an instance of Date #' #' @param input_json the JSON input #' @return the instance of Date - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -190,13 +180,11 @@ Date <- R6::R6Class( self }, - #' Validate JSON input with respect to Date - #' + #' @description #' Validate JSON input with respect to Date and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -220,23 +208,19 @@ Date <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Date - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -250,13 +234,11 @@ Date <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -271,12 +253,9 @@ Date <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/dog.R b/samples/client/petstore/R/R/dog.R index 068eec8eca83..34ae29121163 100644 --- a/samples/client/petstore/R/R/dog.R +++ b/samples/client/petstore/R/R/dog.R @@ -24,8 +24,7 @@ Dog <- R6::R6Class( `breed` = NULL, `_field_list` = c("className", "color", "breed"), `additional_properties` = list(), - #' Initialize a new Dog class. - #' + #' @description #' Initialize a new Dog class. #' @@ -34,7 +33,6 @@ Dog <- R6::R6Class( #' @param breed breed #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -60,13 +58,11 @@ Dog <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSON = function() { DogObject <- list() if (!is.null(self$`className`)) { @@ -87,14 +83,12 @@ Dog <- R6::R6Class( DogObject }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`className`)) { @@ -115,13 +109,11 @@ Dog <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Dog in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`className`)) { @@ -157,14 +149,12 @@ Dog <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Dog - #' + #' @description #' Deserialize JSON string into an instance of Dog #' #' @param input_json the JSON input #' @return the instance of Dog - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`className` <- this_object$`className` @@ -179,13 +169,11 @@ Dog <- R6::R6Class( self }, - #' Validate JSON input with respect to Dog - #' + #' @description #' Validate JSON input with respect to Dog and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -197,23 +185,19 @@ Dog <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Dog - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -222,13 +206,11 @@ Dog <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -238,12 +220,9 @@ Dog <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/dummy_model.R b/samples/client/petstore/R/R/dummy_model.R index 75c7c5f8a567..12d3ab52a155 100644 --- a/samples/client/petstore/R/R/dummy_model.R +++ b/samples/client/petstore/R/R/dummy_model.R @@ -19,15 +19,13 @@ DummyModel <- R6::R6Class( `property` = NULL, `_field_list` = c("property"), `additional_properties` = list(), - #' Initialize a new DummyModel class. - #' + #' @description #' Initialize a new DummyModel class. #' #' @param property property #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`property` = NULL, additional_properties = NULL, ...) { if (!is.null(`property`)) { if (!(is.character(`property`) && length(`property`) == 1)) { @@ -41,13 +39,11 @@ DummyModel <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DummyModel in JSON format - #' @export toJSON = function() { DummyModelObject <- list() if (!is.null(self$`property`)) { @@ -60,14 +56,12 @@ DummyModel <- R6::R6Class( DummyModelObject }, - #' Deserialize JSON string into an instance of DummyModel - #' + #' @description #' Deserialize JSON string into an instance of DummyModel #' #' @param input_json the JSON input #' @return the instance of DummyModel - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`property`)) { @@ -82,13 +76,11 @@ DummyModel <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return DummyModel in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`property`)) { @@ -108,14 +100,12 @@ DummyModel <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of DummyModel - #' + #' @description #' Deserialize JSON string into an instance of DummyModel #' #' @param input_json the JSON input #' @return the instance of DummyModel - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`property` <- this_object$`property` @@ -128,53 +118,42 @@ DummyModel <- R6::R6Class( self }, - #' Validate JSON input with respect to DummyModel - #' + #' @description #' Validate JSON input with respect to DummyModel and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of DummyModel - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index 78f339f559bc..8ec29fe83080 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -11,107 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ AddPetOptional } \emph{ Add a new pet to the store (optional body) } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FakeDataFile } \emph{ test data_file to ensure it's escaped correctly } -#' -#' -#' \itemize{ -#' \item \emph{ @param } dummy character -#' \item \emph{ @param } var_data_file character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FakePathArray } \emph{ test array parameter in path } -#' -#' -#' \itemize{ -#' \item \emph{ @param } path_array list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FakeRegularExpression } \emph{ test regular expression to ensure no exception } -#' -#' -#' \itemize{ -#' \item \emph{ @param } reg_exp_test character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FakeSetQuery } \emph{ test set query parameter } -#' -#' -#' \itemize{ -#' \item \emph{ @param } set_dummy list( character ) -#' \item \emph{ @param } array_dummy list( character ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### AddPetOptional #################### @@ -270,13 +169,11 @@ FakeApi <- R6::R6Class( "FakeApi", public = list( api_client = NULL, - #' Initialize a new FakeApi. - #' + #' @description #' Initialize a new FakeApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -284,16 +181,15 @@ FakeApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export AddPetOptional = function(pet = NULL, data_file = NULL, ...) { local_var_response <- self$AddPetOptionalWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -306,16 +202,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store (optional body) - #' + #' @description #' Add a new pet to the store (optional body) #' #' @param pet (optional) Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export AddPetOptionalWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -400,8 +295,7 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -409,8 +303,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export FakeDataFile = function(dummy, var_data_file = NULL, data_file = NULL, ...) { local_var_response <- self$FakeDataFileWithHttpInfo(dummy, var_data_file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -423,8 +317,7 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test data_file to ensure it's escaped correctly - #' + #' @description #' test data_file to ensure it's escaped correctly #' @@ -432,8 +325,8 @@ FakeApi <- R6::R6Class( #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export FakeDataFileWithHttpInfo = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -520,15 +413,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array dummy path parameter #' @param ... Other optional arguments + #' #' @return void - #' @export FakePathArray = function(path_array, ...) { local_var_response <- self$FakePathArrayWithHttpInfo(path_array, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -541,15 +433,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test array parameter in path - #' + #' @description #' test array parameter in path #' #' @param path_array dummy path parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export FakePathArrayWithHttpInfo = function(path_array, ...) { args <- list(...) query_params <- list() @@ -622,15 +513,14 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return void - #' @export FakeRegularExpression = function(reg_exp_test, ...) { local_var_response <- self$FakeRegularExpressionWithHttpInfo(reg_exp_test, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -643,15 +533,14 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test regular expression to ensure no exception - #' + #' @description #' test regular expression to ensure no exception #' #' @param reg_exp_test dummy required parameter #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export FakeRegularExpressionWithHttpInfo = function(reg_exp_test, ...) { args <- list(...) query_params <- list() @@ -728,16 +617,15 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return void - #' @export FakeSetQuery = function(set_dummy, array_dummy, ...) { local_var_response <- self$FakeSetQueryWithHttpInfo(set_dummy, array_dummy, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -750,16 +638,15 @@ FakeApi <- R6::R6Class( local_var_response } }, - #' test set query parameter - #' + #' @description #' test set query parameter #' #' @param set_dummy set query #' @param array_dummy array query #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export FakeSetQueryWithHttpInfo = function(set_dummy, array_dummy, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R/R/format_test.R b/samples/client/petstore/R/R/format_test.R index 85894ec7b1f5..f93bf1435c9a 100644 --- a/samples/client/petstore/R/R/format_test.R +++ b/samples/client/petstore/R/R/format_test.R @@ -47,8 +47,7 @@ FormatTest <- R6::R6Class( `pattern_with_digits_and_delimiter` = NULL, `_field_list` = c("integer", "int32", "int64", "number", "float", "double", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"), `additional_properties` = list(), - #' Initialize a new FormatTest class. - #' + #' @description #' Initialize a new FormatTest class. #' @@ -69,7 +68,6 @@ FormatTest <- R6::R6Class( #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, additional_properties = NULL, ...) { if (!missing(`number`)) { self$`number` <- `number` @@ -158,13 +156,11 @@ FormatTest <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSON = function() { FormatTestObject <- list() if (!is.null(self$`integer`)) { @@ -233,14 +229,12 @@ FormatTest <- R6::R6Class( FormatTestObject }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`integer`)) { @@ -297,13 +291,11 @@ FormatTest <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return FormatTest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`integer`)) { @@ -435,14 +427,12 @@ FormatTest <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of FormatTest - #' + #' @description #' Deserialize JSON string into an instance of FormatTest #' #' @param input_json the JSON input #' @return the instance of FormatTest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`integer` <- this_object$`integer` @@ -469,13 +459,11 @@ FormatTest <- R6::R6Class( self }, - #' Validate JSON input with respect to FormatTest - #' + #' @description #' Validate JSON input with respect to FormatTest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `number` @@ -505,23 +493,19 @@ FormatTest <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of FormatTest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { if (self$`integer` > 100) { return(FALSE) @@ -599,13 +583,11 @@ FormatTest <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() if (self$`integer` > 100) { @@ -684,12 +666,9 @@ FormatTest <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/mammal.R b/samples/client/petstore/R/R/mammal.R index 13bb0da875e2..bbd57ed00acb 100644 --- a/samples/client/petstore/R/R/mammal.R +++ b/samples/client/petstore/R/R/mammal.R @@ -17,13 +17,11 @@ Mammal <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("Whale", "Zebra"), - #' Initialize a new Mammal. - #' + #' @description #' Initialize a new Mammal. #' #' @param instance an instance of the object defined in the oneOf schemas: "Whale", "Zebra" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Mammal <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Mammal. - #' + #' @description #' Deserialize JSON string into an instance of Mammal. #' #' @param input The input JSON. + #' #' @return An instance of Mammal. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -110,13 +106,11 @@ Mammal <- R6::R6Class( self }, - #' Serialize Mammal to JSON string. - #' + #' @description #' Serialize Mammal to JSON string. #' #' @return JSON string representation of the Mammal. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -124,13 +118,11 @@ Mammal <- R6::R6Class( NULL } }, - #' Serialize Mammal to JSON. - #' + #' @description #' Serialize Mammal to JSON. #' #' @return JSON representation of the Mammal. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -138,14 +130,12 @@ Mammal <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Mammal. - #' + #' @description #' Validate the input JSON with respect to Mammal and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -158,13 +148,11 @@ Mammal <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -174,12 +162,9 @@ Mammal <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/model_api_response.R b/samples/client/petstore/R/R/model_api_response.R index 028c66c72305..9116e438fedc 100644 --- a/samples/client/petstore/R/R/model_api_response.R +++ b/samples/client/petstore/R/R/model_api_response.R @@ -23,8 +23,7 @@ ModelApiResponse <- R6::R6Class( `message` = NULL, `_field_list` = c("code", "type", "message"), `additional_properties` = list(), - #' Initialize a new ModelApiResponse class. - #' + #' @description #' Initialize a new ModelApiResponse class. #' @@ -33,7 +32,6 @@ ModelApiResponse <- R6::R6Class( #' @param message message #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { if (!(is.numeric(`code`) && length(`code`) == 1)) { @@ -59,13 +57,11 @@ ModelApiResponse <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSON = function() { ModelApiResponseObject <- list() if (!is.null(self$`code`)) { @@ -86,14 +82,12 @@ ModelApiResponse <- R6::R6Class( ModelApiResponseObject }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`code`)) { @@ -114,13 +108,11 @@ ModelApiResponse <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return ModelApiResponse in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`code`)) { @@ -156,14 +148,12 @@ ModelApiResponse <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of ModelApiResponse - #' + #' @description #' Deserialize JSON string into an instance of ModelApiResponse #' #' @param input_json the JSON input #' @return the instance of ModelApiResponse - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`code` <- this_object$`code` @@ -178,53 +168,42 @@ ModelApiResponse <- R6::R6Class( self }, - #' Validate JSON input with respect to ModelApiResponse - #' + #' @description #' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of ModelApiResponse - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index 8fbdf43b466e..e04a31a69acd 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -21,8 +21,7 @@ NestedOneOf <- R6::R6Class( `nested_pig` = NULL, `_field_list` = c("size", "nested_pig"), `additional_properties` = list(), - #' Initialize a new NestedOneOf class. - #' + #' @description #' Initialize a new NestedOneOf class. #' @@ -30,7 +29,6 @@ NestedOneOf <- R6::R6Class( #' @param nested_pig nested_pig #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { if (!(is.numeric(`size`) && length(`size`) == 1)) { @@ -48,13 +46,11 @@ NestedOneOf <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSON = function() { NestedOneOfObject <- list() if (!is.null(self$`size`)) { @@ -71,14 +67,12 @@ NestedOneOf <- R6::R6Class( NestedOneOfObject }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`size`)) { @@ -98,13 +92,11 @@ NestedOneOf <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return NestedOneOf in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`size`)) { @@ -132,14 +124,12 @@ NestedOneOf <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of NestedOneOf - #' + #' @description #' Deserialize JSON string into an instance of NestedOneOf #' #' @param input_json the JSON input #' @return the instance of NestedOneOf - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` @@ -153,53 +143,42 @@ NestedOneOf <- R6::R6Class( self }, - #' Validate JSON input with respect to NestedOneOf - #' + #' @description #' Validate JSON input with respect to NestedOneOf and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of NestedOneOf - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/one_of_primitive_type_test.R b/samples/client/petstore/R/R/one_of_primitive_type_test.R index da4d226dd3bb..8a9280a9b213 100644 --- a/samples/client/petstore/R/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/one_of_primitive_type_test.R @@ -17,13 +17,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("character", "integer"), - #' Initialize a new OneOfPrimitiveTypeTest. - #' + #' @description #' Initialize a new OneOfPrimitiveTypeTest. #' #' @param instance an instance of the object defined in the oneOf schemas: "character", "integer" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ OneOfPrimitiveTypeTest <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. - #' + #' @description #' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest. #' #' @param input The input JSON. + #' #' @return An instance of OneOfPrimitiveTypeTest. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -112,13 +108,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self }, - #' Serialize OneOfPrimitiveTypeTest to JSON string. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON string. #' #' @return JSON string representation of the OneOfPrimitiveTypeTest. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -126,13 +120,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Serialize OneOfPrimitiveTypeTest to JSON. - #' + #' @description #' Serialize OneOfPrimitiveTypeTest to JSON. #' #' @return JSON representation of the OneOfPrimitiveTypeTest. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -140,14 +132,12 @@ OneOfPrimitiveTypeTest <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to OneOfPrimitiveTypeTest. - #' + #' @description #' Validate the input JSON with respect to OneOfPrimitiveTypeTest and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -160,13 +150,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -176,12 +164,9 @@ OneOfPrimitiveTypeTest <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/order.R b/samples/client/petstore/R/R/order.R index 08c080464e64..cd84eed74eef 100644 --- a/samples/client/petstore/R/R/order.R +++ b/samples/client/petstore/R/R/order.R @@ -29,8 +29,7 @@ Order <- R6::R6Class( `complete` = NULL, `_field_list` = c("id", "petId", "quantity", "shipDate", "status", "complete"), `additional_properties` = list(), - #' Initialize a new Order class. - #' + #' @description #' Initialize a new Order class. #' @@ -42,7 +41,6 @@ Order <- R6::R6Class( #' @param complete complete. Default to FALSE. #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -89,13 +87,11 @@ Order <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSON = function() { OrderObject <- list() if (!is.null(self$`id`)) { @@ -128,14 +124,12 @@ Order <- R6::R6Class( OrderObject }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -168,13 +162,11 @@ Order <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Order in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -234,14 +226,12 @@ Order <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Order - #' + #' @description #' Deserialize JSON string into an instance of Order #' #' @param input_json the JSON input #' @return the instance of Order - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -262,53 +252,42 @@ Order <- R6::R6Class( self }, - #' Validate JSON input with respect to Order - #' + #' @description #' Validate JSON input with respect to Order and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Order - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index ea3b23ce9680..28e1693c419f 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -29,8 +29,7 @@ Pet <- R6::R6Class( `status` = NULL, `_field_list` = c("id", "category", "name", "photoUrls", "tags", "status"), `additional_properties` = list(), - #' Initialize a new Pet class. - #' + #' @description #' Initialize a new Pet class. #' @@ -42,7 +41,6 @@ Pet <- R6::R6Class( #' @param status pet status in the store #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { if (!(is.character(`name`) && length(`name`) == 1)) { @@ -85,13 +83,11 @@ Pet <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSON = function() { PetObject <- list() if (!is.null(self$`id`)) { @@ -124,14 +120,12 @@ Pet <- R6::R6Class( PetObject }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -166,13 +160,11 @@ Pet <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Pet in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -232,14 +224,12 @@ Pet <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Pet - #' + #' @description #' Deserialize JSON string into an instance of Pet #' #' @param input_json the JSON input #' @return the instance of Pet - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -260,13 +250,11 @@ Pet <- R6::R6Class( self }, - #' Validate JSON input with respect to Pet - #' + #' @description #' Validate JSON input with respect to Pet and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `name` @@ -285,23 +273,19 @@ Pet <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Pet - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `name` is null if (is.null(self$`name`)) { @@ -315,13 +299,11 @@ Pet <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `name` is null @@ -336,12 +318,9 @@ Pet <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 361d74d4c38c..a1dae0ea497a 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -11,278 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ AddPet } \emph{ Add a new pet to the store } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ DeletePet } \emph{ Deletes a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } api_key character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid pet value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FindPetsByStatus } \emph{ Finds Pets by status } -#' Multiple status values can be provided with comma separated strings -#' -#' \itemize{ -#' \item \emph{ @param } status Enum < [available, pending, sold] > -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid status value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ FindPetsByTags } \emph{ Finds Pets by tags } -#' Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -#' -#' \itemize{ -#' \item \emph{ @param } tags list( character ) -#' \item \emph{ @returnType } list( \link{Pet} ) \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : array[Pet] -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid tag value -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ GetPetById } \emph{ Find pet by ID } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ GetPetByIdStreaming } \emph{ Find pet by ID (streaming) } -#' Returns a single pet -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ TestHeader } \emph{ Header test } -#' Header test -#' -#' \itemize{ -#' \item \emph{ @param } header_test_int integer -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ UpdatePet } \emph{ Update an existing pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet \link{Pet} -#' \item \emph{ @returnType } \link{Pet} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Pet -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Pet not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 405 | Validation exception -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ UpdatePetWithForm } \emph{ Updates a pet in the store with form data } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } name character -#' \item \emph{ @param } status character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 405 | Invalid input -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ UploadFile } \emph{ uploads an image } -#' -#' -#' \itemize{ -#' \item \emph{ @param } pet_id integer -#' \item \emph{ @param } additional_metadata character -#' \item \emph{ @param } file data.frame -#' \item \emph{ @returnType } \link{ModelApiResponse} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : ModelApiResponse -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### AddPet #################### @@ -644,13 +372,11 @@ PetApi <- R6::R6Class( "PetApi", public = list( api_client = NULL, - #' Initialize a new PetApi. - #' + #' @description #' Initialize a new PetApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -658,16 +384,15 @@ PetApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export AddPet = function(pet, data_file = NULL, ...) { local_var_response <- self$AddPetWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -680,16 +405,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Add a new pet to the store - #' + #' @description #' Add a new pet to the store #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export AddPetWithHttpInfo = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -781,16 +505,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return void - #' @export DeletePet = function(pet_id, api_key = NULL, ...) { local_var_response <- self$DeletePetWithHttpInfo(pet_id, api_key, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,16 +526,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Deletes a pet - #' + #' @description #' Deletes a pet #' #' @param pet_id Pet id to delete #' @param api_key (optional) No description #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export DeletePetWithHttpInfo = function(pet_id, api_key = NULL, ...) { args <- list(...) query_params <- list() @@ -891,16 +613,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export FindPetsByStatus = function(status, data_file = NULL, ...) { local_var_response <- self$FindPetsByStatusWithHttpInfo(status, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -913,16 +634,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by status - #' + #' @description #' Finds Pets by status #' #' @param status Status values that need to be considered for filter #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export FindPetsByStatusWithHttpInfo = function(status, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1019,16 +739,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return array[Pet] - #' @export FindPetsByTags = function(tags, data_file = NULL, ...) { local_var_response <- self$FindPetsByTagsWithHttpInfo(tags, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1041,16 +760,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Finds Pets by tags - #' + #' @description #' Finds Pets by tags #' #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - #' @export FindPetsByTagsWithHttpInfo = function(tags, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1135,16 +853,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export GetPetById = function(pet_id, data_file = NULL, ...) { local_var_response <- self$GetPetByIdWithHttpInfo(pet_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1157,16 +874,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID - #' + #' @description #' Find pet by ID #' #' @param pet_id ID of pet to return #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export GetPetByIdWithHttpInfo = function(pet_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1256,8 +972,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1265,8 +980,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export GetPetByIdStreaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$GetPetByIdStreamingWithHttpInfo(pet_id, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1283,8 +998,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Find pet by ID (streaming) - #' + #' @description #' Find pet by ID (streaming) #' @@ -1292,8 +1006,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1388,8 +1102,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Header test - #' + #' @description #' Header test #' @@ -1397,8 +1110,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export TestHeader = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { local_var_response <- self$TestHeaderWithHttpInfo(header_test_int, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -1415,8 +1128,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Header test - #' + #' @description #' Header test #' @@ -1424,8 +1136,8 @@ PetApi <- R6::R6Class( #' @param stream_callback (optional) callback function to process the data stream #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export TestHeaderWithHttpInfo = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1518,16 +1230,15 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Pet - #' @export UpdatePet = function(pet, data_file = NULL, ...) { local_var_response <- self$UpdatePetWithHttpInfo(pet, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1540,16 +1251,15 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Update an existing pet - #' + #' @description #' Update an existing pet #' #' @param pet Pet object that needs to be added to the store #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Pet) with additional information such as HTTP status code, headers - #' @export UpdatePetWithHttpInfo = function(pet, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1640,8 +1350,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1649,8 +1358,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return void - #' @export UpdatePetWithForm = function(pet_id, name = NULL, status = NULL, ...) { local_var_response <- self$UpdatePetWithFormWithHttpInfo(pet_id, name, status, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1663,8 +1372,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' Updates a pet in the store with form data - #' + #' @description #' Updates a pet in the store with form data #' @@ -1672,8 +1380,8 @@ PetApi <- R6::R6Class( #' @param name (optional) Updated name of the pet #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export UpdatePetWithFormWithHttpInfo = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) query_params <- list() @@ -1750,8 +1458,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1760,8 +1467,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return ModelApiResponse - #' @export UploadFile = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { local_var_response <- self$UploadFileWithHttpInfo(pet_id, additional_metadata, file, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1774,8 +1481,7 @@ PetApi <- R6::R6Class( local_var_response } }, - #' uploads an image - #' + #' @description #' uploads an image #' @@ -1784,8 +1490,8 @@ PetApi <- R6::R6Class( #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - #' @export UploadFileWithHttpInfo = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R/R/pet_map.R b/samples/client/petstore/R/R/pet_map.R index 80d9eb3abf89..1fc910ac1da2 100644 --- a/samples/client/petstore/R/R/pet_map.R +++ b/samples/client/petstore/R/R/pet_map.R @@ -19,15 +19,13 @@ PetMap <- R6::R6Class( `pet` = NULL, `_field_list` = c("pet"), `additional_properties` = list(), - #' Initialize a new PetMap class. - #' + #' @description #' Initialize a new PetMap class. #' #' @param pet pet #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`pet` = NULL, additional_properties = NULL, ...) { if (!is.null(`pet`)) { stopifnot(is.vector(`pet`), length(`pet`) != 0) @@ -40,13 +38,11 @@ PetMap <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSON = function() { PetMapObject <- list() if (!is.null(self$`pet`)) { @@ -59,14 +55,12 @@ PetMap <- R6::R6Class( PetMapObject }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`pet`)) { @@ -81,13 +75,11 @@ PetMap <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return PetMap in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`pet`)) { @@ -107,14 +99,12 @@ PetMap <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of PetMap - #' + #' @description #' Deserialize JSON string into an instance of PetMap #' #' @param input_json the JSON input #' @return the instance of PetMap - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`pet` <- ApiClient$new()$deserializeObj(this_object$`pet`, "map(character)", loadNamespace("petstore")) @@ -127,53 +117,42 @@ PetMap <- R6::R6Class( self }, - #' Validate JSON input with respect to PetMap - #' + #' @description #' Validate JSON input with respect to PetMap and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of PetMap - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/pig.R b/samples/client/petstore/R/R/pig.R index 05bfeebe4ced..596a9307d4dc 100644 --- a/samples/client/petstore/R/R/pig.R +++ b/samples/client/petstore/R/R/pig.R @@ -17,13 +17,11 @@ Pig <- R6::R6Class( actual_type = NULL, #' @field one_of a list of types defined in the oneOf schema. one_of = list("BasquePig", "DanishPig"), - #' Initialize a new Pig. - #' + #' @description #' Initialize a new Pig. #' #' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig" - #' @export initialize = function(instance = NULL) { if (is.null(instance)) { # do nothing @@ -38,26 +36,24 @@ Pig <- R6::R6Class( get(class(instance)[[1]], pos = -1)$classname)) } }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' An alias to the method `fromJSON` . #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSONString = function(input) { self$fromJSON(input) }, - #' Deserialize JSON string into an instance of Pig. - #' + #' @description #' Deserialize JSON string into an instance of Pig. #' #' @param input The input JSON. + #' #' @return An instance of Pig. - #' @export fromJSON = function(input) { matched <- 0 # match counter matched_schemas <- list() #names of matched schemas @@ -110,13 +106,11 @@ Pig <- R6::R6Class( self }, - #' Serialize Pig to JSON string. - #' + #' @description #' Serialize Pig to JSON string. #' #' @return JSON string representation of the Pig. - #' @export toJSONString = function() { if (!is.null(self$actual_instance)) { as.character(jsonlite::minify(self$actual_instance$toJSONString())) @@ -124,13 +118,11 @@ Pig <- R6::R6Class( NULL } }, - #' Serialize Pig to JSON. - #' + #' @description #' Serialize Pig to JSON. #' #' @return JSON representation of the Pig. - #' @export toJSON = function() { if (!is.null(self$actual_instance)) { self$actual_instance$toJSON() @@ -138,14 +130,12 @@ Pig <- R6::R6Class( NULL } }, - #' Validate the input JSON with respect to Pig. - #' + #' @description #' Validate the input JSON with respect to Pig and #' throw exception if invalid. #' #' @param input The input JSON. - #' @export validateJSON = function(input) { # backup current values actual_instance_bak <- self$actual_instance @@ -158,13 +148,11 @@ Pig <- R6::R6Class( self$actual_instance <- actual_instance_bak self$actual_type <- actual_type_bak }, - #' Returns the string representation of the instance. - #' + #' @description #' Returns the string representation of the instance. #' #' @return The string representation of the instance. - #' @export toString = function() { jsoncontent <- c( sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()), @@ -174,12 +162,9 @@ Pig <- R6::R6Class( jsoncontent <- paste(jsoncontent, collapse = ",") as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/special.R b/samples/client/petstore/R/R/special.R index 27a23809a070..5841fc79dd39 100644 --- a/samples/client/petstore/R/R/special.R +++ b/samples/client/petstore/R/R/special.R @@ -31,8 +31,7 @@ Special <- R6::R6Class( `empty_string` = NULL, `_field_list` = c("set_test", "item_self", "item_private", "item_super", "123_number", "array[test]", "empty_string"), `additional_properties` = list(), - #' Initialize a new Special class. - #' + #' @description #' Initialize a new Special class. #' @@ -45,7 +44,6 @@ Special <- R6::R6Class( #' @param empty_string empty_string #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`set_test` = NULL, `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, additional_properties = NULL, ...) { if (!is.null(`set_test`)) { stopifnot(is.vector(`set_test`), length(`set_test`) != 0) @@ -97,13 +95,11 @@ Special <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSON = function() { SpecialObject <- list() if (!is.null(self$`set_test`)) { @@ -140,14 +136,12 @@ Special <- R6::R6Class( SpecialObject }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`set_test`)) { @@ -183,13 +177,11 @@ Special <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Special in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`set_test`)) { @@ -257,14 +249,12 @@ Special <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Special - #' + #' @description #' Deserialize JSON string into an instance of Special #' #' @param input_json the JSON input #' @return the instance of Special - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`set_test` <- ApiClient$new()$deserializeObj(this_object$`set_test`, "set[character]", loadNamespace("petstore")) @@ -286,55 +276,44 @@ Special <- R6::R6Class( self }, - #' Validate JSON input with respect to Special - #' + #' @description #' Validate JSON input with respect to Special and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Special - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index e4f4293263de..62c14ff77022 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -11,108 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ DeleteOrder } \emph{ Delete purchase order by ID } -#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -#' -#' \itemize{ -#' \item \emph{ @param } order_id character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ GetInventory } \emph{ Returns pet inventories by status } -#' Returns a map of status codes to quantities -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : map(integer) -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ GetOrderById } \emph{ Find purchase order by ID } -#' For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -#' -#' \itemize{ -#' \item \emph{ @param } order_id integer -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid ID supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | Order not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ PlaceOrder } \emph{ Place an order for a pet } -#' -#' -#' \itemize{ -#' \item \emph{ @param } order \link{Order} -#' \item \emph{ @returnType } \link{Order} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : Order -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid Order -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### DeleteOrder #################### @@ -250,13 +148,11 @@ StoreApi <- R6::R6Class( "StoreApi", public = list( api_client = NULL, - #' Initialize a new StoreApi. - #' + #' @description #' Initialize a new StoreApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -264,15 +160,14 @@ StoreApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export DeleteOrder = function(order_id, ...) { local_var_response <- self$DeleteOrderWithHttpInfo(order_id, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -285,15 +180,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Delete purchase order by ID - #' + #' @description #' Delete purchase order by ID #' #' @param order_id ID of the order that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export DeleteOrderWithHttpInfo = function(order_id, ...) { args <- list(...) query_params <- list() @@ -366,15 +260,14 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return map(integer) - #' @export GetInventory = function(data_file = NULL, ...) { local_var_response <- self$GetInventoryWithHttpInfo(data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -387,15 +280,14 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Returns pet inventories by status - #' + #' @description #' Returns pet inventories by status #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - #' @export GetInventoryWithHttpInfo = function(data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -473,16 +365,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export GetOrderById = function(order_id, data_file = NULL, ...) { local_var_response <- self$GetOrderByIdWithHttpInfo(order_id, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -495,16 +386,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Find purchase order by ID - #' + #' @description #' Find purchase order by ID #' #' @param order_id ID of pet that needs to be fetched #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export GetOrderByIdWithHttpInfo = function(order_id, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -602,16 +492,15 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return Order - #' @export PlaceOrder = function(order, data_file = NULL, ...) { local_var_response <- self$PlaceOrderWithHttpInfo(order, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -624,16 +513,15 @@ StoreApi <- R6::R6Class( local_var_response } }, - #' Place an order for a pet - #' + #' @description #' Place an order for a pet #' #' @param order order placed for purchasing the pet #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (Order) with additional information such as HTTP status code, headers - #' @export PlaceOrderWithHttpInfo = function(order, data_file = NULL, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R/R/tag.R b/samples/client/petstore/R/R/tag.R index 52079beeb09f..c9ec58ae6b82 100644 --- a/samples/client/petstore/R/R/tag.R +++ b/samples/client/petstore/R/R/tag.R @@ -21,8 +21,7 @@ Tag <- R6::R6Class( `name` = NULL, `_field_list` = c("id", "name"), `additional_properties` = list(), - #' Initialize a new Tag class. - #' + #' @description #' Initialize a new Tag class. #' @@ -30,7 +29,6 @@ Tag <- R6::R6Class( #' @param name name #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -50,13 +48,11 @@ Tag <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSON = function() { TagObject <- list() if (!is.null(self$`id`)) { @@ -73,14 +69,12 @@ Tag <- R6::R6Class( TagObject }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -98,13 +92,11 @@ Tag <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Tag in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -132,14 +124,12 @@ Tag <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Tag - #' + #' @description #' Deserialize JSON string into an instance of Tag #' #' @param input_json the JSON input #' @return the instance of Tag - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -153,53 +143,42 @@ Tag <- R6::R6Class( self }, - #' Validate JSON input with respect to Tag - #' + #' @description #' Validate JSON input with respect to Tag and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Tag - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/update_pet_request.R b/samples/client/petstore/R/R/update_pet_request.R index c29abc945abc..47369030cfac 100644 --- a/samples/client/petstore/R/R/update_pet_request.R +++ b/samples/client/petstore/R/R/update_pet_request.R @@ -21,8 +21,7 @@ UpdatePetRequest <- R6::R6Class( `binaryDataN2Information` = NULL, `_field_list` = c("jsonData", "binaryDataN2Information"), `additional_properties` = list(), - #' Initialize a new UpdatePetRequest class. - #' + #' @description #' Initialize a new UpdatePetRequest class. #' @@ -30,7 +29,6 @@ UpdatePetRequest <- R6::R6Class( #' @param binaryDataN2Information binaryDataN2Information #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...) { if (!is.null(`jsonData`)) { stopifnot(R6::is.R6(`jsonData`)) @@ -45,13 +43,11 @@ UpdatePetRequest <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSON = function() { UpdatePetRequestObject <- list() if (!is.null(self$`jsonData`)) { @@ -68,14 +64,12 @@ UpdatePetRequest <- R6::R6Class( UpdatePetRequestObject }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { @@ -95,13 +89,11 @@ UpdatePetRequest <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return UpdatePetRequest in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`jsonData`)) { @@ -129,14 +121,12 @@ UpdatePetRequest <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of UpdatePetRequest - #' + #' @description #' Deserialize JSON string into an instance of UpdatePetRequest #' #' @param input_json the JSON input #' @return the instance of UpdatePetRequest - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) @@ -150,53 +140,42 @@ UpdatePetRequest <- R6::R6Class( self }, - #' Validate JSON input with respect to UpdatePetRequest - #' + #' @description #' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of UpdatePetRequest - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/user.R b/samples/client/petstore/R/R/user.R index 533469b64229..df4396abb2ca 100644 --- a/samples/client/petstore/R/R/user.R +++ b/samples/client/petstore/R/R/user.R @@ -33,8 +33,7 @@ User <- R6::R6Class( `userStatus` = NULL, `_field_list` = c("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"), `additional_properties` = list(), - #' Initialize a new User class. - #' + #' @description #' Initialize a new User class. #' @@ -48,7 +47,6 @@ User <- R6::R6Class( #' @param userStatus User Status #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { @@ -104,13 +102,11 @@ User <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSON = function() { UserObject <- list() if (!is.null(self$`id`)) { @@ -151,14 +147,12 @@ User <- R6::R6Class( UserObject }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`id`)) { @@ -194,13 +188,11 @@ User <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return User in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`id`)) { @@ -276,14 +268,12 @@ User <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of User - #' + #' @description #' Deserialize JSON string into an instance of User #' #' @param input_json the JSON input #' @return the instance of User - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` @@ -303,53 +293,42 @@ User <- R6::R6Class( self }, - #' Validate JSON input with respect to User - #' + #' @description #' Validate JSON input with respect to User and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of User - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index e62036afca2a..265044904b01 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -11,187 +11,6 @@ #' @format An \code{R6Class} generator object #' @field api_client Handles the client-server communication. #' -#' @section Methods: -#' \describe{ -#' \strong{ CreateUser } \emph{ Create user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ CreateUsersWithArrayInput } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ CreateUsersWithListInput } \emph{ Creates list of users with given input array } -#' -#' -#' \itemize{ -#' \item \emph{ @param } user list( \link{User} ) -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ DeleteUser } \emph{ Delete user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ GetUserByName } \emph{ Get user by user name } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @returnType } \link{User} \cr -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : User -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 400 | Invalid username supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ LoginUser } \emph{ Logs user into the system } -#' -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } password character -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 200 | successful operation -#' -#' \item return type : character -#' \item response headers : -#' -#' \tabular{ll}{ -#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr -#' X-Rate-Limit \tab calls per hour allowed by the user \cr -#' X-Expires-After \tab date in UTC when token expires \cr -#' } -#' \item status code : 400 | Invalid username/password supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ LogoutUser } \emph{ Logs out current logged in user session } -#' -#' -#' \itemize{ -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 0 | successful operation -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' \strong{ UpdateUser } \emph{ Updated user } -#' This can only be done by the logged in user. -#' -#' \itemize{ -#' \item \emph{ @param } username character -#' \item \emph{ @param } user \link{User} -#' -#' \item On encountering errors, an error of subclass ApiException will be thrown. -#' -#' \item status code : 400 | Invalid user supplied -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' \item status code : 404 | User not found -#' -#' -#' \item response headers : -#' -#' \tabular{ll}{ -#' } -#' } -#' -#' } -#' -#' #' @examples #' \dontrun{ #' #################### CreateUser #################### @@ -438,13 +257,11 @@ UserApi <- R6::R6Class( "UserApi", public = list( api_client = NULL, - #' Initialize a new UserApi. - #' + #' @description #' Initialize a new UserApi. #' #' @param api_client An instance of API client. - #' @export initialize = function(api_client) { if (!missing(api_client)) { self$api_client <- api_client @@ -452,15 +269,14 @@ UserApi <- R6::R6Class( self$api_client <- ApiClient$new() } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return void - #' @export CreateUser = function(user, ...) { local_var_response <- self$CreateUserWithHttpInfo(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -473,15 +289,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Create user - #' + #' @description #' Create user #' #' @param user Created user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export CreateUserWithHttpInfo = function(user, ...) { args <- list(...) query_params <- list() @@ -560,15 +375,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export CreateUsersWithArrayInput = function(user, ...) { local_var_response <- self$CreateUsersWithArrayInputWithHttpInfo(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -581,15 +395,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export CreateUsersWithArrayInputWithHttpInfo = function(user, ...) { args <- list(...) query_params <- list() @@ -671,15 +484,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return void - #' @export CreateUsersWithListInput = function(user, ...) { local_var_response <- self$CreateUsersWithListInputWithHttpInfo(user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -692,15 +504,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Creates list of users with given input array - #' + #' @description #' Creates list of users with given input array #' #' @param user List of user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export CreateUsersWithListInputWithHttpInfo = function(user, ...) { args <- list(...) query_params <- list() @@ -782,15 +593,14 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return void - #' @export DeleteUser = function(username, ...) { local_var_response <- self$DeleteUserWithHttpInfo(username, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -803,15 +613,14 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Delete user - #' + #' @description #' Delete user #' #' @param username The name that needs to be deleted #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export DeleteUserWithHttpInfo = function(username, ...) { args <- list(...) query_params <- list() @@ -888,16 +697,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return User - #' @export GetUserByName = function(username, data_file = NULL, ...) { local_var_response <- self$GetUserByNameWithHttpInfo(username, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -910,16 +718,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Get user by user name - #' + #' @description #' Get user by user name #' #' @param username The name that needs to be fetched. Use user1 for testing. #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (User) with additional information such as HTTP status code, headers - #' @export GetUserByNameWithHttpInfo = function(username, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1005,8 +812,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1014,8 +820,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return character - #' @export LoginUser = function(username, password, data_file = NULL, ...) { local_var_response <- self$LoginUserWithHttpInfo(username, password, data_file = data_file, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1028,8 +834,7 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs user into the system - #' + #' @description #' Logs user into the system #' @@ -1037,8 +842,8 @@ UserApi <- R6::R6Class( #' @param password The password for login in clear text #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' #' @return API response (character) with additional information such as HTTP status code, headers - #' @export LoginUserWithHttpInfo = function(username, password, data_file = NULL, ...) { args <- list(...) query_params <- list() @@ -1138,14 +943,13 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return void - #' @export LogoutUser = function(...) { local_var_response <- self$LogoutUserWithHttpInfo(...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1158,14 +962,13 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Logs out current logged in user session - #' + #' @description #' Logs out current logged in user session #' #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export LogoutUserWithHttpInfo = function(...) { args <- list(...) query_params <- list() @@ -1230,16 +1033,15 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = local_var_resp)) } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return void - #' @export UpdateUser = function(username, user, ...) { local_var_response <- self$UpdateUserWithHttpInfo(username, user, ...) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { @@ -1252,16 +1054,15 @@ UserApi <- R6::R6Class( local_var_response } }, - #' Updated user - #' + #' @description #' Updated user #' #' @param username name that need to be deleted #' @param user Updated user object #' @param ... Other optional arguments + #' #' @return API response (void) with additional information such as HTTP status code, headers - #' @export UpdateUserWithHttpInfo = function(username, user, ...) { args <- list(...) query_params <- list() diff --git a/samples/client/petstore/R/R/whale.R b/samples/client/petstore/R/R/whale.R index 3305ab6ce6d7..e39211045a76 100644 --- a/samples/client/petstore/R/R/whale.R +++ b/samples/client/petstore/R/R/whale.R @@ -23,8 +23,7 @@ Whale <- R6::R6Class( `className` = NULL, `_field_list` = c("hasBaleen", "hasTeeth", "className"), `additional_properties` = list(), - #' Initialize a new Whale class. - #' + #' @description #' Initialize a new Whale class. #' @@ -33,7 +32,6 @@ Whale <- R6::R6Class( #' @param hasTeeth hasTeeth #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -59,13 +57,11 @@ Whale <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSON = function() { WhaleObject <- list() if (!is.null(self$`hasBaleen`)) { @@ -86,14 +82,12 @@ Whale <- R6::R6Class( WhaleObject }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`hasBaleen`)) { @@ -114,13 +108,11 @@ Whale <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Whale in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`hasBaleen`)) { @@ -156,14 +148,12 @@ Whale <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Whale - #' + #' @description #' Deserialize JSON string into an instance of Whale #' #' @param input_json the JSON input #' @return the instance of Whale - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`hasBaleen` <- this_object$`hasBaleen` @@ -178,13 +168,11 @@ Whale <- R6::R6Class( self }, - #' Validate JSON input with respect to Whale - #' + #' @description #' Validate JSON input with respect to Whale and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -196,23 +184,19 @@ Whale <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Whale - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -221,13 +205,11 @@ Whale <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -237,12 +219,9 @@ Whale <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self) diff --git a/samples/client/petstore/R/R/zebra.R b/samples/client/petstore/R/R/zebra.R index 122e76d20ea3..fb6d90d4d983 100644 --- a/samples/client/petstore/R/R/zebra.R +++ b/samples/client/petstore/R/R/zebra.R @@ -21,8 +21,7 @@ Zebra <- R6::R6Class( `className` = NULL, `_field_list` = c("type", "className"), `additional_properties` = list(), - #' Initialize a new Zebra class. - #' + #' @description #' Initialize a new Zebra class. #' @@ -30,7 +29,6 @@ Zebra <- R6::R6Class( #' @param type type #' @param additional_properties additional properties (optional) #' @param ... Other optional arguments. - #' @export initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { if (!(is.character(`className`) && length(`className`) == 1)) { @@ -53,13 +51,11 @@ Zebra <- R6::R6Class( } } }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSON = function() { ZebraObject <- list() if (!is.null(self$`type`)) { @@ -76,14 +72,12 @@ Zebra <- R6::R6Class( ZebraObject }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`)) { @@ -104,13 +98,11 @@ Zebra <- R6::R6Class( self }, - #' To JSON string - #' + #' @description #' To JSON String #' #' @return Zebra in JSON format - #' @export toJSONString = function() { jsoncontent <- c( if (!is.null(self$`type`)) { @@ -138,14 +130,12 @@ Zebra <- R6::R6Class( } json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) }, - #' Deserialize JSON string into an instance of Zebra - #' + #' @description #' Deserialize JSON string into an instance of Zebra #' #' @param input_json the JSON input #' @return the instance of Zebra - #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`type`) && !(this_object$`type` %in% c("plains", "mountain", "grevys"))) { @@ -162,13 +152,11 @@ Zebra <- R6::R6Class( self }, - #' Validate JSON input with respect to Zebra - #' + #' @description #' Validate JSON input with respect to Zebra and throw an exception if invalid #' #' @param input the JSON input - #' @export validateJSON = function(input) { input_json <- jsonlite::fromJSON(input) # check the required field `className` @@ -180,23 +168,19 @@ Zebra <- R6::R6Class( stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } }, - #' To string (JSON format) - #' + #' @description #' To string (JSON format) #' #' @return String representation of Zebra - #' @export toString = function() { self$toJSONString() }, - #' Return true if the values in all fields are valid. - #' + #' @description #' Return true if the values in all fields are valid. #' #' @return true if the values in all fields are valid. - #' @export isValid = function() { # check if the required `className` is null if (is.null(self$`className`)) { @@ -205,13 +189,11 @@ Zebra <- R6::R6Class( TRUE }, - #' Return a list of invalid fields (if any). - #' + #' @description #' Return a list of invalid fields (if any). #' #' @return A list of invalid fields (if any). - #' @export getInvalidFields = function() { invalid_fields <- list() # check if the required `className` is null @@ -221,12 +203,9 @@ Zebra <- R6::R6Class( invalid_fields }, - #' Print the object - #' + #' @description #' Print the object - #' - #' @export print = function() { print(jsonlite::prettify(self$toJSONString())) invisible(self)