forked from loafle/openapi-generator-original
[R sample] fix CircleCI error of outdated sample (#2313)
This commit is contained in:
parent
e6b7ee6f4c
commit
a55fb7adc5
@ -7,8 +7,6 @@ export(ApiResponse)
|
||||
|
||||
# Models
|
||||
export(Category)
|
||||
export(InlineObject)
|
||||
export(InlineObject1)
|
||||
export(ModelApiResponse)
|
||||
export(Order)
|
||||
export(Pet)
|
||||
|
@ -56,17 +56,17 @@ PetApi <- R6::R6Class(
|
||||
self$apiClient <- ApiClient$new()
|
||||
}
|
||||
},
|
||||
AddPet = function(pet, ...){
|
||||
AddPet = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`pet`)) {
|
||||
stop("Missing required parameter `pet`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`pet`)) {
|
||||
body <- `pet`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@ -223,17 +223,17 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
},
|
||||
UpdatePet = function(pet, ...){
|
||||
UpdatePet = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`pet`)) {
|
||||
stop("Missing required parameter `pet`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`pet`)) {
|
||||
body <- `pet`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
|
@ -133,17 +133,17 @@ StoreApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
},
|
||||
PlaceOrder = function(order, ...){
|
||||
PlaceOrder = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`order`)) {
|
||||
stop("Missing required parameter `order`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`order`)) {
|
||||
body <- `order`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
|
@ -56,17 +56,17 @@ UserApi <- R6::R6Class(
|
||||
self$apiClient <- ApiClient$new()
|
||||
}
|
||||
},
|
||||
CreateUser = function(user, ...){
|
||||
CreateUser = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`user`)) {
|
||||
stop("Missing required parameter `user`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`user`)) {
|
||||
body <- `user`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@ -89,17 +89,17 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
},
|
||||
CreateUsersWithArrayInput = function(user, ...){
|
||||
CreateUsersWithArrayInput = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`user`)) {
|
||||
stop("Missing required parameter `user`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`user`)) {
|
||||
body <- `user`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@ -122,17 +122,17 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
},
|
||||
CreateUsersWithListInput = function(user, ...){
|
||||
CreateUsersWithListInput = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
|
||||
if (missing(`user`)) {
|
||||
stop("Missing required parameter `user`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`user`)) {
|
||||
body <- `user`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@ -275,7 +275,7 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
},
|
||||
UpdateUser = function(username, user, ...){
|
||||
UpdateUser = function(username, body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@ -284,12 +284,12 @@ UserApi <- R6::R6Class(
|
||||
stop("Missing required parameter `username`.")
|
||||
}
|
||||
|
||||
if (missing(`user`)) {
|
||||
stop("Missing required parameter `user`.")
|
||||
if (missing(`body`)) {
|
||||
stop("Missing required parameter `body`.")
|
||||
}
|
||||
|
||||
if (!missing(`user`)) {
|
||||
body <- `user`$toJSONString()
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
|
@ -81,8 +81,6 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Models
|
||||
|
||||
- [Category](docs/Category.md)
|
||||
- [InlineObject](docs/InlineObject.md)
|
||||
- [InlineObject1](docs/InlineObject1.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
|
@ -15,7 +15,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **AddPet**
|
||||
> AddPet(pet)
|
||||
> AddPet(body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
@ -23,20 +23,20 @@ Add a new pet to the store
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
var.body <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
|
||||
#Add a new pet to the store
|
||||
api.instance <- PetApi$new()
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
api.instance$AddPet(var.pet)
|
||||
api.instance$AddPet(var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -221,7 +221,7 @@ Name | Type | Description | Notes
|
||||
|
||||
|
||||
# **UpdatePet**
|
||||
> UpdatePet(pet)
|
||||
> UpdatePet(body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
@ -229,20 +229,20 @@ Update an existing pet
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
var.body <- Pet$new() # Pet | Pet object that needs to be added to the store
|
||||
|
||||
#Update an existing pet
|
||||
api.instance <- PetApi$new()
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
api.instance$UpdatePet(var.pet)
|
||||
api.instance$UpdatePet(var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -128,7 +128,7 @@ No authorization required
|
||||
|
||||
|
||||
# **PlaceOrder**
|
||||
> Order PlaceOrder(order)
|
||||
> Order PlaceOrder(body)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
@ -136,11 +136,11 @@ Place an order for a pet
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||
var.body <- Order$new() # Order | order placed for purchasing the pet
|
||||
|
||||
#Place an order for a pet
|
||||
api.instance <- StoreApi$new()
|
||||
result <- api.instance$PlaceOrder(var.order)
|
||||
result <- api.instance$PlaceOrder(var.body)
|
||||
dput(result)
|
||||
```
|
||||
|
||||
@ -148,7 +148,7 @@ dput(result)
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -160,7 +160,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **CreateUser**
|
||||
> CreateUser(user)
|
||||
> CreateUser(body)
|
||||
|
||||
Create user
|
||||
|
||||
@ -25,18 +25,18 @@ This can only be done by the logged in user.
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.user <- User$new() # User | Created user object
|
||||
var.body <- User$new() # User | Created user object
|
||||
|
||||
#Create user
|
||||
api.instance <- UserApi$new()
|
||||
api.instance$CreateUser(var.user)
|
||||
api.instance$CreateUser(var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -48,13 +48,13 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
|
||||
# **CreateUsersWithArrayInput**
|
||||
> CreateUsersWithArrayInput(user)
|
||||
> CreateUsersWithArrayInput(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
@ -62,18 +62,18 @@ Creates list of users with given input array
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.user <- [array$new()] # User | List of user object
|
||||
var.body <- [array$new()] # User | List of user object
|
||||
|
||||
#Creates list of users with given input array
|
||||
api.instance <- UserApi$new()
|
||||
api.instance$CreateUsersWithArrayInput(var.user)
|
||||
api.instance$CreateUsersWithArrayInput(var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**User**](array.md)| List of user object |
|
||||
**body** | [**User**](array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -85,13 +85,13 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
|
||||
# **CreateUsersWithListInput**
|
||||
> CreateUsersWithListInput(user)
|
||||
> CreateUsersWithListInput(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
@ -99,18 +99,18 @@ Creates list of users with given input array
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.user <- [array$new()] # User | List of user object
|
||||
var.body <- [array$new()] # User | List of user object
|
||||
|
||||
#Creates list of users with given input array
|
||||
api.instance <- UserApi$new()
|
||||
api.instance$CreateUsersWithListInput(var.user)
|
||||
api.instance$CreateUsersWithListInput(var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**User**](array.md)| List of user object |
|
||||
**body** | [**User**](array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -122,7 +122,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ No authorization required
|
||||
|
||||
|
||||
# **UpdateUser**
|
||||
> UpdateUser(username, user)
|
||||
> UpdateUser(username, body)
|
||||
|
||||
Updated user
|
||||
|
||||
@ -289,11 +289,11 @@ This can only be done by the logged in user.
|
||||
library(petstore)
|
||||
|
||||
var.username <- 'username_example' # character | name that need to be deleted
|
||||
var.user <- User$new() # User | Updated user object
|
||||
var.body <- User$new() # User | Updated user object
|
||||
|
||||
#Updated user
|
||||
api.instance <- UserApi$new()
|
||||
api.instance$UpdateUser(var.username, var.user)
|
||||
api.instance$UpdateUser(var.username, var.body)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -301,7 +301,7 @@ api.instance$UpdateUser(var.username, var.user)
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **character**| name that need to be deleted |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -313,7 +313,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user