forked from loafle/openapi-generator-original
@@ -2,7 +2,7 @@
|
||||
{{#operations}}
|
||||
#' @docType class
|
||||
#' @title {{baseName}} operations
|
||||
#' @description {{importPath}}
|
||||
#' @description {{{description}}}
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -62,14 +62,14 @@
|
||||
{{/useRlangExceptionHandling}}
|
||||
#'
|
||||
{{#responses}}
|
||||
#' \item status code : {{code}} | {{message}}
|
||||
#' \item status code : {{code}} | {{{message}}}
|
||||
#'
|
||||
#'{{#dataType}} \item return type : {{.}}{{/dataType}}
|
||||
#'{{#dataType}} \item return type : {{{.}}}{{/dataType}}
|
||||
#' \item response headers :
|
||||
#'
|
||||
#' \tabular{ll}{
|
||||
{{#headers}}
|
||||
#' {{name}} \tab {{description}} \cr
|
||||
#' {{name}} \tab {{{description}}} \cr
|
||||
{{/headers}}
|
||||
#' }
|
||||
{{/responses}}
|
||||
@@ -86,63 +86,90 @@
|
||||
#'
|
||||
#' library({{{packageName}}})
|
||||
{{#allParams}}
|
||||
#' var.{{{paramName}}} <- {{{example}}} # {{{dataType}}} | {{{description}}}
|
||||
#' var_{{{paramName}}} <- {{{example}}} # {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
#'
|
||||
{{#summary}}
|
||||
#' #{{{.}}}
|
||||
{{/summary}}
|
||||
#' api.instance <- {{{classname}}}$new()
|
||||
{{#generateWrapper}}
|
||||
#' api_instance <- {{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api$new()
|
||||
{{/generateWrapper}}
|
||||
{{^generateWrapper}}
|
||||
#' api_instance <- {{{classname}}}$new()
|
||||
{{/generateWrapper}}
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
#'
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
#' #Configure HTTP basic authorization: {{{name}}}
|
||||
#' # provide the username
|
||||
#' api.instance$api_client$username <- 'TODO_YOUR_USERNAME';
|
||||
#' # provide the password
|
||||
#' api.instance$api_client$password <- 'TODO_YOUR_PASSWORD';
|
||||
#' # Configure HTTP basic authorization: {{{name}}}
|
||||
#' api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||
#' api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
#' #Configure HTTP bearer authorization: {{{name}}}
|
||||
#' api.instance$api_client$bearer_token <- 'TODO_YOUR_BEARER_TOKEN';
|
||||
#' # Configure HTTP bearer authorization: {{{name}}}
|
||||
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
#' #Configure API key authorization: {{{name}}}
|
||||
#' api.instance$api_client$api_keys['{{{keyParamName}}}'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: {{{name}}}
|
||||
#' api_instance$api_client$api_keys["{{{keyParamName}}}"] <- Sys.getenv("API_KEY")
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
#' # Configure OAuth2 access token for authorization: {{{name}}}
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
{{/hasAuthMethods}}
|
||||
#'
|
||||
{{#returnExceptionOnFailure}}
|
||||
{{#useRlangExceptionHandling}}
|
||||
#'result <- tryCatch(
|
||||
#' api.instance${{{operationId}}}({{#requiredParams}}var.{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}}=var.{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#' {{#returnType}}
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}data_file = "result.txt"),
|
||||
#' {{#vendorExtensions.x-streaming}}
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) }),
|
||||
#' {{/vendorExtensions.x-streaming}}
|
||||
#' {{/returnType}}
|
||||
#' api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
{{#returnType}}
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
{{/returnType}}
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `{{{operationId}}}`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#' {{#errorObjectType}}
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#' {{/errorObjectType}}
|
||||
#' }{{#returnType}} else {
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
{{/returnType}}
|
||||
#'
|
||||
{{^returnType}}
|
||||
#' # This endpoint doesn't return data
|
||||
{{/returnType}}
|
||||
{{/useRlangExceptionHandling}}
|
||||
{{/returnExceptionOnFailure}}
|
||||
{{^useRlangExceptionHandling}}
|
||||
#' result <- api.instance${{{operationId}}}({{#requiredParams}}var.{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}}=var.{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
||||
{{#returnType}}
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # result <- api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}data_file = "result.txt")
|
||||
{{/returnType}}
|
||||
{{#vendorExtensions.x-streaming}}
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) })
|
||||
{{/vendorExtensions.x-streaming}}
|
||||
#' {{#returnType}}result <- {{/returnType}}api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
||||
{{#returnType}}
|
||||
#' dput(result)
|
||||
{{/returnType}}
|
||||
{{/useRlangExceptionHandling}}
|
||||
#'
|
||||
#'
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{{>partial_header}}
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#' Create a new {{{classname}}}
|
||||
#'
|
||||
#' @description
|
||||
#' {{{description}}}{{^description}}{{classname}} Class{{/description}}
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title {{classname}}
|
||||
#' @description {{classname}} Class
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new AllofTagApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' AllofTagApiResponse Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AllofTagApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Animal
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Animal Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Animal
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPig
|
||||
#'
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new BasquePig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' BasquePig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title BasquePig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Cat
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Cat Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Cat
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new CatAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' CatAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title CatAllOf
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Category
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A category for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Category
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DanishPig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DanishPig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DanishPig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Dog
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Dog Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Dog
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DogAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DogAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DogAllOf
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Fake operations
|
||||
#' @description petstore.Fake
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -57,50 +57,60 @@
|
||||
#' #################### fake_data_file ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var.var_data_file <- "var_data_file_example" # character | header data file
|
||||
#' var_dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var_var_data_file <- "var_data_file_example" # character | header data file
|
||||
#'
|
||||
#' #test data_file to ensure it's escaped correctly
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$fake_data_file(var.dummy, var_data_file=var.var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$fake_api$fake_data_file(var_dummy, var_data_file = var_var_data_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$fake_api$fake_data_file(var_dummy, var_data_file = var_var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `fake_data_file`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### fake_regular_expression ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#' var_reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#'
|
||||
#' #test regular expression to ensure no exception
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$fake_regular_expression(var.reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$fake_api$fake_regular_expression(var_reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `fake_regular_expression`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new ModelApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title ModelApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new NestedOneOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' NestedOneOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title NestedOneOf
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Order
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' An order for a pets from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Order
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Pet
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A pet for sale in the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet operations
|
||||
#' @description petstore.Pet
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -288,284 +288,356 @@
|
||||
#' #################### add_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Add a new pet to the store
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure HTTP basic authorization: http_auth
|
||||
#' # provide the username
|
||||
#' api.instance$api_client$username <- 'TODO_YOUR_USERNAME';
|
||||
#' # provide the password
|
||||
#' api.instance$api_client$password <- 'TODO_YOUR_PASSWORD';
|
||||
#' # Configure HTTP basic authorization: http_auth
|
||||
#' api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||
#' api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$add_pet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$add_pet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$add_pet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `add_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### delete_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | Pet id to delete
|
||||
#' var.api_key <- "api_key_example" # character |
|
||||
#' var_pet_id <- 56 # integer | Pet id to delete
|
||||
#' var_api_key <- "api_key_example" # character |
|
||||
#'
|
||||
#' #Deletes a pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_pet(var.pet_id, api_key=var.api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$pet_api$delete_pet(var_pet_id, api_key = var_api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### find_pets_by_status ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#'
|
||||
#' #Finds Pets by status
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$find_pets_by_status(var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$find_pets_by_status(var_status, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$find_pets_by_status(var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `find_pets_by_status`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### find_pets_by_tags ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#'
|
||||
#' #Finds Pets by tags
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$find_pets_by_tags(var.tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$find_pets_by_tags(var_tags, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$find_pets_by_tags(var_tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `find_pets_by_tags`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_pet_by_id ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure HTTP bearer authorization: BearerToken
|
||||
#' api.instance$api_client$bearer_token <- 'TODO_YOUR_BEARER_TOKEN';
|
||||
#' # Configure HTTP bearer authorization: BearerToken
|
||||
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_pet_by_id(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$get_pet_by_id(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$get_pet_by_id(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_pet_by_id`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_pet_by_id_streaming ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID (streaming)
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_pet_by_id_streaming(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$get_pet_by_id_streaming(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$pet_api$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$get_pet_by_id_streaming(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_pet_by_id_streaming`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### test_header ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.header_test_int <- 56 # integer | header test int
|
||||
#' var_header_test_int <- 56 # integer | header test int
|
||||
#'
|
||||
#' #Header test
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$test_header(var.header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$test_header(var_header_test_int, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$pet_api$test_header(var_header_test_int, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$test_header(var_header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `test_header`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### update_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Update an existing pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_pet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$update_pet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$update_pet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### update_pet_with_form ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var.name <- "name_example" # character | Updated name of the pet
|
||||
#' var.status <- "status_example" # character | Updated status of the pet
|
||||
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var_name <- "name_example" # character | Updated name of the pet
|
||||
#' var_status <- "status_example" # character | Updated status of the pet
|
||||
#'
|
||||
#' #Updates a pet in the store with form data
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_pet_with_form(var.pet_id, name=var.name, status=var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$pet_api$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_pet_with_form`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### upload_file ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to update
|
||||
#' var.additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var.file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#' var_pet_id <- 56 # integer | ID of pet to update
|
||||
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#'
|
||||
#' #uploads an image
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$upload_file(var.pet_id, additional_metadata=var.additional_metadata, file=var.file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$pet_api$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$pet_api$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `upload_file`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pig
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Special
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Special
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Store operations
|
||||
#' @description petstore.Store
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -118,24 +118,26 @@
|
||||
#' #################### delete_order ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#' var_order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#'
|
||||
#' #Delete purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_order(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$store_api$delete_order(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_order`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### get_inventory ####################
|
||||
@@ -143,78 +145,102 @@
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Returns pet inventories by status
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_inventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$store_api$get_inventory(data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$store_api$get_inventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_inventory`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_order_by_id ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#' var_order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#'
|
||||
#' #Find purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_order_by_id(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$store_api$get_order_by_id(var_order_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$store_api$get_order_by_id(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_order_by_id`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### place_order ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#' var_order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#'
|
||||
#' #Place an order for a pet
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$place_order(var.order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$store_api$place_order(var_order, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$store_api$place_order(var_order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `place_order`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Tag
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A tag for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Tag
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new UpdatePetRequest
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' UpdatePetRequest Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title UpdatePetRequest
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new User
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A User who is purchasing from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User operations
|
||||
#' @description petstore.User
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -135,7 +135,7 @@
|
||||
#' \item response headers :
|
||||
#'
|
||||
#' \tabular{ll}{
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' X-Rate-Limit \tab calls per hour allowed by the user \cr
|
||||
#' X-Expires-After \tab date in UTC when token expires \cr
|
||||
#' }
|
||||
@@ -197,208 +197,236 @@
|
||||
#' #################### create_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- User$new() # User | Created user object
|
||||
#' var_user <- User$new() # User | Created user object
|
||||
#'
|
||||
#' #Create user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_user(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$create_user(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### create_users_with_array_input ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_users_with_array_input(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$create_users_with_array_input(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_users_with_array_input`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### create_users_with_list_input ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_users_with_list_input(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$create_users_with_list_input(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_users_with_list_input`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### delete_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be deleted
|
||||
#' var_username <- "username_example" # character | The name that needs to be deleted
|
||||
#'
|
||||
#' #Delete user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_user(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$delete_user(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### get_user_by_name ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#' var_username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#'
|
||||
#' #Get user by user name
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_user_by_name(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$user_api$get_user_by_name(var_username, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$user_api$get_user_by_name(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_user_by_name`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### login_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The user name for login
|
||||
#' var.password <- "password_example" # character | The password for login in clear text
|
||||
#' var_username <- "username_example" # character | The user name for login
|
||||
#' var_password <- "password_example" # character | The password for login in clear text
|
||||
#'
|
||||
#' #Logs user into the system
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$login_user(var.username, var.password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$user_api$login_user(var_username, var_password, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$user_api$login_user(var_username, var_password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `login_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### logout_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Logs out current logged in user session
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$logout_user(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$logout_user(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `logout_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### update_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | name that need to be deleted
|
||||
#' var.user <- User$new() # User | Updated user object
|
||||
#' var_username <- "username_example" # character | name that need to be deleted
|
||||
#' var_user <- User$new() # User | Updated user object
|
||||
#'
|
||||
#' #Updated user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- petstore_api$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_user(var.username, var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$user_api$update_user(var_username, var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new AllofTagApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' AllofTagApiResponse Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AllofTagApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Animal
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Animal Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Animal
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPig
|
||||
#'
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new BasquePig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' BasquePig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title BasquePig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Cat
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Cat Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Cat
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new CatAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' CatAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title CatAllOf
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Category
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A category for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Category
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DanishPig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DanishPig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DanishPig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Dog
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Dog Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Dog
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DogAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DogAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DogAllOf
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Fake operations
|
||||
#' @description petstore.Fake
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -57,50 +57,60 @@
|
||||
#' #################### fake_data_file ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var.var_data_file <- "var_data_file_example" # character | header data file
|
||||
#' var_dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var_var_data_file <- "var_data_file_example" # character | header data file
|
||||
#'
|
||||
#' #test data_file to ensure it's escaped correctly
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- FakeApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$fake_data_file(var.dummy, var_data_file=var.var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$fake_data_file(var_dummy, var_data_file = var_var_data_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$fake_data_file(var_dummy, var_data_file = var_var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `fake_data_file`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### fake_regular_expression ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#' var_reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#'
|
||||
#' #test regular expression to ensure no exception
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- FakeApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$fake_regular_expression(var.reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$fake_regular_expression(var_reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `fake_regular_expression`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new ModelApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title ModelApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new NestedOneOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' NestedOneOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title NestedOneOf
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Order
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' An order for a pets from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Order
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Pet
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A pet for sale in the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet operations
|
||||
#' @description petstore.Pet
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -288,284 +288,356 @@
|
||||
#' #################### add_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Add a new pet to the store
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure HTTP basic authorization: http_auth
|
||||
#' # provide the username
|
||||
#' api.instance$api_client$username <- 'TODO_YOUR_USERNAME';
|
||||
#' # provide the password
|
||||
#' api.instance$api_client$password <- 'TODO_YOUR_PASSWORD';
|
||||
#' # Configure HTTP basic authorization: http_auth
|
||||
#' api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||
#' api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$add_pet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$add_pet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$add_pet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `add_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### delete_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | Pet id to delete
|
||||
#' var.api_key <- "api_key_example" # character |
|
||||
#' var_pet_id <- 56 # integer | Pet id to delete
|
||||
#' var_api_key <- "api_key_example" # character |
|
||||
#'
|
||||
#' #Deletes a pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_pet(var.pet_id, api_key=var.api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$delete_pet(var_pet_id, api_key = var_api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### find_pets_by_status ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#'
|
||||
#' #Finds Pets by status
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$find_pets_by_status(var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$find_pets_by_status(var_status, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$find_pets_by_status(var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `find_pets_by_status`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### find_pets_by_tags ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#'
|
||||
#' #Finds Pets by tags
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$find_pets_by_tags(var.tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$find_pets_by_tags(var_tags, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$find_pets_by_tags(var_tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `find_pets_by_tags`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_pet_by_id ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure HTTP bearer authorization: BearerToken
|
||||
#' api.instance$api_client$bearer_token <- 'TODO_YOUR_BEARER_TOKEN';
|
||||
#' # Configure HTTP bearer authorization: BearerToken
|
||||
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_pet_by_id(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$get_pet_by_id(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$get_pet_by_id(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_pet_by_id`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_pet_by_id_streaming ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID (streaming)
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_pet_by_id_streaming(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$get_pet_by_id_streaming(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$get_pet_by_id_streaming(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_pet_by_id_streaming`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### test_header ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.header_test_int <- 56 # integer | header test int
|
||||
#' var_header_test_int <- 56 # integer | header test int
|
||||
#'
|
||||
#' #Header test
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$test_header(var.header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$test_header(var_header_test_int, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$test_header(var_header_test_int, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$test_header(var_header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `test_header`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### update_pet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Update an existing pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_pet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$update_pet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$update_pet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_pet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### update_pet_with_form ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var.name <- "name_example" # character | Updated name of the pet
|
||||
#' var.status <- "status_example" # character | Updated status of the pet
|
||||
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var_name <- "name_example" # character | Updated name of the pet
|
||||
#' var_status <- "status_example" # character | Updated status of the pet
|
||||
#'
|
||||
#' #Updates a pet in the store with form data
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_pet_with_form(var.pet_id, name=var.name, status=var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_pet_with_form`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### upload_file ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to update
|
||||
#' var.additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var.file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#' var_pet_id <- 56 # integer | ID of pet to update
|
||||
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#'
|
||||
#' #uploads an image
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$upload_file(var.pet_id, additional_metadata=var.additional_metadata, file=var.file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `upload_file`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pig
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Special
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Special
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Store operations
|
||||
#' @description petstore.Store
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -118,24 +118,26 @@
|
||||
#' #################### delete_order ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#' var_order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#'
|
||||
#' #Delete purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_order(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$delete_order(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_order`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### get_inventory ####################
|
||||
@@ -143,78 +145,102 @@
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Returns pet inventories by status
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_inventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$get_inventory(data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$get_inventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_inventory`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### get_order_by_id ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#' var_order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#'
|
||||
#' #Find purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_order_by_id(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$get_order_by_id(var_order_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$get_order_by_id(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_order_by_id`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### place_order ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#' var_order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#'
|
||||
#' #Place an order for a pet
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$place_order(var.order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$place_order(var_order, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$place_order(var_order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `place_order`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Tag
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A tag for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Tag
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new UpdatePetRequest
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' UpdatePetRequest Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title UpdatePetRequest
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new User
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A User who is purchasing from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User operations
|
||||
#' @description petstore.User
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -135,7 +135,7 @@
|
||||
#' \item response headers :
|
||||
#'
|
||||
#' \tabular{ll}{
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' X-Rate-Limit \tab calls per hour allowed by the user \cr
|
||||
#' X-Expires-After \tab date in UTC when token expires \cr
|
||||
#' }
|
||||
@@ -197,208 +197,236 @@
|
||||
#' #################### create_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- User$new() # User | Created user object
|
||||
#' var_user <- User$new() # User | Created user object
|
||||
#'
|
||||
#' #Create user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_user(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$create_user(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### create_users_with_array_input ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_users_with_array_input(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$create_users_with_array_input(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_users_with_array_input`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### create_users_with_list_input ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$create_users_with_list_input(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$create_users_with_list_input(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `create_users_with_list_input`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### delete_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be deleted
|
||||
#' var_username <- "username_example" # character | The name that needs to be deleted
|
||||
#'
|
||||
#' #Delete user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$delete_user(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$delete_user(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `delete_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### get_user_by_name ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#' var_username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#'
|
||||
#' #Get user by user name
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$get_user_by_name(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$get_user_by_name(var_username, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$get_user_by_name(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `get_user_by_name`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### login_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The user name for login
|
||||
#' var.password <- "password_example" # character | The password for login in clear text
|
||||
#' var_username <- "username_example" # character | The user name for login
|
||||
#' var_password <- "password_example" # character | The password for login in clear text
|
||||
#'
|
||||
#' #Logs user into the system
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$login_user(var.username, var.password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$login_user(var_username, var_password, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$login_user(var_username, var_password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `login_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### logout_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Logs out current logged in user session
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$logout_user(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$logout_user(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `logout_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### update_user ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | name that need to be deleted
|
||||
#' var.user <- User$new() # User | Updated user object
|
||||
#' var_username <- "username_example" # character | name that need to be deleted
|
||||
#' var_user <- User$new() # User | Updated user object
|
||||
#'
|
||||
#' #Updated user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$update_user(var.username, var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$update_user(var_username, var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `update_user`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# petstore::ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **integer** | | [optional]
|
||||
**type** | **character** | | [optional]
|
||||
**message** | **character** | | [optional]
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new AllofTagApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' AllofTagApiResponse Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AllofTagApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Animal
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Animal Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Animal
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPig
|
||||
#'
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new BasquePig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' BasquePig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title BasquePig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Cat
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Cat Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Cat
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new CatAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' CatAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title CatAllOf
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Category
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A category for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Category
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DanishPig
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DanishPig Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DanishPig
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Dog
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Dog Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Dog
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new DogAllOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' DogAllOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title DogAllOf
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Fake operations
|
||||
#' @description petstore.Fake
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -57,50 +57,60 @@
|
||||
#' #################### FakeDataFile ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var.var_data_file <- "var_data_file_example" # character | header data file
|
||||
#' var_dummy <- "dummy_example" # character | dummy required parameter
|
||||
#' var_var_data_file <- "var_data_file_example" # character | header data file
|
||||
#'
|
||||
#' #test data_file to ensure it's escaped correctly
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- FakeApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$FakeDataFile(var.dummy, var_data_file=var.var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$FakeDataFile(var_dummy, var_data_file = var_var_data_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$FakeDataFile(var_dummy, var_data_file = var_var_data_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `FakeDataFile`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### FakeRegularExpression ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#' var_reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||
#'
|
||||
#' #test regular expression to ensure no exception
|
||||
#' api.instance <- FakeApi$new()
|
||||
#' api_instance <- FakeApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$FakeRegularExpression(var.reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$FakeRegularExpression(var_reg_exp_test),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `FakeRegularExpression`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new ModelApiResponse
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title ModelApiResponse
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new NestedOneOf
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' NestedOneOf Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title NestedOneOf
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Order
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' An order for a pets from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Order
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Pet
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A pet for sale in the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pet operations
|
||||
#' @description petstore.Pet
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -288,284 +288,356 @@
|
||||
#' #################### AddPet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Add a new pet to the store
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure HTTP basic authorization: http_auth
|
||||
#' # provide the username
|
||||
#' api.instance$api_client$username <- 'TODO_YOUR_USERNAME';
|
||||
#' # provide the password
|
||||
#' api.instance$api_client$password <- 'TODO_YOUR_PASSWORD';
|
||||
#' # Configure HTTP basic authorization: http_auth
|
||||
#' api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||
#' api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$AddPet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$AddPet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$AddPet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `AddPet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### DeletePet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | Pet id to delete
|
||||
#' var.api_key <- "api_key_example" # character |
|
||||
#' var_pet_id <- 56 # integer | Pet id to delete
|
||||
#' var_api_key <- "api_key_example" # character |
|
||||
#'
|
||||
#' #Deletes a pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$DeletePet(var.pet_id, api_key=var.api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$DeletePet(var_pet_id, api_key = var_api_key),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `DeletePet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### FindPetsByStatus ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
|
||||
#'
|
||||
#' #Finds Pets by status
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$FindPetsByStatus(var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$FindPetsByStatus(var_status, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$FindPetsByStatus(var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `FindPetsByStatus`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### FindPetsByTags ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
|
||||
#'
|
||||
#' #Finds Pets by tags
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$FindPetsByTags(var.tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$FindPetsByTags(var_tags, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$FindPetsByTags(var_tags),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `FindPetsByTags`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### GetPetById ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure HTTP bearer authorization: BearerToken
|
||||
#' api.instance$api_client$bearer_token <- 'TODO_YOUR_BEARER_TOKEN';
|
||||
#' # Configure HTTP bearer authorization: BearerToken
|
||||
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$GetPetById(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$GetPetById(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$GetPetById(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `GetPetById`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### GetPetByIdStreaming ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to return
|
||||
#' var_pet_id <- 56 # integer | ID of pet to return
|
||||
#'
|
||||
#' #Find pet by ID (streaming)
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$GetPetByIdStreaming(var.pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$GetPetByIdStreaming(var_pet_id, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$GetPetByIdStreaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$GetPetByIdStreaming(var_pet_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `GetPetByIdStreaming`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### TestHeader ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.header_test_int <- 56 # integer | header test int
|
||||
#' var_header_test_int <- 56 # integer | header test int
|
||||
#'
|
||||
#' #Header test
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$TestHeader(var.header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$TestHeader(var_header_test_int, data_file = "result.txt"),
|
||||
#'
|
||||
#' # this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||
#' # api_instance$TestHeader(var_header_test_int, stream_callback = function(x){ print(length(x)) }),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$TestHeader(var_header_test_int),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `TestHeader`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### UpdatePet ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
#'
|
||||
#' #Update an existing pet
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$UpdatePet(var.pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$UpdatePet(var_pet, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$UpdatePet(var_pet),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `UpdatePet`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### UpdatePetWithForm ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var.name <- "name_example" # character | Updated name of the pet
|
||||
#' var.status <- "status_example" # character | Updated status of the pet
|
||||
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||
#' var_name <- "name_example" # character | Updated name of the pet
|
||||
#' var_status <- "status_example" # character | Updated status of the pet
|
||||
#'
|
||||
#' #Updates a pet in the store with form data
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$UpdatePetWithForm(var.pet_id, name=var.name, status=var.status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$UpdatePetWithForm(var_pet_id, name = var_name, status = var_status),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `UpdatePetWithForm`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### UploadFile ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.pet_id <- 56 # integer | ID of pet to update
|
||||
#' var.additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var.file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#' var_pet_id <- 56 # integer | ID of pet to update
|
||||
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
|
||||
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
|
||||
#'
|
||||
#' #uploads an image
|
||||
#' api.instance <- PetApi$new()
|
||||
#' api_instance <- PetApi$new()
|
||||
#'
|
||||
#' # Configure OAuth2 access token for authorization: petstore_auth
|
||||
#' api.instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
#' api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$UploadFile(var.pet_id, additional_metadata=var.additional_metadata, file=var.file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$UploadFile(var_pet_id, additional_metadata = var_additional_metadata, file = var_file, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$UploadFile(var_pet_id, additional_metadata = var_additional_metadata, file = var_file),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `UploadFile`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Pig
|
||||
#'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Special
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' Describes the result of uploading an image resource
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Special
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Store operations
|
||||
#' @description petstore.Store
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -118,24 +118,26 @@
|
||||
#' #################### DeleteOrder ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#' var_order_id <- "order_id_example" # character | ID of the order that needs to be deleted
|
||||
#'
|
||||
#' #Delete purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$DeleteOrder(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$DeleteOrder(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `DeleteOrder`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### GetInventory ####################
|
||||
@@ -143,78 +145,102 @@
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Returns pet inventories by status
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$GetInventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$GetInventory(data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$GetInventory(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `GetInventory`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### GetOrderById ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#' var_order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||
#'
|
||||
#' #Find purchase order by ID
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$GetOrderById(var.order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$GetOrderById(var_order_id, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$GetOrderById(var_order_id),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `GetOrderById`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### PlaceOrder ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#' var_order <- Order$new() # Order | order placed for purchasing the pet
|
||||
#'
|
||||
#' #Place an order for a pet
|
||||
#' api.instance <- StoreApi$new()
|
||||
#' api_instance <- StoreApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$PlaceOrder(var.order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$PlaceOrder(var_order, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$PlaceOrder(var_order),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `PlaceOrder`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom base64enc base64encode
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new Tag
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A tag for a pet
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title Tag
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new UpdatePetRequest
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' UpdatePetRequest Class
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title UpdatePetRequest
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#' OpenAPI Petstore
|
||||
#' Create a new User
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#' @description
|
||||
#' A User who is purchasing from the pet store
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title User operations
|
||||
#' @description petstore.User
|
||||
#' @description
|
||||
#' @format An \code{R6Class} generator object
|
||||
#' @field api_client Handles the client-server communication.
|
||||
#'
|
||||
@@ -135,7 +135,7 @@
|
||||
#' \item response headers :
|
||||
#'
|
||||
#' \tabular{ll}{
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||
#' X-Rate-Limit \tab calls per hour allowed by the user \cr
|
||||
#' X-Expires-After \tab date in UTC when token expires \cr
|
||||
#' }
|
||||
@@ -197,208 +197,236 @@
|
||||
#' #################### CreateUser ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- User$new() # User | Created user object
|
||||
#' var_user <- User$new() # User | Created user object
|
||||
#'
|
||||
#' #Create user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$CreateUser(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$CreateUser(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `CreateUser`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### CreateUsersWithArrayInput ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$CreateUsersWithArrayInput(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$CreateUsersWithArrayInput(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `CreateUsersWithArrayInput`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### CreateUsersWithListInput ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.user <- [User$new()] # array[User] | List of user object
|
||||
#' var_user <- [User$new()] # array[User] | List of user object
|
||||
#'
|
||||
#' #Creates list of users with given input array
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$CreateUsersWithListInput(var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$CreateUsersWithListInput(var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `CreateUsersWithListInput`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### DeleteUser ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be deleted
|
||||
#' var_username <- "username_example" # character | The name that needs to be deleted
|
||||
#'
|
||||
#' #Delete user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$DeleteUser(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$DeleteUser(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `DeleteUser`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### GetUserByName ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#' var_username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||
#'
|
||||
#' #Get user by user name
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$GetUserByName(var.username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$GetUserByName(var_username, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$GetUserByName(var_username),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `GetUserByName`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### LoginUser ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | The user name for login
|
||||
#' var.password <- "password_example" # character | The password for login in clear text
|
||||
#' var_username <- "username_example" # character | The user name for login
|
||||
#' var_password <- "password_example" # character | The password for login in clear text
|
||||
#'
|
||||
#' #Logs user into the system
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$LoginUser(var.username, var.password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
#' # api_instance$LoginUser(var_username, var_password, data_file = "result.txt"),
|
||||
#'
|
||||
#'
|
||||
#' api_instance$LoginUser(var_username, var_password),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `LoginUser`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' } else {
|
||||
#' # deserialized response object
|
||||
#' response.object <- result$content
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' # deserialized response object
|
||||
#' print("The response is ...")
|
||||
#' dput(result$toString())
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' #################### LogoutUser ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#'
|
||||
#' #Logs out current logged in user session
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$LogoutUser(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$LogoutUser(),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `LogoutUser`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' #################### UpdateUser ####################
|
||||
#'
|
||||
#' library(petstore)
|
||||
#' var.username <- "username_example" # character | name that need to be deleted
|
||||
#' var.user <- User$new() # User | Updated user object
|
||||
#' var_username <- "username_example" # character | name that need to be deleted
|
||||
#' var_user <- User$new() # User | Updated user object
|
||||
#'
|
||||
#' #Updated user
|
||||
#' api.instance <- UserApi$new()
|
||||
#' api_instance <- UserApi$new()
|
||||
#'
|
||||
#' #Configure API key authorization: api_key
|
||||
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||
#' # Configure API key authorization: api_key
|
||||
#' api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||
#'
|
||||
#'result <- tryCatch(
|
||||
#' api.instance$UpdateUser(var.username, var.user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' result <- tryCatch(
|
||||
#'
|
||||
#' api_instance$UpdateUser(var_username, var_user),
|
||||
#' ApiException = function(ex) ex
|
||||
#' )
|
||||
#' # In case of error, print the error object
|
||||
#' if(!is.null(result$ApiException)) {
|
||||
#' cat(result$ApiException$toString())
|
||||
#' } else {
|
||||
#' # response headers
|
||||
#' response.headers <- result$response$headers
|
||||
#' # response status code
|
||||
#' response.status.code <- result$response$status_code
|
||||
#' }
|
||||
#' if (!is.null(result$ApiException)) {
|
||||
#' print("Exception occurs when calling `UpdateUser`:")
|
||||
#' dput(result$ApiException$toString())
|
||||
#'
|
||||
#' # error object
|
||||
#' dput(result$ApiException$error_object$toJSONString())
|
||||
#'
|
||||
#' }#'
|
||||
#' # This endpoint doesn't return data
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
|
||||
Reference in New Issue
Block a user