migrate rust client samples to 3.0 spec (#9999)

This commit is contained in:
William Cheng 2021-07-23 11:22:20 +08:00 committed by GitHub
parent fe9636e9d9
commit 38a2fac37e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 276 additions and 150 deletions

View File

@ -1,7 +1,7 @@
generatorName: rust
outputDir: samples/client/petstore/rust/hyper/petstore
library: hyper
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: "false"

View File

@ -1,7 +1,7 @@
generatorName: rust
outputDir: samples/client/petstore/rust/reqwest/petstore-async
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: true

View File

@ -1,7 +1,7 @@
generatorName: rust
outputDir: samples/client/petstore/rust/reqwest/petstore
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: false

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## add_pet
> add_pet(body)
> crate::models::Pet add_pet(pet)
Add a new pet to the store
### Parameters
@ -25,11 +25,11 @@ Add a new pet to the store
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -38,7 +38,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -164,7 +164,7 @@ Name | Type | Description | Required | Notes
## update_pet
> update_pet(body)
> crate::models::Pet update_pet(pet)
Update an existing pet
### Parameters
@ -172,11 +172,11 @@ Update an existing pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -185,7 +185,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -100,7 +100,7 @@ No authorization required
## place_order
> crate::models::Order place_order(body)
> crate::models::Order place_order(order)
Place an order for a pet
### Parameters
@ -108,7 +108,7 @@ Place an order for a pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
**order** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
### Return type
@ -120,7 +120,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## create_user
> create_user(body)
> create_user(user)
Create user
This can only be done by the logged in user.
@ -27,7 +27,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md) | Created user object | [required] |
**user** | [**User**](User.md) | Created user object | [required] |
### Return type
@ -35,11 +35,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -47,7 +47,7 @@ No authorization required
## create_users_with_array_input
> create_users_with_array_input(body)
> create_users_with_array_input(user)
Creates list of users with given input array
### Parameters
@ -55,7 +55,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -63,11 +63,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -75,7 +75,7 @@ No authorization required
## create_users_with_list_input
> create_users_with_list_input(body)
> create_users_with_list_input(user)
Creates list of users with given input array
### Parameters
@ -83,7 +83,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -91,11 +91,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -121,7 +121,7 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -203,7 +203,7 @@ This endpoint does not need any parameter.
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -215,7 +215,7 @@ No authorization required
## update_user
> update_user(username, body)
> update_user(username, user)
Updated user
This can only be done by the logged in user.
@ -226,7 +226,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**username** | **String** | name that need to be deleted | [required] |
**body** | [**User**](User.md) | Updated user object | [required] |
**user** | [**User**](User.md) | Updated user object | [required] |
### Return type
@ -234,11 +234,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -33,23 +33,22 @@ impl<C: hyper::client::Connect> PetApiClient<C> {
}
pub trait PetApi {
fn add_pet(&self, body: crate::models::Pet) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn add_pet(&self, pet: crate::models::Pet) -> Box<dyn Future<Item = crate::models::Pet, Error = Error<serde_json::Value>>>;
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn find_pets_by_status(&self, status: Vec<String>) -> Box<dyn Future<Item = Vec<crate::models::Pet>, Error = Error<serde_json::Value>>>;
fn find_pets_by_tags(&self, tags: Vec<String>) -> Box<dyn Future<Item = Vec<crate::models::Pet>, Error = Error<serde_json::Value>>>;
fn get_pet_by_id(&self, pet_id: i64) -> Box<dyn Future<Item = crate::models::Pet, Error = Error<serde_json::Value>>>;
fn update_pet(&self, body: crate::models::Pet) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn update_pet(&self, pet: crate::models::Pet) -> Box<dyn Future<Item = crate::models::Pet, Error = Error<serde_json::Value>>>;
fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option<std::path::PathBuf>) -> Box<dyn Future<Item = crate::models::ApiResponse, Error = Error<serde_json::Value>>>;
}
impl<C: hyper::client::Connect>PetApi for PetApiClient<C> {
fn add_pet(&self, body: crate::models::Pet) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn add_pet(&self, pet: crate::models::Pet) -> Box<dyn Future<Item = crate::models::Pet, Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/pet".to_string())
.with_auth(__internal_request::Auth::Oauth)
;
req = req.with_body_param(body);
req = req.returns_nothing();
req = req.with_body_param(pet);
req.execute(self.configuration.borrow())
}
@ -98,12 +97,11 @@ impl<C: hyper::client::Connect>PetApi for PetApiClient<C> {
req.execute(self.configuration.borrow())
}
fn update_pet(&self, body: crate::models::Pet) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn update_pet(&self, pet: crate::models::Pet) -> Box<dyn Future<Item = crate::models::Pet, Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Put, "/pet".to_string())
.with_auth(__internal_request::Auth::Oauth)
;
req = req.with_body_param(body);
req = req.returns_nothing();
req = req.with_body_param(pet);
req.execute(self.configuration.borrow())
}

View File

@ -36,7 +36,7 @@ pub trait StoreApi {
fn delete_order(&self, order_id: &str) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn get_inventory(&self, ) -> Box<dyn Future<Item = ::std::collections::HashMap<String, i32>, Error = Error<serde_json::Value>>>;
fn get_order_by_id(&self, order_id: i64) -> Box<dyn Future<Item = crate::models::Order, Error = Error<serde_json::Value>>>;
fn place_order(&self, body: crate::models::Order) -> Box<dyn Future<Item = crate::models::Order, Error = Error<serde_json::Value>>>;
fn place_order(&self, order: crate::models::Order) -> Box<dyn Future<Item = crate::models::Order, Error = Error<serde_json::Value>>>;
}
impl<C: hyper::client::Connect>StoreApi for StoreApiClient<C> {
@ -69,10 +69,10 @@ impl<C: hyper::client::Connect>StoreApi for StoreApiClient<C> {
req.execute(self.configuration.borrow())
}
fn place_order(&self, body: crate::models::Order) -> Box<dyn Future<Item = crate::models::Order, Error = Error<serde_json::Value>>> {
fn place_order(&self, order: crate::models::Order) -> Box<dyn Future<Item = crate::models::Order, Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/store/order".to_string())
;
req = req.with_body_param(body);
req = req.with_body_param(order);
req.execute(self.configuration.borrow())
}

View File

@ -33,39 +33,54 @@ impl<C: hyper::client::Connect> UserApiClient<C> {
}
pub trait UserApi {
fn create_user(&self, body: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn create_users_with_array_input(&self, body: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn create_users_with_list_input(&self, body: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn create_user(&self, user: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn create_users_with_array_input(&self, user: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn create_users_with_list_input(&self, user: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn delete_user(&self, username: &str) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn get_user_by_name(&self, username: &str) -> Box<dyn Future<Item = crate::models::User, Error = Error<serde_json::Value>>>;
fn login_user(&self, username: &str, password: &str) -> Box<dyn Future<Item = String, Error = Error<serde_json::Value>>>;
fn logout_user(&self, ) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn update_user(&self, username: &str, body: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn update_user(&self, username: &str, user: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
}
impl<C: hyper::client::Connect>UserApi for UserApiClient<C> {
fn create_user(&self, body: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn create_user(&self, user: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/user".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.with_body_param(body);
req = req.with_body_param(user);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
fn create_users_with_array_input(&self, body: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn create_users_with_array_input(&self, user: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/user/createWithArray".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.with_body_param(body);
req = req.with_body_param(user);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
fn create_users_with_list_input(&self, body: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn create_users_with_list_input(&self, user: Vec<crate::models::User>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/user/createWithList".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.with_body_param(body);
req = req.with_body_param(user);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
@ -73,6 +88,11 @@ impl<C: hyper::client::Connect>UserApi for UserApiClient<C> {
fn delete_user(&self, username: &str) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Delete, "/user/{username}".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.with_path_param("username".to_string(), username.to_string());
req = req.returns_nothing();
@ -99,17 +119,27 @@ impl<C: hyper::client::Connect>UserApi for UserApiClient<C> {
fn logout_user(&self, ) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Get, "/user/logout".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
fn update_user(&self, username: &str, body: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
fn update_user(&self, username: &str, user: crate::models::User) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Put, "/user/{username}".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "api_key".to_owned(),
}))
;
req = req.with_path_param("username".to_string(), username.to_string());
req = req.with_body_param(body);
req = req.with_body_param(user);
req = req.returns_nothing();
req.execute(self.configuration.borrow())

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## add_pet
> add_pet(body)
> crate::models::Pet add_pet(pet)
Add a new pet to the store
### Parameters
@ -25,11 +25,11 @@ Add a new pet to the store
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -38,7 +38,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -164,7 +164,7 @@ Name | Type | Description | Required | Notes
## update_pet
> update_pet(body)
> crate::models::Pet update_pet(pet)
Update an existing pet
### Parameters
@ -172,11 +172,11 @@ Update an existing pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -185,7 +185,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -100,7 +100,7 @@ No authorization required
## place_order
> crate::models::Order place_order(body)
> crate::models::Order place_order(order)
Place an order for a pet
### Parameters
@ -108,7 +108,7 @@ Place an order for a pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
**order** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
### Return type
@ -120,7 +120,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## create_user
> create_user(body)
> create_user(user)
Create user
This can only be done by the logged in user.
@ -27,7 +27,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md) | Created user object | [required] |
**user** | [**User**](User.md) | Created user object | [required] |
### Return type
@ -35,11 +35,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -47,7 +47,7 @@ No authorization required
## create_users_with_array_input
> create_users_with_array_input(body)
> create_users_with_array_input(user)
Creates list of users with given input array
### Parameters
@ -55,7 +55,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -63,11 +63,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -75,7 +75,7 @@ No authorization required
## create_users_with_list_input
> create_users_with_list_input(body)
> create_users_with_list_input(user)
Creates list of users with given input array
### Parameters
@ -83,7 +83,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -91,11 +91,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -121,7 +121,7 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -203,7 +203,7 @@ This endpoint does not need any parameter.
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -215,7 +215,7 @@ No authorization required
## update_user
> update_user(username, body)
> update_user(username, user)
Updated user
This can only be done by the logged in user.
@ -226,7 +226,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**username** | **String** | name that need to be deleted | [required] |
**body** | [**User**](User.md) | Updated user object | [required] |
**user** | [**User**](User.md) | Updated user object | [required] |
### Return type
@ -234,11 +234,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -18,7 +18,7 @@ use super::{Error, configuration};
#[derive(Clone, Debug)]
pub struct AddPetParams {
/// Pet object that needs to be added to the store
pub body: crate::models::Pet
pub pet: crate::models::Pet
}
/// struct for passing parameters to the method `delete_pet`
@ -54,7 +54,7 @@ pub struct GetPetByIdParams {
#[derive(Clone, Debug)]
pub struct UpdatePetParams {
/// Pet object that needs to be added to the store
pub body: crate::models::Pet
pub pet: crate::models::Pet
}
/// struct for passing parameters to the method `update_pet_with_form`
@ -84,6 +84,7 @@ pub struct UploadFileParams {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddPetSuccess {
Status200(crate::models::Pet),
UnknownValue(serde_json::Value),
}
@ -122,6 +123,7 @@ pub enum GetPetByIdSuccess {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdatePetSuccess {
Status200(crate::models::Pet),
UnknownValue(serde_json::Value),
}
@ -209,7 +211,7 @@ pub enum UploadFileError {
pub async fn add_pet(configuration: &configuration::Configuration, params: AddPetParams) -> Result<ResponseContent<AddPetSuccess>, Error<AddPetError>> {
// unbox the parameters
let body = params.body;
let pet = params.pet;
let local_var_client = &configuration.client;
@ -223,7 +225,7 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe
if let Some(ref local_var_token) = configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&pet);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -394,7 +396,7 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params:
pub async fn update_pet(configuration: &configuration::Configuration, params: UpdatePetParams) -> Result<ResponseContent<UpdatePetSuccess>, Error<UpdatePetError>> {
// unbox the parameters
let body = params.body;
let pet = params.pet;
let local_var_client = &configuration.client;
@ -408,7 +410,7 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up
if let Some(ref local_var_token) = configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&pet);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

View File

@ -32,7 +32,7 @@ pub struct GetOrderByIdParams {
#[derive(Clone, Debug)]
pub struct PlaceOrderParams {
/// order placed for purchasing the pet
pub body: crate::models::Order
pub order: crate::models::Order
}
@ -206,7 +206,7 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param
pub async fn place_order(configuration: &configuration::Configuration, params: PlaceOrderParams) -> Result<ResponseContent<PlaceOrderSuccess>, Error<PlaceOrderError>> {
// unbox the parameters
let body = params.body;
let order = params.order;
let local_var_client = &configuration.client;
@ -217,7 +217,7 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&order);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

View File

@ -18,21 +18,21 @@ use super::{Error, configuration};
#[derive(Clone, Debug)]
pub struct CreateUserParams {
/// Created user object
pub body: crate::models::User
pub user: crate::models::User
}
/// struct for passing parameters to the method `create_users_with_array_input`
#[derive(Clone, Debug)]
pub struct CreateUsersWithArrayInputParams {
/// List of user object
pub body: Vec<crate::models::User>
pub user: Vec<crate::models::User>
}
/// struct for passing parameters to the method `create_users_with_list_input`
#[derive(Clone, Debug)]
pub struct CreateUsersWithListInputParams {
/// List of user object
pub body: Vec<crate::models::User>
pub user: Vec<crate::models::User>
}
/// struct for passing parameters to the method `delete_user`
@ -64,7 +64,7 @@ pub struct UpdateUserParams {
/// name that need to be deleted
pub username: String,
/// Updated user object
pub body: crate::models::User
pub user: crate::models::User
}
@ -197,7 +197,7 @@ pub enum UpdateUserError {
/// This can only be done by the logged in user.
pub async fn create_user(configuration: &configuration::Configuration, params: CreateUserParams) -> Result<ResponseContent<CreateUserSuccess>, Error<CreateUserError>> {
// unbox the parameters
let body = params.body;
let user = params.user;
let local_var_client = &configuration.client;
@ -208,7 +208,15 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -229,7 +237,7 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C
pub async fn create_users_with_array_input(configuration: &configuration::Configuration, params: CreateUsersWithArrayInputParams) -> Result<ResponseContent<CreateUsersWithArrayInputSuccess>, Error<CreateUsersWithArrayInputError>> {
// unbox the parameters
let body = params.body;
let user = params.user;
let local_var_client = &configuration.client;
@ -240,7 +248,15 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -261,7 +277,7 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config
pub async fn create_users_with_list_input(configuration: &configuration::Configuration, params: CreateUsersWithListInputParams) -> Result<ResponseContent<CreateUsersWithListInputSuccess>, Error<CreateUsersWithListInputError>> {
// unbox the parameters
let body = params.body;
let user = params.user;
let local_var_client = &configuration.client;
@ -272,7 +288,15 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -305,6 +329,14 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -400,6 +432,14 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
@ -422,7 +462,7 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result
pub async fn update_user(configuration: &configuration::Configuration, params: UpdateUserParams) -> Result<ResponseContent<UpdateUserSuccess>, Error<UpdateUserError>> {
// unbox the parameters
let username = params.username;
let body = params.body;
let user = params.user;
let local_var_client = &configuration.client;
@ -433,7 +473,15 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## add_pet
> add_pet(body)
> crate::models::Pet add_pet(pet)
Add a new pet to the store
### Parameters
@ -25,11 +25,11 @@ Add a new pet to the store
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -38,7 +38,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -164,7 +164,7 @@ Name | Type | Description | Required | Notes
## update_pet
> update_pet(body)
> crate::models::Pet update_pet(pet)
Update an existing pet
### Parameters
@ -172,11 +172,11 @@ Update an existing pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] |
### Return type
(empty response body)
[**crate::models::Pet**](Pet.md)
### Authorization
@ -185,7 +185,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -100,7 +100,7 @@ No authorization required
## place_order
> crate::models::Order place_order(body)
> crate::models::Order place_order(order)
Place an order for a pet
### Parameters
@ -108,7 +108,7 @@ Place an order for a pet
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
**order** | [**Order**](Order.md) | order placed for purchasing the pet | [required] |
### Return type
@ -120,7 +120,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
## create_user
> create_user(body)
> create_user(user)
Create user
This can only be done by the logged in user.
@ -27,7 +27,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md) | Created user object | [required] |
**user** | [**User**](User.md) | Created user object | [required] |
### Return type
@ -35,11 +35,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -47,7 +47,7 @@ No authorization required
## create_users_with_array_input
> create_users_with_array_input(body)
> create_users_with_array_input(user)
Creates list of users with given input array
### Parameters
@ -55,7 +55,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -63,11 +63,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -75,7 +75,7 @@ No authorization required
## create_users_with_list_input
> create_users_with_list_input(body)
> create_users_with_list_input(user)
Creates list of users with given input array
### Parameters
@ -83,7 +83,7 @@ Creates list of users with given input array
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**body** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
**user** | [**Vec<crate::models::User>**](User.md) | List of user object | [required] |
### Return type
@ -91,11 +91,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@ -121,7 +121,7 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -203,7 +203,7 @@ This endpoint does not need any parameter.
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@ -215,7 +215,7 @@ No authorization required
## update_user
> update_user(username, body)
> update_user(username, user)
Updated user
This can only be done by the logged in user.
@ -226,7 +226,7 @@ This can only be done by the logged in user.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**username** | **String** | name that need to be deleted | [required] |
**body** | [**User**](User.md) | Updated user object | [required] |
**user** | [**User**](User.md) | Updated user object | [required] |
### Return type
@ -234,11 +234,11 @@ Name | Type | Description | Required | Notes
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -82,7 +82,7 @@ pub enum UploadFileError {
}
pub fn add_pet(configuration: &configuration::Configuration, body: crate::models::Pet) -> Result<(), Error<AddPetError>> {
pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result<crate::models::Pet, Error<AddPetError>> {
let local_var_client = &configuration.client;
@ -95,7 +95,7 @@ pub fn add_pet(configuration: &configuration::Configuration, body: crate::models
if let Some(ref local_var_token) = configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&pet);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -104,7 +104,7 @@ pub fn add_pet(configuration: &configuration::Configuration, body: crate::models
let local_var_content = local_var_resp.text()?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<AddPetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
@ -241,7 +241,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64)
}
}
pub fn update_pet(configuration: &configuration::Configuration, body: crate::models::Pet) -> Result<(), Error<UpdatePetError>> {
pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result<crate::models::Pet, Error<UpdatePetError>> {
let local_var_client = &configuration.client;
@ -254,7 +254,7 @@ pub fn update_pet(configuration: &configuration::Configuration, body: crate::mod
if let Some(ref local_var_token) = configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&pet);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -263,7 +263,7 @@ pub fn update_pet(configuration: &configuration::Configuration, body: crate::mod
let local_var_content = local_var_resp.text()?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<UpdatePetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };

View File

@ -138,7 +138,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i
}
}
pub fn place_order(configuration: &configuration::Configuration, body: crate::models::Order) -> Result<crate::models::Order, Error<PlaceOrderError>> {
pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result<crate::models::Order, Error<PlaceOrderError>> {
let local_var_client = &configuration.client;
@ -148,7 +148,7 @@ pub fn place_order(configuration: &configuration::Configuration, body: crate::mo
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
local_var_req_builder = local_var_req_builder.json(&order);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;

View File

@ -84,7 +84,7 @@ pub enum UpdateUserError {
/// This can only be done by the logged in user.
pub fn create_user(configuration: &configuration::Configuration, body: crate::models::User) -> Result<(), Error<CreateUserError>> {
pub fn create_user(configuration: &configuration::Configuration, user: crate::models::User) -> Result<(), Error<CreateUserError>> {
let local_var_client = &configuration.client;
@ -94,7 +94,15 @@ pub fn create_user(configuration: &configuration::Configuration, body: crate::mo
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -111,7 +119,7 @@ pub fn create_user(configuration: &configuration::Configuration, body: crate::mo
}
}
pub fn create_users_with_array_input(configuration: &configuration::Configuration, body: Vec<crate::models::User>) -> Result<(), Error<CreateUsersWithArrayInputError>> {
pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec<crate::models::User>) -> Result<(), Error<CreateUsersWithArrayInputError>> {
let local_var_client = &configuration.client;
@ -121,7 +129,15 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -138,7 +154,7 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio
}
}
pub fn create_users_with_list_input(configuration: &configuration::Configuration, body: Vec<crate::models::User>) -> Result<(), Error<CreateUsersWithListInputError>> {
pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec<crate::models::User>) -> Result<(), Error<CreateUsersWithListInputError>> {
let local_var_client = &configuration.client;
@ -148,7 +164,15 @@ pub fn create_users_with_list_input(configuration: &configuration::Configuration
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -176,6 +200,14 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str)
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -256,6 +288,14 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(),
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;
@ -273,7 +313,7 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(),
}
/// This can only be done by the logged in user.
pub fn update_user(configuration: &configuration::Configuration, username: &str, body: crate::models::User) -> Result<(), Error<UpdateUserError>> {
pub fn update_user(configuration: &configuration::Configuration, username: &str, user: crate::models::User) -> Result<(), Error<UpdateUserError>> {
let local_var_client = &configuration.client;
@ -283,7 +323,15 @@ pub fn update_user(configuration: &configuration::Configuration, username: &str,
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&body);
if let Some(ref local_var_apikey) = configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("api_key", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&user);
let local_var_req = local_var_req_builder.build()?;
let mut local_var_resp = local_var_client.execute(local_var_req)?;