Skip to content

Commit 962e8c4

Browse files
committed
update samples
1 parent d01ad05 commit 962e8c4

3 files changed

Lines changed: 47 additions & 17 deletions

File tree

samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
66
* The version of the OpenAPI document: 1.0.0
7-
*
7+
*
88
* Generated by: https://openapi-generator.tech
99
*/
1010

@@ -35,20 +35,20 @@ impl<C: hyper::client::connect::Connect> PetApiClient<C>
3535
}
3636

3737
pub trait PetApi {
38-
fn add_pet(&self, body: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
38+
fn add_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
3939
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
4040
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<crate::models::Pet>, Error>>>>;
4141
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<crate::models::Pet>, Error>>>>;
4242
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
43-
fn update_pet(&self, body: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
43+
fn update_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
4444
fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
4545
fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option<std::path::PathBuf>) -> Pin<Box<dyn Future<Output = Result<crate::models::ApiResponse, Error>>>>;
4646
}
4747

4848
impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
4949
where C: Clone + std::marker::Send + Sync {
5050
#[allow(unused_mut)]
51-
fn add_pet(&self, body: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
51+
fn add_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>> {
5252
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string())
5353
.with_auth(__internal_request::Auth::Oauth)
5454
;
@@ -106,7 +106,7 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
106106
}
107107

108108
#[allow(unused_mut)]
109-
fn update_pet(&self, body: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
109+
fn update_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>> {
110110
let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string())
111111
.with_auth(__internal_request::Auth::Oauth)
112112
;

samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
66
* The version of the OpenAPI document: 1.0.0
7-
*
7+
*
88
* Generated by: https://openapi-generator.tech
99
*/
1010

@@ -38,7 +38,7 @@ pub trait StoreApi {
3838
fn delete_order(&self, order_id: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
3939
fn get_inventory(&self, ) -> Pin<Box<dyn Future<Output = Result<::std::collections::HashMap<String, i32>, Error>>>>;
4040
fn get_order_by_id(&self, order_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
41-
fn place_order(&self, body: crate::models::Order) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
41+
fn place_order(&self, order: crate::models::Order) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
4242
}
4343

4444
impl<C: hyper::client::connect::Connect>StoreApi for StoreApiClient<C>
@@ -76,7 +76,7 @@ impl<C: hyper::client::connect::Connect>StoreApi for StoreApiClient<C>
7676
}
7777

7878
#[allow(unused_mut)]
79-
fn place_order(&self, body: crate::models::Order) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>> {
79+
fn place_order(&self, order: crate::models::Order) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>> {
8080
let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string())
8181
;
8282
req = req.with_body_param(order);

samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
66
* The version of the OpenAPI document: 1.0.0
7-
*
7+
*
88
* Generated by: https://openapi-generator.tech
99
*/
1010

@@ -35,21 +35,26 @@ impl<C: hyper::client::connect::Connect> UserApiClient<C>
3535
}
3636

3737
pub trait UserApi {
38-
fn create_user(&self, body: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
39-
fn create_users_with_array_input(&self, body: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
40-
fn create_users_with_list_input(&self, body: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
38+
fn create_user(&self, user: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
39+
fn create_users_with_array_input(&self, user: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
40+
fn create_users_with_list_input(&self, user: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
4141
fn delete_user(&self, username: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
4242
fn get_user_by_name(&self, username: &str) -> Pin<Box<dyn Future<Output = Result<crate::models::User, Error>>>>;
4343
fn login_user(&self, username: &str, password: &str) -> Pin<Box<dyn Future<Output = Result<String, Error>>>>;
4444
fn logout_user(&self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
45-
fn update_user(&self, username: &str, body: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
45+
fn update_user(&self, username: &str, user: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
4646
}
4747

4848
impl<C: hyper::client::connect::Connect>UserApi for UserApiClient<C>
4949
where C: Clone + std::marker::Send + Sync {
5050
#[allow(unused_mut)]
51-
fn create_user(&self, body: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
51+
fn create_user(&self, user: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
5252
let mut req = __internal_request::Request::new(hyper::Method::POST, "/user".to_string())
53+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
54+
in_header: true,
55+
in_query: false,
56+
param_name: "api_key".to_owned(),
57+
}))
5358
;
5459
req = req.with_body_param(user);
5560
req = req.returns_nothing();
@@ -58,8 +63,13 @@ impl<C: hyper::client::connect::Connect>UserApi for UserApiClient<C>
5863
}
5964

6065
#[allow(unused_mut)]
61-
fn create_users_with_array_input(&self, body: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
66+
fn create_users_with_array_input(&self, user: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
6267
let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithArray".to_string())
68+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
69+
in_header: true,
70+
in_query: false,
71+
param_name: "api_key".to_owned(),
72+
}))
6373
;
6474
req = req.with_body_param(user);
6575
req = req.returns_nothing();
@@ -68,8 +78,13 @@ impl<C: hyper::client::connect::Connect>UserApi for UserApiClient<C>
6878
}
6979

7080
#[allow(unused_mut)]
71-
fn create_users_with_list_input(&self, body: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
81+
fn create_users_with_list_input(&self, user: Vec<crate::models::User>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
7282
let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithList".to_string())
83+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
84+
in_header: true,
85+
in_query: false,
86+
param_name: "api_key".to_owned(),
87+
}))
7388
;
7489
req = req.with_body_param(user);
7590
req = req.returns_nothing();
@@ -80,6 +95,11 @@ impl<C: hyper::client::connect::Connect>UserApi for UserApiClient<C>
8095
#[allow(unused_mut)]
8196
fn delete_user(&self, username: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
8297
let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/user/{username}".to_string())
98+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
99+
in_header: true,
100+
in_query: false,
101+
param_name: "api_key".to_owned(),
102+
}))
83103
;
84104
req = req.with_path_param("username".to_string(), username.to_string());
85105
req = req.returns_nothing();
@@ -109,15 +129,25 @@ impl<C: hyper::client::connect::Connect>UserApi for UserApiClient<C>
109129
#[allow(unused_mut)]
110130
fn logout_user(&self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
111131
let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/logout".to_string())
132+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
133+
in_header: true,
134+
in_query: false,
135+
param_name: "api_key".to_owned(),
136+
}))
112137
;
113138
req = req.returns_nothing();
114139

115140
req.execute(self.configuration.borrow())
116141
}
117142

118143
#[allow(unused_mut)]
119-
fn update_user(&self, username: &str, body: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
144+
fn update_user(&self, username: &str, user: crate::models::User) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
120145
let mut req = __internal_request::Request::new(hyper::Method::PUT, "/user/{username}".to_string())
146+
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
147+
in_header: true,
148+
in_query: false,
149+
param_name: "api_key".to_owned(),
150+
}))
121151
;
122152
req = req.with_path_param("username".to_string(), username.to_string());
123153
req = req.with_body_param(user);

0 commit comments

Comments
 (0)