diff --git a/bin/configs/rust-hyper-petstore.yaml b/bin/configs/rust-hyper-petstore.yaml index 979b2f1fba9..c1a2520faa3 100644 --- a/bin/configs/rust-hyper-petstore.yaml +++ b/bin/configs/rust-hyper-petstore.yaml @@ -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" diff --git a/bin/configs/rust-reqwest-petstore-async.yaml b/bin/configs/rust-reqwest-petstore-async.yaml index 40a22a01dfd..e045f8485f2 100644 --- a/bin/configs/rust-reqwest-petstore-async.yaml +++ b/bin/configs/rust-reqwest-petstore-async.yaml @@ -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 diff --git a/bin/configs/rust-reqwest-petstore.yaml b/bin/configs/rust-reqwest-petstore.yaml index a3cb1b61aba..119ab61dba3 100644 --- a/bin/configs/rust-reqwest-petstore.yaml +++ b/bin/configs/rust-reqwest-petstore.yaml @@ -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 diff --git a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md index 6ac82abc9d4..a20db07531e 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md @@ -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) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md index 7a7b9498d16..320171fdacb 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md @@ -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) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md index f3fce53b66d..5655737e6ee 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md @@ -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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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) diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index 6ecaee91037..f1bdaf0e89a 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -33,23 +33,22 @@ impl PetApiClient { } pub trait PetApi { - fn add_pet(&self, body: crate::models::Pet) -> Box>>; + fn add_pet(&self, pet: crate::models::Pet) -> Box>>; fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Box>>; fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>>; fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>>; fn get_pet_by_id(&self, pet_id: i64) -> Box>>; - fn update_pet(&self, body: crate::models::Pet) -> Box>>; + fn update_pet(&self, pet: crate::models::Pet) -> Box>>; fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Box>>; fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Box>>; } implPetApi for PetApiClient { - fn add_pet(&self, body: crate::models::Pet) -> Box>> { + fn add_pet(&self, pet: crate::models::Pet) -> Box>> { 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 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn update_pet(&self, body: crate::models::Pet) -> Box>> { + fn update_pet(&self, pet: crate::models::Pet) -> Box>> { 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()) } diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index a72554307e1..7e5aaa33da2 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -36,7 +36,7 @@ pub trait StoreApi { fn delete_order(&self, order_id: &str) -> Box>>; fn get_inventory(&self, ) -> Box, Error = Error>>; fn get_order_by_id(&self, order_id: i64) -> Box>>; - fn place_order(&self, body: crate::models::Order) -> Box>>; + fn place_order(&self, order: crate::models::Order) -> Box>>; } implStoreApi for StoreApiClient { @@ -69,10 +69,10 @@ implStoreApi for StoreApiClient { req.execute(self.configuration.borrow()) } - fn place_order(&self, body: crate::models::Order) -> Box>> { + fn place_order(&self, order: crate::models::Order) -> Box>> { 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()) } diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index 70f2ab5ae3e..e7326d05c4d 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -33,39 +33,54 @@ impl UserApiClient { } pub trait UserApi { - fn create_user(&self, body: crate::models::User) -> Box>>; - fn create_users_with_array_input(&self, body: Vec) -> Box>>; - fn create_users_with_list_input(&self, body: Vec) -> Box>>; + fn create_user(&self, user: crate::models::User) -> Box>>; + fn create_users_with_array_input(&self, user: Vec) -> Box>>; + fn create_users_with_list_input(&self, user: Vec) -> Box>>; fn delete_user(&self, username: &str) -> Box>>; fn get_user_by_name(&self, username: &str) -> Box>>; fn login_user(&self, username: &str, password: &str) -> Box>>; fn logout_user(&self, ) -> Box>>; - fn update_user(&self, username: &str, body: crate::models::User) -> Box>>; + fn update_user(&self, username: &str, user: crate::models::User) -> Box>>; } implUserApi for UserApiClient { - fn create_user(&self, body: crate::models::User) -> Box>> { + fn create_user(&self, user: crate::models::User) -> Box>> { 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) -> Box>> { + fn create_users_with_array_input(&self, user: Vec) -> Box>> { 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) -> Box>> { + fn create_users_with_list_input(&self, user: Vec) -> Box>> { 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 @@ implUserApi for UserApiClient { fn delete_user(&self, username: &str) -> Box>> { 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 @@ implUserApi for UserApiClient { fn logout_user(&self, ) -> Box>> { 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>> { + fn update_user(&self, username: &str, user: crate::models::User) -> Box>> { 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()) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md index 4833ebc6277..d146d7cf96a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md @@ -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) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md index 79c900d4ae4..b150749ccd9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md @@ -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) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md index f8a2117f7f8..1f66eb5cf8e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md @@ -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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index 0aec41dc66d..53701880114 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -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, Error> { // 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, Error> { // 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?; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index c4c4ff3b207..015761d608e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -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, Error> { // 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?; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index 5bd62bf8553..d241820a6c6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -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 + pub user: Vec } /// 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 + pub user: Vec } /// 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, Error> { // 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, Error> { // 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, Error> { // 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, Error> { // 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?; diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md index 4833ebc6277..d146d7cf96a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md @@ -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) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md index 79c900d4ae4..b150749ccd9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md @@ -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) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md index f8a2117f7f8..1f66eb5cf8e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md @@ -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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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**](User.md) | List of user object | [required] | +**user** | [**Vec**](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) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index dd7fc9ff0d4..8b305f91dec 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -82,7 +82,7 @@ pub enum UploadFileError { } -pub fn add_pet(configuration: &configuration::Configuration, body: crate::models::Pet) -> Result<(), Error> { +pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { 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 = 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> { +pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { 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 = 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 }; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index f4fd247f8ca..58378951a88 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -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> { +pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { 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)?; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index 623b7ce22ff..4c12019f8e1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -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> { +pub fn create_user(configuration: &configuration::Configuration, user: crate::models::User) -> Result<(), Error> { 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) -> Result<(), Error> { +pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { 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) -> Result<(), Error> { +pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { 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> { +pub fn update_user(configuration: &configuration::Configuration, username: &str, user: crate::models::User) -> Result<(), Error> { 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)?;