diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 1297561f3973..7eda7cf45ca6 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -142,10 +142,13 @@ #' @param data_file (optional) name of the data file to save the result {{/returnType}} #' @param ... Other optional arguments + {{#returnType}} + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. + {{/returnType}} #' #' @return {{{returnType}}}{{^returnType}}void{{/returnType}} - {{{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}}...) + {{{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}}...{{#returnType}}, .parse = TRUE{{/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}}...{{#returnType}}, .parse = .parse{{/returnType}}) {{#vendorExtensions.x-streaming}} if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) @@ -179,9 +182,12 @@ #' @param data_file (optional) name of the data file to save the result {{/returnType}} #' @param ... Other optional arguments + {{#returnType}} + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. + {{/returnType}} #' #' @return API response ({{{returnType}}}{{^returnType}}void{{/returnType}}) with additional information such as HTTP status code, headers - {{{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}}...) { + {{{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}}...{{#returnType}}, .parse = TRUE{{/returnType}}) { args <- list(...) query_params <- list() header_params <- c() @@ -560,6 +566,10 @@ if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } ApiResponse$new(content,resp) {{/isPrimitiveType}} @@ -568,6 +578,10 @@ if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "{{returnType}}"), diff --git a/samples/client/echo_api/r/R/auth_api.R b/samples/client/echo_api/r/R/auth_api.R index 8b2999b3758e..4b617b97a61c 100644 --- a/samples/client/echo_api/r/R/auth_api.R +++ b/samples/client/echo_api/r/R/auth_api.R @@ -73,10 +73,11 @@ AuthApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestAuthHttpBasic = function(data_file = NULL, ...) { - local_var_response <- self$TestAuthHttpBasicWithHttpInfo(data_file = data_file, ...) + TestAuthHttpBasic = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestAuthHttpBasicWithHttpInfo(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -93,9 +94,10 @@ AuthApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestAuthHttpBasicWithHttpInfo = function(data_file = NULL, ...) { + TestAuthHttpBasicWithHttpInfo = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -135,6 +137,10 @@ AuthApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -164,10 +170,11 @@ AuthApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestAuthHttpBearer = function(data_file = NULL, ...) { - local_var_response <- self$TestAuthHttpBearerWithHttpInfo(data_file = data_file, ...) + TestAuthHttpBearer = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestAuthHttpBearerWithHttpInfo(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -184,9 +191,10 @@ AuthApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestAuthHttpBearerWithHttpInfo = function(data_file = NULL, ...) { + TestAuthHttpBearerWithHttpInfo = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -226,6 +234,10 @@ AuthApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/echo_api/r/R/body_api.R b/samples/client/echo_api/r/R/body_api.R index e9213e0dc94f..2b6cee8e51ff 100644 --- a/samples/client/echo_api/r/R/body_api.R +++ b/samples/client/echo_api/r/R/body_api.R @@ -179,10 +179,11 @@ BodyApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return data.frame - TestBinaryGif = function(data_file = NULL, ...) { - local_var_response <- self$TestBinaryGifWithHttpInfo(data_file = data_file, ...) + TestBinaryGif = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestBinaryGifWithHttpInfo(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -199,9 +200,10 @@ BodyApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (data.frame) with additional information such as HTTP status code, headers - TestBinaryGifWithHttpInfo = function(data_file = NULL, ...) { + TestBinaryGifWithHttpInfo = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -237,6 +239,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "data.frame"), @@ -267,10 +273,11 @@ BodyApi <- R6::R6Class( #' @param body (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestBodyApplicationOctetstreamBinary = function(body = NULL, data_file = NULL, ...) { - local_var_response <- self$TestBodyApplicationOctetstreamBinaryWithHttpInfo(body, data_file = data_file, ...) + TestBodyApplicationOctetstreamBinary = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestBodyApplicationOctetstreamBinaryWithHttpInfo(body, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -288,9 +295,10 @@ BodyApi <- R6::R6Class( #' @param body (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestBodyApplicationOctetstreamBinaryWithHttpInfo = function(body = NULL, data_file = NULL, ...) { + TestBodyApplicationOctetstreamBinaryWithHttpInfo = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -336,6 +344,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -366,10 +378,11 @@ BodyApi <- R6::R6Class( #' @param files #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestBodyMultipartFormdataArrayOfBinary = function(files, data_file = NULL, ...) { - local_var_response <- self$TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files, data_file = data_file, ...) + TestBodyMultipartFormdataArrayOfBinary = function(files, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -387,9 +400,10 @@ BodyApi <- R6::R6Class( #' @param files #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo = function(files, data_file = NULL, ...) { + TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo = function(files, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -434,6 +448,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -464,10 +482,11 @@ BodyApi <- R6::R6Class( #' @param my_file (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestBodyMultipartFormdataSingleBinary = function(my_file = NULL, data_file = NULL, ...) { - local_var_response <- self$TestBodyMultipartFormdataSingleBinaryWithHttpInfo(my_file, data_file = data_file, ...) + TestBodyMultipartFormdataSingleBinary = function(my_file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestBodyMultipartFormdataSingleBinaryWithHttpInfo(my_file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -485,9 +504,10 @@ BodyApi <- R6::R6Class( #' @param my_file (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestBodyMultipartFormdataSingleBinaryWithHttpInfo = function(my_file = NULL, data_file = NULL, ...) { + TestBodyMultipartFormdataSingleBinaryWithHttpInfo = function(my_file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -528,6 +548,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -558,10 +582,11 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - TestEchoBodyAllOfPet = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyAllOfPetWithHttpInfo(pet, data_file = data_file, ...) + TestEchoBodyAllOfPet = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyAllOfPetWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -579,9 +604,10 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - TestEchoBodyAllOfPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { + TestEchoBodyAllOfPetWithHttpInfo = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -627,6 +653,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -657,10 +687,11 @@ BodyApi <- R6::R6Class( #' @param body (optional) Free form object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestEchoBodyFreeFormObjectResponseString = function(body = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyFreeFormObjectResponseStringWithHttpInfo(body, data_file = data_file, ...) + TestEchoBodyFreeFormObjectResponseString = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyFreeFormObjectResponseStringWithHttpInfo(body, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -678,9 +709,10 @@ BodyApi <- R6::R6Class( #' @param body (optional) Free form object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestEchoBodyFreeFormObjectResponseStringWithHttpInfo = function(body = NULL, data_file = NULL, ...) { + TestEchoBodyFreeFormObjectResponseStringWithHttpInfo = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -726,6 +758,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -756,10 +792,11 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - TestEchoBodyPet = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyPetWithHttpInfo(pet, data_file = data_file, ...) + TestEchoBodyPet = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyPetWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -777,9 +814,10 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - TestEchoBodyPetWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { + TestEchoBodyPetWithHttpInfo = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -825,6 +863,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -855,10 +897,11 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestEchoBodyPetResponseString = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyPetResponseStringWithHttpInfo(pet, data_file = data_file, ...) + TestEchoBodyPetResponseString = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyPetResponseStringWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -876,9 +919,10 @@ BodyApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestEchoBodyPetResponseStringWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { + TestEchoBodyPetResponseStringWithHttpInfo = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -924,6 +968,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -954,10 +1002,11 @@ BodyApi <- R6::R6Class( #' @param body (optional) String enum #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return StringEnumRef - TestEchoBodyStringEnum = function(body = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyStringEnumWithHttpInfo(body, data_file = data_file, ...) + TestEchoBodyStringEnum = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyStringEnumWithHttpInfo(body, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -975,9 +1024,10 @@ BodyApi <- R6::R6Class( #' @param body (optional) String enum #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (StringEnumRef) with additional information such as HTTP status code, headers - TestEchoBodyStringEnumWithHttpInfo = function(body = NULL, data_file = NULL, ...) { + TestEchoBodyStringEnumWithHttpInfo = function(body = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1023,6 +1073,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "StringEnumRef"), @@ -1053,10 +1107,11 @@ BodyApi <- R6::R6Class( #' @param tag (optional) Tag object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestEchoBodyTagResponseString = function(tag = NULL, data_file = NULL, ...) { - local_var_response <- self$TestEchoBodyTagResponseStringWithHttpInfo(tag, data_file = data_file, ...) + TestEchoBodyTagResponseString = function(tag = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEchoBodyTagResponseStringWithHttpInfo(tag, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1074,9 +1129,10 @@ BodyApi <- R6::R6Class( #' @param tag (optional) Tag object #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestEchoBodyTagResponseStringWithHttpInfo = function(tag = NULL, data_file = NULL, ...) { + TestEchoBodyTagResponseStringWithHttpInfo = function(tag = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1122,6 +1178,10 @@ BodyApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/echo_api/r/R/form_api.R b/samples/client/echo_api/r/R/form_api.R index 1278ba0b2ade..1c996610c9d8 100644 --- a/samples/client/echo_api/r/R/form_api.R +++ b/samples/client/echo_api/r/R/form_api.R @@ -92,10 +92,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestFormIntegerBooleanString = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestFormIntegerBooleanStringWithHttpInfo(integer_form, boolean_form, string_form, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -115,9 +116,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestFormIntegerBooleanStringWithHttpInfo = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ...) { + TestFormIntegerBooleanStringWithHttpInfo = function(integer_form = NULL, boolean_form = NULL, string_form = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -168,6 +170,10 @@ FormApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -198,10 +204,11 @@ FormApi <- R6::R6Class( #' @param marker #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestFormObjectMultipart = function(marker, data_file = NULL, ...) { - local_var_response <- self$TestFormObjectMultipartWithHttpInfo(marker, data_file = data_file, ...) + TestFormObjectMultipart = function(marker, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestFormObjectMultipartWithHttpInfo(marker, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -219,9 +226,10 @@ FormApi <- R6::R6Class( #' @param marker #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestFormObjectMultipartWithHttpInfo = function(marker, data_file = NULL, ...) { + TestFormObjectMultipartWithHttpInfo = function(marker, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -266,6 +274,10 @@ FormApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -301,10 +313,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestFormOneof = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestFormOneofWithHttpInfo(form1, form2, form3, form4, id, name, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -327,9 +340,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestFormOneofWithHttpInfo = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ...) { + TestFormOneofWithHttpInfo = function(form1 = NULL, form2 = NULL, form3 = NULL, form4 = NULL, id = NULL, name = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -395,6 +409,10 @@ FormApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/echo_api/r/R/header_api.R b/samples/client/echo_api/r/R/header_api.R index 21280ce6b645..b2513c58a595 100644 --- a/samples/client/echo_api/r/R/header_api.R +++ b/samples/client/echo_api/r/R/header_api.R @@ -63,10 +63,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestHeaderIntegerBooleanStringEnums = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestHeaderIntegerBooleanStringEnumsWithHttpInfo(integer_header, boolean_header, string_header, enum_nonref_string_header, enum_ref_string_header, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -88,9 +89,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestHeaderIntegerBooleanStringEnumsWithHttpInfo = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ...) { + TestHeaderIntegerBooleanStringEnumsWithHttpInfo = function(integer_header = NULL, boolean_header = NULL, string_header = NULL, enum_nonref_string_header = NULL, enum_ref_string_header = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -156,6 +158,10 @@ HeaderApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/echo_api/r/R/path_api.R b/samples/client/echo_api/r/R/path_api.R index afe0a36107d0..1db17b398d77 100644 --- a/samples/client/echo_api/r/R/path_api.R +++ b/samples/client/echo_api/r/R/path_api.R @@ -61,10 +61,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -85,9 +86,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ...) { + TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo = function(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -171,6 +173,10 @@ PathApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/echo_api/r/R/query_api.R b/samples/client/echo_api/r/R/query_api.R index 7afbf45a2908..b6a809770701 100644 --- a/samples/client/echo_api/r/R/query_api.R +++ b/samples/client/echo_api/r/R/query_api.R @@ -202,10 +202,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestEnumRefString = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestEnumRefStringWithHttpInfo(enum_nonref_string_query, enum_ref_string_query, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -224,9 +225,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestEnumRefStringWithHttpInfo = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ...) { + TestEnumRefStringWithHttpInfo = function(enum_nonref_string_query = NULL, enum_ref_string_query = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -277,6 +279,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -309,10 +315,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestQueryDatetimeDateString = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryDatetimeDateStringWithHttpInfo(datetime_query, date_query, string_query, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -332,9 +339,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryDatetimeDateStringWithHttpInfo = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ...) { + TestQueryDatetimeDateStringWithHttpInfo = function(datetime_query = NULL, date_query = NULL, string_query = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -388,6 +396,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -420,10 +432,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - 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, ...) + TestQueryIntegerBooleanString = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryIntegerBooleanStringWithHttpInfo(integer_query, boolean_query, string_query, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -443,9 +456,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryIntegerBooleanStringWithHttpInfo = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ...) { + TestQueryIntegerBooleanStringWithHttpInfo = function(integer_query = NULL, boolean_query = NULL, string_query = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -499,6 +513,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -529,10 +547,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleDeepObjectExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleDeepObjectExplodeTrueObject = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -550,9 +569,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -594,6 +614,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -624,10 +648,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleDeepObjectExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleDeepObjectExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -645,9 +670,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -689,6 +715,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -719,10 +749,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleFormExplodeFalseArrayInteger = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleFormExplodeFalseArrayInteger = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -740,9 +771,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -785,6 +817,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -815,10 +851,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleFormExplodeFalseArrayString = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleFormExplodeFalseArrayString = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -836,9 +873,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -881,6 +919,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -911,10 +953,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleFormExplodeTrueArrayString = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleFormExplodeTrueArrayString = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -932,9 +975,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleFormExplodeTrueArrayStringWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -976,6 +1020,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -1006,10 +1054,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleFormExplodeTrueObject = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleFormExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleFormExplodeTrueObject = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleFormExplodeTrueObjectWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1027,9 +1076,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleFormExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleFormExplodeTrueObjectWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1071,6 +1121,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -1101,10 +1155,11 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleFormExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ...) + TestQueryStyleFormExplodeTrueObjectAllOf = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(query_object, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1122,9 +1177,10 @@ QueryApi <- R6::R6Class( #' @param query_object (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ...) { + TestQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo = function(query_object = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1166,6 +1222,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), @@ -1197,10 +1257,11 @@ QueryApi <- R6::R6Class( #' @param json_serialized_object_array_ref_string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - TestQueryStyleJsonSerializationObject = function(json_serialized_object_ref_string_query = NULL, json_serialized_object_array_ref_string_query = NULL, data_file = NULL, ...) { - local_var_response <- self$TestQueryStyleJsonSerializationObjectWithHttpInfo(json_serialized_object_ref_string_query, json_serialized_object_array_ref_string_query, data_file = data_file, ...) + TestQueryStyleJsonSerializationObject = function(json_serialized_object_ref_string_query = NULL, json_serialized_object_array_ref_string_query = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestQueryStyleJsonSerializationObjectWithHttpInfo(json_serialized_object_ref_string_query, json_serialized_object_array_ref_string_query, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1219,9 +1280,10 @@ QueryApi <- R6::R6Class( #' @param json_serialized_object_array_ref_string_query (optional) No description #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - TestQueryStyleJsonSerializationObjectWithHttpInfo = function(json_serialized_object_ref_string_query = NULL, json_serialized_object_array_ref_string_query = NULL, data_file = NULL, ...) { + TestQueryStyleJsonSerializationObjectWithHttpInfo = function(json_serialized_object_ref_string_query = NULL, json_serialized_object_array_ref_string_query = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1270,6 +1332,10 @@ QueryApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), 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 9210f42424b2..a6c55eae5c34 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R @@ -188,10 +188,11 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - add_pet_optional = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...) + add_pet_optional = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -209,9 +210,10 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) { + add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -264,6 +266,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -310,10 +316,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - 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, ...) + fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -332,9 +339,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) { + fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -395,6 +403,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), 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 83b4a7141c28..5a1b52fdbb79 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -391,10 +391,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - add_pet = function(pet, data_file = NULL, ...) { - local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...) + add_pet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -412,9 +413,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - add_pet_with_http_info = function(pet, data_file = NULL, ...) { + add_pet_with_http_info = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -474,6 +476,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -640,10 +646,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - 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, ...) + find_pets_by_status = function(status, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -661,9 +668,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) { + find_pets_by_status_with_http_info = function(status, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -728,6 +736,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -773,10 +785,11 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - 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, ...) + find_pets_by_tags = function(tags, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -794,9 +807,10 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) { + find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -849,6 +863,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -894,10 +912,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + get_pet_by_id = function(pet_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -915,9 +934,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) { + get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -975,6 +995,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1021,10 +1045,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1047,9 +1072,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { + get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1112,6 +1138,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1158,10 +1188,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1184,9 +1215,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { + test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1247,6 +1279,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1292,10 +1328,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - update_pet = function(pet, data_file = NULL, ...) { - local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...) + update_pet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1313,9 +1350,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - update_pet_with_http_info = function(pet, data_file = NULL, ...) { + update_pet_with_http_info = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1374,6 +1412,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1548,10 +1590,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return ModelApiResponse - 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, ...) + upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1571,9 +1614,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { + upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1646,6 +1690,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "ModelApiResponse"), 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 1ea684f97270..4f2be31cddaf 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/store_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/store_api.R @@ -273,10 +273,11 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return map(integer) - get_inventory = function(data_file = NULL, ...) { - local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...) + get_inventory = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -293,9 +294,10 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - get_inventory_with_http_info = function(data_file = NULL, ...) { + get_inventory_with_http_info = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -335,6 +337,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "map(integer)"), @@ -380,10 +386,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - 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, ...) + get_order_by_id = function(order_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -401,9 +408,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) { + get_order_by_id_with_http_info = function(order_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -469,6 +477,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), @@ -514,10 +526,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - place_order = function(order, data_file = NULL, ...) { - local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...) + place_order = function(order, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -535,9 +548,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - place_order_with_http_info = function(order, data_file = NULL, ...) { + place_order_with_http_info = function(order, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -593,6 +607,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), 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 5b56f8ae3677..8775a7e93d16 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user_api.R @@ -732,10 +732,11 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - 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, ...) + get_user_by_name = function(username, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -753,9 +754,10 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - get_user_by_name_with_http_info = function(username, data_file = NULL, ...) { + get_user_by_name_with_http_info = function(username, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -809,6 +811,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), @@ -855,10 +861,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - login_user = function(username, password, data_file = NULL, ...) { - local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...) + login_user = function(username, password, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -877,9 +884,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - login_user_with_http_info = function(username, password, data_file = NULL, ...) { + login_user_with_http_info = function(username, password, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -953,6 +961,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 664ffceb021e..b7490f684c9c 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -188,10 +188,11 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - add_pet_optional = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ...) + add_pet_optional = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$add_pet_optional_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -209,9 +210,10 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ...) { + add_pet_optional_with_http_info = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -264,6 +266,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -310,10 +316,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - 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, ...) + fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -332,9 +339,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) { + fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -395,6 +403,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index b60f15378597..30c3caa7b8bc 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -391,10 +391,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - add_pet = function(pet, data_file = NULL, ...) { - local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ...) + add_pet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$add_pet_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -412,9 +413,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - add_pet_with_http_info = function(pet, data_file = NULL, ...) { + add_pet_with_http_info = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -474,6 +476,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -640,10 +646,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - 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, ...) + find_pets_by_status = function(status, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$find_pets_by_status_with_http_info(status, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -661,9 +668,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) { + find_pets_by_status_with_http_info = function(status, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -728,6 +736,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -773,10 +785,11 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - 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, ...) + find_pets_by_tags = function(tags, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$find_pets_by_tags_with_http_info(tags, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -794,9 +807,10 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) { + find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -849,6 +863,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -894,10 +912,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + get_pet_by_id = function(pet_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_pet_by_id_with_http_info(pet_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -915,9 +934,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) { + get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -975,6 +995,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1021,10 +1045,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + get_pet_by_id_streaming = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_pet_by_id_streaming_with_http_info(pet_id, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1047,9 +1072,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { + get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1112,6 +1138,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1158,10 +1188,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + test_header = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$test_header_with_http_info(header_test_int, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1184,9 +1215,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { + test_header_with_http_info = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1247,6 +1279,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1292,10 +1328,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - update_pet = function(pet, data_file = NULL, ...) { - local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ...) + update_pet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$update_pet_with_http_info(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1313,9 +1350,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - update_pet_with_http_info = function(pet, data_file = NULL, ...) { + update_pet_with_http_info = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1374,6 +1412,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1548,10 +1590,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return ModelApiResponse - 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, ...) + upload_file = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$upload_file_with_http_info(pet_id, additional_metadata, file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1571,9 +1614,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { + upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1646,6 +1690,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "ModelApiResponse"), diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index ec454c8d78cc..f2302e76dc5c 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -273,10 +273,11 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return map(integer) - get_inventory = function(data_file = NULL, ...) { - local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...) + get_inventory = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -293,9 +294,10 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - get_inventory_with_http_info = function(data_file = NULL, ...) { + get_inventory_with_http_info = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -335,6 +337,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "map(integer)"), @@ -380,10 +386,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - 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, ...) + get_order_by_id = function(order_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -401,9 +408,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) { + get_order_by_id_with_http_info = function(order_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -469,6 +477,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), @@ -514,10 +526,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - place_order = function(order, data_file = NULL, ...) { - local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...) + place_order = function(order, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -535,9 +548,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - place_order_with_http_info = function(order, data_file = NULL, ...) { + place_order_with_http_info = function(order, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -593,6 +607,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index 242077c4b1e3..9800d222af60 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -732,10 +732,11 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - 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, ...) + get_user_by_name = function(username, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$get_user_by_name_with_http_info(username, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -753,9 +754,10 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - get_user_by_name_with_http_info = function(username, data_file = NULL, ...) { + get_user_by_name_with_http_info = function(username, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -809,6 +811,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), @@ -855,10 +861,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - login_user = function(username, password, data_file = NULL, ...) { - local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ...) + login_user = function(username, password, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$login_user_with_http_info(username, password, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -877,9 +884,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - login_user_with_http_info = function(username, password, data_file = NULL, ...) { + login_user_with_http_info = function(username, password, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -953,6 +961,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"), diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index c113579eb032..28740ac72a1c 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -188,10 +188,11 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - AddPetOptional = function(pet = NULL, data_file = NULL, ...) { - local_var_response <- self$AddPetOptionalWithHttpInfo(pet, data_file = data_file, ...) + AddPetOptional = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$AddPetOptionalWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -209,9 +210,10 @@ FakeApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - AddPetOptionalWithHttpInfo = function(pet = NULL, data_file = NULL, ...) { + AddPetOptionalWithHttpInfo = function(pet = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -264,6 +266,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -310,10 +316,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - FakeDataFile = function(dummy, var_data_file = NULL, data_file = NULL, ...) { - local_var_response <- self$FakeDataFileWithHttpInfo(dummy, var_data_file, data_file = data_file, ...) + FakeDataFile = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$FakeDataFileWithHttpInfo(dummy, var_data_file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -332,9 +339,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - FakeDataFileWithHttpInfo = function(dummy, var_data_file = NULL, data_file = NULL, ...) { + FakeDataFileWithHttpInfo = function(dummy, var_data_file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -395,6 +403,10 @@ FakeApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 40cfdabc2271..7cae9084e852 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -391,10 +391,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - AddPet = function(pet, data_file = NULL, ...) { - local_var_response <- self$AddPetWithHttpInfo(pet, data_file = data_file, ...) + AddPet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$AddPetWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -412,9 +413,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - AddPetWithHttpInfo = function(pet, data_file = NULL, ...) { + AddPetWithHttpInfo = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -474,6 +476,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -640,10 +646,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - FindPetsByStatus = function(status, data_file = NULL, ...) { - local_var_response <- self$FindPetsByStatusWithHttpInfo(status, data_file = data_file, ...) + FindPetsByStatus = function(status, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$FindPetsByStatusWithHttpInfo(status, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -661,9 +668,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - FindPetsByStatusWithHttpInfo = function(status, data_file = NULL, ...) { + FindPetsByStatusWithHttpInfo = function(status, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -728,6 +736,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -773,10 +785,11 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return array[Pet] - FindPetsByTags = function(tags, data_file = NULL, ...) { - local_var_response <- self$FindPetsByTagsWithHttpInfo(tags, data_file = data_file, ...) + FindPetsByTags = function(tags, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$FindPetsByTagsWithHttpInfo(tags, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -794,9 +807,10 @@ PetApi <- R6::R6Class( #' @param tags Tags to filter by #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (array[Pet]) with additional information such as HTTP status code, headers - FindPetsByTagsWithHttpInfo = function(tags, data_file = NULL, ...) { + FindPetsByTagsWithHttpInfo = function(tags, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -849,6 +863,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "array[Pet]"), @@ -894,10 +912,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - GetPetById = function(pet_id, data_file = NULL, ...) { - local_var_response <- self$GetPetByIdWithHttpInfo(pet_id, data_file = data_file, ...) + GetPetById = function(pet_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$GetPetByIdWithHttpInfo(pet_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -915,9 +934,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - GetPetByIdWithHttpInfo = function(pet_id, data_file = NULL, ...) { + GetPetByIdWithHttpInfo = function(pet_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -975,6 +995,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1021,10 +1045,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + GetPetByIdStreaming = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$GetPetByIdStreamingWithHttpInfo(pet_id, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1047,9 +1072,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { + GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1112,6 +1138,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1158,10 +1188,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - 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, ...) + TestHeader = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$TestHeaderWithHttpInfo(header_test_int, stream_callback = stream_callback, data_file = data_file, ..., .parse = .parse) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) } @@ -1184,9 +1215,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - TestHeaderWithHttpInfo = function(header_test_int, stream_callback = NULL, data_file = NULL, ...) { + TestHeaderWithHttpInfo = function(header_test_int, stream_callback = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1247,6 +1279,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1292,10 +1328,11 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Pet - UpdatePet = function(pet, data_file = NULL, ...) { - local_var_response <- self$UpdatePetWithHttpInfo(pet, data_file = data_file, ...) + UpdatePet = function(pet, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$UpdatePetWithHttpInfo(pet, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1313,9 +1350,10 @@ PetApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Pet) with additional information such as HTTP status code, headers - UpdatePetWithHttpInfo = function(pet, data_file = NULL, ...) { + UpdatePetWithHttpInfo = function(pet, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1374,6 +1412,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Pet"), @@ -1548,10 +1590,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return ModelApiResponse - 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, ...) + UploadFile = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$UploadFileWithHttpInfo(pet_id, additional_metadata, file, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -1571,9 +1614,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers - UploadFileWithHttpInfo = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { + UploadFileWithHttpInfo = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -1646,6 +1690,10 @@ PetApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "ModelApiResponse"), diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index ebb1fde28a4f..1f9d3b76b3a5 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -273,10 +273,11 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return map(integer) - GetInventory = function(data_file = NULL, ...) { - local_var_response <- self$GetInventoryWithHttpInfo(data_file = data_file, ...) + GetInventory = function(data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$GetInventoryWithHttpInfo(data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -293,9 +294,10 @@ StoreApi <- R6::R6Class( #' #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (map(integer)) with additional information such as HTTP status code, headers - GetInventoryWithHttpInfo = function(data_file = NULL, ...) { + GetInventoryWithHttpInfo = function(data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -335,6 +337,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "map(integer)"), @@ -380,10 +386,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - GetOrderById = function(order_id, data_file = NULL, ...) { - local_var_response <- self$GetOrderByIdWithHttpInfo(order_id, data_file = data_file, ...) + GetOrderById = function(order_id, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$GetOrderByIdWithHttpInfo(order_id, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -401,9 +408,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - GetOrderByIdWithHttpInfo = function(order_id, data_file = NULL, ...) { + GetOrderByIdWithHttpInfo = function(order_id, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -469,6 +477,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), @@ -514,10 +526,11 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return Order - PlaceOrder = function(order, data_file = NULL, ...) { - local_var_response <- self$PlaceOrderWithHttpInfo(order, data_file = data_file, ...) + PlaceOrder = function(order, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$PlaceOrderWithHttpInfo(order, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -535,9 +548,10 @@ StoreApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (Order) with additional information such as HTTP status code, headers - PlaceOrderWithHttpInfo = function(order, data_file = NULL, ...) { + PlaceOrderWithHttpInfo = function(order, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -593,6 +607,10 @@ StoreApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "Order"), diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index ca366d7eb130..f211ae688dcd 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -732,10 +732,11 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return User - GetUserByName = function(username, data_file = NULL, ...) { - local_var_response <- self$GetUserByNameWithHttpInfo(username, data_file = data_file, ...) + GetUserByName = function(username, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$GetUserByNameWithHttpInfo(username, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -753,9 +754,10 @@ UserApi <- R6::R6Class( #' @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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (User) with additional information such as HTTP status code, headers - GetUserByNameWithHttpInfo = function(username, data_file = NULL, ...) { + GetUserByNameWithHttpInfo = function(username, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -809,6 +811,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "User"), @@ -855,10 +861,11 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return character - LoginUser = function(username, password, data_file = NULL, ...) { - local_var_response <- self$LoginUserWithHttpInfo(username, password, data_file = data_file, ...) + LoginUser = function(username, password, data_file = NULL, ..., .parse = TRUE) { + local_var_response <- self$LoginUserWithHttpInfo(username, password, data_file = data_file, ..., .parse = .parse) if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) { return(local_var_response$content) } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) { @@ -877,9 +884,10 @@ 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 + #' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text. #' #' @return API response (character) with additional information such as HTTP status code, headers - LoginUserWithHttpInfo = function(username, password, data_file = NULL, ...) { + LoginUserWithHttpInfo = function(username, password, data_file = NULL, ..., .parse = TRUE) { args <- list(...) query_params <- list() header_params <- c() @@ -953,6 +961,10 @@ UserApi <- R6::R6Class( if (!is.null(data_file)) { self$api_client$WriteFile(local_var_resp, data_file) } + if (!.parse) { + local_var_resp$content <- local_var_resp$response_as_text() + return(local_var_resp) + } deserialized_resp_obj <- tryCatch( self$api_client$DeserializeResponse(local_var_resp, "character"),