forked from loafle/openapi-generator-original
[R] Minor improvements to the documentation (#13226)
* minor improvement to r doc * better scopes
This commit is contained in:
parent
18bb5466bb
commit
ed3666fbde
@ -115,14 +115,20 @@ Class | Method | HTTP request | Description
|
|||||||
- **Refresh URL**: {{refreshUrl}}
|
- **Refresh URL**: {{refreshUrl}}
|
||||||
{{/refreshUrl}}
|
{{/refreshUrl}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - {{scope}}: {{description}}
|
{{#scopes}} - `{{scope}}`: {{description}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
{{/isOAuth}}
|
{{/isOAuth}}
|
||||||
|
|
||||||
{{/authMethods}}
|
{{/authMethods}}
|
||||||
|
|
||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#-last}}
|
||||||
|
{{#infoEmail}}
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
{{{infoEmail}}}
|
||||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
{{/infoEmail}}
|
||||||
|
{{/-last}}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
@ -26,7 +26,7 @@ var_{{{paramName}}} <- {{{vendorExtensions.x-r-example}}} # {{{dataType}}} | {{{
|
|||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
{{#summary}}
|
{{#summary}}
|
||||||
#{{{.}}}
|
# {{{.}}}
|
||||||
{{/summary}}
|
{{/summary}}
|
||||||
{{#generateWrapper}}
|
{{#generateWrapper}}
|
||||||
api_instance <- {{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api$new()
|
api_instance <- {{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api$new()
|
||||||
@ -62,10 +62,10 @@ api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
|||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` 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}}data_file = "result.txt"),
|
# 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}}
|
{{#vendorExtensions.x-streaming}}
|
||||||
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
# 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)) }),
|
# 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}}
|
{{/vendorExtensions.x-streaming}}
|
||||||
{{/returnType}}
|
{{/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}}),
|
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}}),
|
||||||
|
@ -133,12 +133,7 @@ Class | Method | HTTP request | Description
|
|||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- write:pets: modify pets in your account
|
- `write:pets`: modify pets in your account
|
||||||
- read:pets: read your pets
|
- `read:pets`: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ library(petstore)
|
|||||||
var_dummy <- "dummy_example" # character | dummy required parameter
|
var_dummy <- "dummy_example" # character | dummy required parameter
|
||||||
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
||||||
|
|
||||||
#test data_file to ensure it's escaped correctly
|
# test data_file to ensure it's escaped correctly
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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_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),
|
api_instance$fake_api$fake_data_file(var_dummy, var_data_file = var_var_data_file),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -82,7 +82,7 @@ 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
|
# test regular expression to ensure no exception
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$fake_api$fake_regular_expression(var_reg_exp_test),
|
api_instance$fake_api$fake_regular_expression(var_reg_exp_test),
|
||||||
|
@ -29,14 +29,14 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Add a new pet to the store
|
# Add a new pet to the store
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure HTTP basic authorization: http_auth
|
# Configure HTTP basic authorization: http_auth
|
||||||
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||||
api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$pet_api$add_pet(var_pet, data_file = "result.txt"),
|
||||||
api_instance$pet_api$add_pet(var_pet),
|
api_instance$pet_api$add_pet(var_pet),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -93,7 +93,7 @@ library(petstore)
|
|||||||
var_pet_id <- 56 # integer | Pet id to delete
|
var_pet_id <- 56 # integer | Pet id to delete
|
||||||
var_api_key <- "api_key_example" # character | (Optional)
|
var_api_key <- "api_key_example" # character | (Optional)
|
||||||
|
|
||||||
#Deletes a pet
|
# Deletes a pet
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -149,13 +149,13 @@ library(petstore)
|
|||||||
|
|
||||||
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
||||||
|
|
||||||
#Finds Pets by status
|
# Finds Pets by status
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$pet_api$find_pets_by_status(var_status, data_file = "result.txt"),
|
||||||
api_instance$pet_api$find_pets_by_status(var_status),
|
api_instance$pet_api$find_pets_by_status(var_status),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -211,13 +211,13 @@ library(petstore)
|
|||||||
|
|
||||||
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
||||||
|
|
||||||
#Finds Pets by tags
|
# Finds Pets by tags
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$pet_api$find_pets_by_tags(var_tags, data_file = "result.txt"),
|
||||||
api_instance$pet_api$find_pets_by_tags(var_tags),
|
api_instance$pet_api$find_pets_by_tags(var_tags),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -273,13 +273,13 @@ 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
|
# Find pet by ID
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure HTTP bearer authorization: BearerToken
|
# Configure HTTP bearer authorization: BearerToken
|
||||||
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$pet_api$get_pet_by_id(var_pet_id, data_file = "result.txt"),
|
||||||
api_instance$pet_api$get_pet_by_id(var_pet_id),
|
api_instance$pet_api$get_pet_by_id(var_pet_id),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -336,15 +336,15 @@ 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)
|
# Find pet by ID (streaming)
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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"),
|
# 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.
|
# 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$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),
|
api_instance$pet_api$get_pet_by_id_streaming(var_pet_id),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -401,15 +401,15 @@ library(petstore)
|
|||||||
|
|
||||||
var_header_test_int <- 56 # integer | header test int
|
var_header_test_int <- 56 # integer | header test int
|
||||||
|
|
||||||
#Header test
|
# Header test
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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"),
|
# 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.
|
# 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$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),
|
api_instance$pet_api$test_header(var_header_test_int),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -466,13 +466,13 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Update an existing pet
|
# Update an existing pet
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$pet_api$update_pet(var_pet, data_file = "result.txt"),
|
||||||
api_instance$pet_api$update_pet(var_pet),
|
api_instance$pet_api$update_pet(var_pet),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -532,7 +532,7 @@ var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
|||||||
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
||||||
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
||||||
|
|
||||||
#Updates a pet in the store with form data
|
# Updates a pet in the store with form data
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$pet_api$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
api_instance$pet_api$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
||||||
@ -589,13 +589,13 @@ var_pet_id <- 56 # integer | ID of pet to update
|
|||||||
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
||||||
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
||||||
|
|
||||||
#uploads an image
|
# uploads an image
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$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),
|
api_instance$pet_api$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
|
@ -23,7 +23,7 @@ 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
|
# Delete purchase order by ID
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$store_api$delete_order(var_order_id),
|
api_instance$store_api$delete_order(var_order_id),
|
||||||
@ -76,13 +76,13 @@ Returns a map of status codes to quantities
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Returns pet inventories by status
|
# Returns pet inventories by status
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$store_api$get_inventory(data_file = "result.txt"),
|
||||||
api_instance$store_api$get_inventory(),
|
api_instance$store_api$get_inventory(),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -134,11 +134,11 @@ 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
|
# Find purchase order by ID
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$store_api$get_order_by_id(var_order_id, data_file = "result.txt"),
|
||||||
api_instance$store_api$get_order_by_id(var_order_id),
|
api_instance$store_api$get_order_by_id(var_order_id),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -195,11 +195,11 @@ library(petstore)
|
|||||||
|
|
||||||
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
#Place an order for a pet
|
# Place an order for a pet
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$store_api$place_order(var_order, data_file = "result.txt"),
|
||||||
api_instance$store_api$place_order(var_order),
|
api_instance$store_api$place_order(var_order),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
|
@ -27,7 +27,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
||||||
|
|
||||||
#Create user
|
# Create user
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -82,7 +82,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -137,7 +137,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -192,7 +192,7 @@ 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
|
# Delete user
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -248,11 +248,11 @@ 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
|
# Get user by user name
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$user_api$get_user_by_name(var_username, data_file = "result.txt"),
|
||||||
api_instance$user_api$get_user_by_name(var_username),
|
api_instance$user_api$get_user_by_name(var_username),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -310,11 +310,11 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | The user name for login
|
var_username <- "username_example" # character | The user name for login
|
||||||
var_password <- "password_example" # character | The password for login in clear text
|
var_password <- "password_example" # character | The password for login in clear text
|
||||||
|
|
||||||
#Logs user into the system
|
# Logs user into the system
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# 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$user_api$login_user(var_username, var_password, data_file = "result.txt"),
|
||||||
api_instance$user_api$login_user(var_username, var_password),
|
api_instance$user_api$login_user(var_username, var_password),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
@ -370,7 +370,7 @@ Logs out current logged in user session
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Logs out current logged in user session
|
# Logs out current logged in user session
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -423,7 +423,7 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | name that need to be deleted
|
var_username <- "username_example" # character | name that need to be deleted
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
||||||
|
|
||||||
#Updated user
|
# Updated user
|
||||||
api_instance <- petstore_api$new()
|
api_instance <- petstore_api$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
@ -133,12 +133,7 @@ Class | Method | HTTP request | Description
|
|||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- write:pets: modify pets in your account
|
- `write:pets`: modify pets in your account
|
||||||
- read:pets: read your pets
|
- `read:pets`: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ library(petstore)
|
|||||||
var_dummy <- "dummy_example" # character | dummy required parameter
|
var_dummy <- "dummy_example" # character | dummy required parameter
|
||||||
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
||||||
|
|
||||||
#test data_file to ensure it's escaped correctly
|
# test data_file to ensure it's escaped correctly
|
||||||
api_instance <- FakeApi$new()
|
api_instance <- FakeApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -82,7 +82,7 @@ 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
|
# test regular expression to ensure no exception
|
||||||
api_instance <- FakeApi$new()
|
api_instance <- FakeApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$fake_regular_expression(var_reg_exp_test),
|
api_instance$fake_regular_expression(var_reg_exp_test),
|
||||||
|
@ -29,7 +29,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Add a new pet to the store
|
# Add a new pet to the store
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure HTTP basic authorization: http_auth
|
# Configure HTTP basic authorization: http_auth
|
||||||
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||||
@ -93,7 +93,7 @@ library(petstore)
|
|||||||
var_pet_id <- 56 # integer | Pet id to delete
|
var_pet_id <- 56 # integer | Pet id to delete
|
||||||
var_api_key <- "api_key_example" # character | (Optional)
|
var_api_key <- "api_key_example" # character | (Optional)
|
||||||
|
|
||||||
#Deletes a pet
|
# Deletes a pet
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -149,7 +149,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
||||||
|
|
||||||
#Finds Pets by status
|
# Finds Pets by status
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -211,7 +211,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
||||||
|
|
||||||
#Finds Pets by tags
|
# Finds Pets by tags
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -273,7 +273,7 @@ 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
|
# Find pet by ID
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure HTTP bearer authorization: BearerToken
|
# Configure HTTP bearer authorization: BearerToken
|
||||||
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||||
@ -336,7 +336,7 @@ 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)
|
# Find pet by ID (streaming)
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -401,7 +401,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_header_test_int <- 56 # integer | header test int
|
var_header_test_int <- 56 # integer | header test int
|
||||||
|
|
||||||
#Header test
|
# Header test
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -466,7 +466,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Update an existing pet
|
# Update an existing pet
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -532,7 +532,7 @@ var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
|||||||
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
||||||
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
||||||
|
|
||||||
#Updates a pet in the store with form data
|
# Updates a pet in the store with form data
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
api_instance$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
||||||
@ -589,7 +589,7 @@ var_pet_id <- 56 # integer | ID of pet to update
|
|||||||
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
||||||
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
||||||
|
|
||||||
#uploads an image
|
# uploads an image
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
@ -23,7 +23,7 @@ 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
|
# Delete purchase order by ID
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$delete_order(var_order_id),
|
api_instance$delete_order(var_order_id),
|
||||||
@ -76,7 +76,7 @@ Returns a map of status codes to quantities
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Returns pet inventories by status
|
# Returns pet inventories by status
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -134,7 +134,7 @@ 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
|
# Find purchase order by ID
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -195,7 +195,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
#Place an order for a pet
|
# Place an order for a pet
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
@ -27,7 +27,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
||||||
|
|
||||||
#Create user
|
# Create user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -82,7 +82,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -137,7 +137,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -192,7 +192,7 @@ 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
|
# Delete user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -248,7 +248,7 @@ 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
|
# Get user by user name
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -310,7 +310,7 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | The user name for login
|
var_username <- "username_example" # character | The user name for login
|
||||||
var_password <- "password_example" # character | The password for login in clear text
|
var_password <- "password_example" # character | The password for login in clear text
|
||||||
|
|
||||||
#Logs user into the system
|
# Logs user into the system
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -370,7 +370,7 @@ Logs out current logged in user session
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Logs out current logged in user session
|
# Logs out current logged in user session
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -423,7 +423,7 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | name that need to be deleted
|
var_username <- "username_example" # character | name that need to be deleted
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
||||||
|
|
||||||
#Updated user
|
# Updated user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
@ -133,12 +133,7 @@ Class | Method | HTTP request | Description
|
|||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- write:pets: modify pets in your account
|
- `write:pets`: modify pets in your account
|
||||||
- read:pets: read your pets
|
- `read:pets`: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ library(petstore)
|
|||||||
var_dummy <- "dummy_example" # character | dummy required parameter
|
var_dummy <- "dummy_example" # character | dummy required parameter
|
||||||
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
||||||
|
|
||||||
#test data_file to ensure it's escaped correctly
|
# test data_file to ensure it's escaped correctly
|
||||||
api_instance <- FakeApi$new()
|
api_instance <- FakeApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -82,7 +82,7 @@ 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
|
# test regular expression to ensure no exception
|
||||||
api_instance <- FakeApi$new()
|
api_instance <- FakeApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$FakeRegularExpression(var_reg_exp_test),
|
api_instance$FakeRegularExpression(var_reg_exp_test),
|
||||||
|
@ -29,7 +29,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Add a new pet to the store
|
# Add a new pet to the store
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure HTTP basic authorization: http_auth
|
# Configure HTTP basic authorization: http_auth
|
||||||
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||||
@ -93,7 +93,7 @@ library(petstore)
|
|||||||
var_pet_id <- 56 # integer | Pet id to delete
|
var_pet_id <- 56 # integer | Pet id to delete
|
||||||
var_api_key <- "api_key_example" # character | (Optional)
|
var_api_key <- "api_key_example" # character | (Optional)
|
||||||
|
|
||||||
#Deletes a pet
|
# Deletes a pet
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -149,7 +149,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
||||||
|
|
||||||
#Finds Pets by status
|
# Finds Pets by status
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -211,7 +211,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
||||||
|
|
||||||
#Finds Pets by tags
|
# Finds Pets by tags
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -273,7 +273,7 @@ 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
|
# Find pet by ID
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure HTTP bearer authorization: BearerToken
|
# Configure HTTP bearer authorization: BearerToken
|
||||||
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||||
@ -336,7 +336,7 @@ 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)
|
# Find pet by ID (streaming)
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -401,7 +401,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_header_test_int <- 56 # integer | header test int
|
var_header_test_int <- 56 # integer | header test int
|
||||||
|
|
||||||
#Header test
|
# Header test
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -466,7 +466,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Update an existing pet
|
# Update an existing pet
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
@ -532,7 +532,7 @@ var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
|||||||
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
||||||
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
||||||
|
|
||||||
#Updates a pet in the store with form data
|
# Updates a pet in the store with form data
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$UpdatePetWithForm(var_pet_id, name = var_name, status = var_status),
|
api_instance$UpdatePetWithForm(var_pet_id, name = var_name, status = var_status),
|
||||||
@ -589,7 +589,7 @@ var_pet_id <- 56 # integer | ID of pet to update
|
|||||||
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
||||||
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
||||||
|
|
||||||
#uploads an image
|
# uploads an image
|
||||||
api_instance <- PetApi$new()
|
api_instance <- PetApi$new()
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
@ -23,7 +23,7 @@ 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
|
# Delete purchase order by ID
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
api_instance$DeleteOrder(var_order_id),
|
api_instance$DeleteOrder(var_order_id),
|
||||||
@ -76,7 +76,7 @@ Returns a map of status codes to quantities
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Returns pet inventories by status
|
# Returns pet inventories by status
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -134,7 +134,7 @@ 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
|
# Find purchase order by ID
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -195,7 +195,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
#Place an order for a pet
|
# Place an order for a pet
|
||||||
api_instance <- StoreApi$new()
|
api_instance <- StoreApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
@ -27,7 +27,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
||||||
|
|
||||||
#Create user
|
# Create user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -82,7 +82,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -137,7 +137,7 @@ library(petstore)
|
|||||||
|
|
||||||
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
#Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -192,7 +192,7 @@ 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
|
# Delete user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -248,7 +248,7 @@ 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
|
# Get user by user name
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -310,7 +310,7 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | The user name for login
|
var_username <- "username_example" # character | The user name for login
|
||||||
var_password <- "password_example" # character | The password for login in clear text
|
var_password <- "password_example" # character | The password for login in clear text
|
||||||
|
|
||||||
#Logs user into the system
|
# Logs user into the system
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
result <- tryCatch(
|
result <- tryCatch(
|
||||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
@ -370,7 +370,7 @@ Logs out current logged in user session
|
|||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
#Logs out current logged in user session
|
# Logs out current logged in user session
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
@ -423,7 +423,7 @@ library(petstore)
|
|||||||
var_username <- "username_example" # character | name that need to be deleted
|
var_username <- "username_example" # character | name that need to be deleted
|
||||||
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
||||||
|
|
||||||
#Updated user
|
# Updated user
|
||||||
api_instance <- UserApi$new()
|
api_instance <- UserApi$new()
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user