-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[R] optionally skip parsing responses to R6 objects #22705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
14925f4
a7244cb
95f14b2
fccb78b
122acd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This follows the I opted for |
||
| 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"), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.