Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions samples/client/petstore/rust/hyper/petstore/docs/PetApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Name | Type | Description | Required | Notes

## delete_pet

> delete_pet(pet_id, api_key)
> delete_pet(petid, api_key)
Deletes a pet


Expand All @@ -57,7 +57,7 @@ Deletes a pet

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | Pet id to delete | [required] |
**petid** | **i64** | Pet id to delete | [required] |
**api_key** | Option<**String**> | | |

### Return type
Expand Down Expand Up @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes

## get_pet_by_id

> crate::models::Pet get_pet_by_id(pet_id)
> crate::models::Pet get_pet_by_id(petid)
Find pet by ID

Returns a single pet
Expand All @@ -148,7 +148,7 @@ Returns a single pet

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet to return | [required] |
**petid** | **i64** | ID of pet to return | [required] |

### Return type

Expand Down Expand Up @@ -198,7 +198,7 @@ Name | Type | Description | Required | Notes

## update_pet_with_form

> update_pet_with_form(pet_id, name, status)
> update_pet_with_form(petid, name, status)
Updates a pet in the store with form data


Expand All @@ -208,7 +208,7 @@ Updates a pet in the store with form data

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet that needs to be updated | [required] |
**petid** | **i64** | ID of pet that needs to be updated | [required] |
**name** | Option<**String**> | Updated name of the pet | |
**status** | Option<**String**> | Updated status of the pet | |

Expand All @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes

## upload_file

> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file)
> crate::models::ApiResponse upload_file(petid, additionalmetadata, file)
uploads an image


Expand All @@ -240,8 +240,8 @@ uploads an image

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet to update | [required] |
**additional_metadata** | Option<**String**> | Additional data to pass to server | |
**petid** | **i64** | ID of pet to update | [required] |
**additionalmetadata** | Option<**String**> | Additional data to pass to server | |
**file** | Option<**std::path::PathBuf**> | file to upload | |

### Return type
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Method | HTTP request | Description

## delete_order

> delete_order(order_id)
> delete_order(orderid)
Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Expand All @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**order_id** | **String** | ID of the order that needs to be deleted | [required] |
**orderid** | **String** | ID of the order that needs to be deleted | [required] |

### Return type

Expand Down Expand Up @@ -70,7 +70,7 @@ This endpoint does not need any parameter.

## get_order_by_id

> crate::models::Order get_order_by_id(order_id)
> crate::models::Order get_order_by_id(orderid)
Find purchase order by ID

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Expand All @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**order_id** | **i64** | ID of pet that needs to be fetched | [required] |
**orderid** | **i64** | ID of pet that needs to be fetched | [required] |

### Return type

Expand Down
26 changes: 13 additions & 13 deletions samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ impl<C: hyper::client::connect::Connect> PetApiClient<C>

pub trait PetApi {
fn add_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn delete_pet(&self, petid: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<crate::models::Pet>, Error>>>>;
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<crate::models::Pet>, Error>>>>;
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
fn get_pet_by_id(&self, petid: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
fn update_pet(&self, pet: crate::models::Pet) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>>;
fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
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>>>>;
fn update_pet_with_form(&self, petid: i64, name: Option<&str>, status: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn upload_file(&self, petid: i64, additionalmetadata: Option<&str>, file: Option<std::path::PathBuf>) -> Pin<Box<dyn Future<Output = Result<crate::models::ApiResponse, Error>>>>;
}

impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
Expand All @@ -58,11 +58,11 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
}

#[allow(unused_mut)]
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
fn delete_pet(&self, petid: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/pet/{petId}".to_string())
.with_auth(__internal_request::Auth::Oauth)
;
req = req.with_path_param("petId".to_string(), pet_id.to_string());
req = req.with_path_param("petId".to_string(), petid.to_string());
if let Some(param_value) = api_key {
req = req.with_header_param("api_key".to_string(), param_value.to_string());
}
Expand Down Expand Up @@ -92,15 +92,15 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
}

#[allow(unused_mut)]
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>> {
fn get_pet_by_id(&self, petid: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Pet, Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/{petId}".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("petId".to_string(), pet_id.to_string());
req = req.with_path_param("petId".to_string(), petid.to_string());

req.execute(self.configuration.borrow())
}
Expand All @@ -116,11 +116,11 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
}

#[allow(unused_mut)]
fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
fn update_pet_with_form(&self, petid: i64, name: Option<&str>, status: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}".to_string())
.with_auth(__internal_request::Auth::Oauth)
;
req = req.with_path_param("petId".to_string(), pet_id.to_string());
req = req.with_path_param("petId".to_string(), petid.to_string());
if let Some(param_value) = name {
req = req.with_form_param("name".to_string(), param_value.to_string());
}
Expand All @@ -133,12 +133,12 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
}

#[allow(unused_mut)]
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>>>> {
fn upload_file(&self, petid: i64, additionalmetadata: Option<&str>, file: Option<std::path::PathBuf>) -> Pin<Box<dyn Future<Output = Result<crate::models::ApiResponse, Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}/uploadImage".to_string())
.with_auth(__internal_request::Auth::Oauth)
;
req = req.with_path_param("petId".to_string(), pet_id.to_string());
if let Some(param_value) = additional_metadata {
req = req.with_path_param("petId".to_string(), petid.to_string());
if let Some(param_value) = additionalmetadata {
req = req.with_form_param("additionalMetadata".to_string(), param_value.to_string());
}
if let Some(param_value) = file {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,19 @@ impl Request {
self
}

#[allow(unused)]
pub fn with_query_param(mut self, basename: String, param: String) -> Self {
self.query_params.insert(basename, param);
self
}

#[allow(unused)]
pub fn with_path_param(mut self, basename: String, param: String) -> Self {
self.path_params.insert(basename, param);
self
}

#[allow(unused)]
pub fn with_form_param(mut self, basename: String, param: String) -> Self {
self.form_params.insert(basename, param);
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ impl<C: hyper::client::connect::Connect> StoreApiClient<C>
}

pub trait StoreApi {
fn delete_order(&self, order_id: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn delete_order(&self, orderid: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn get_inventory(&self, ) -> Pin<Box<dyn Future<Output = Result<::std::collections::HashMap<String, i32>, Error>>>>;
fn get_order_by_id(&self, order_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
fn get_order_by_id(&self, orderid: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
fn place_order(&self, order: crate::models::Order) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>>;
}

impl<C: hyper::client::connect::Connect>StoreApi for StoreApiClient<C>
where C: Clone + std::marker::Send + Sync {
#[allow(unused_mut)]
fn delete_order(&self, order_id: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
fn delete_order(&self, orderid: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/store/order/{orderId}".to_string())
;
req = req.with_path_param("orderId".to_string(), order_id.to_string());
req = req.with_path_param("orderId".to_string(), orderid.to_string());
req = req.returns_nothing();

req.execute(self.configuration.borrow())
Expand All @@ -67,10 +67,10 @@ impl<C: hyper::client::connect::Connect>StoreApi for StoreApiClient<C>
}

#[allow(unused_mut)]
fn get_order_by_id(&self, order_id: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>> {
fn get_order_by_id(&self, orderid: i64) -> Pin<Box<dyn Future<Output = Result<crate::models::Order, Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/order/{orderId}".to_string())
;
req = req.with_path_param("orderId".to_string(), order_id.to_string());
req = req.with_path_param("orderId".to_string(), orderid.to_string());

req.execute(self.configuration.borrow())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Name | Type | Description | Required | Notes

## delete_pet

> delete_pet(pet_id, api_key)
> delete_pet(petid, api_key)
Deletes a pet


Expand All @@ -57,7 +57,7 @@ Deletes a pet

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | Pet id to delete | [required] |
**petid** | **i64** | Pet id to delete | [required] |
**api_key** | Option<**String**> | | |

### Return type
Expand Down Expand Up @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes

## get_pet_by_id

> crate::models::Pet get_pet_by_id(pet_id)
> crate::models::Pet get_pet_by_id(petid)
Find pet by ID

Returns a single pet
Expand All @@ -148,7 +148,7 @@ Returns a single pet

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet to return | [required] |
**petid** | **i64** | ID of pet to return | [required] |

### Return type

Expand Down Expand Up @@ -198,7 +198,7 @@ Name | Type | Description | Required | Notes

## update_pet_with_form

> update_pet_with_form(pet_id, name, status)
> update_pet_with_form(petid, name, status)
Updates a pet in the store with form data


Expand All @@ -208,7 +208,7 @@ Updates a pet in the store with form data

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet that needs to be updated | [required] |
**petid** | **i64** | ID of pet that needs to be updated | [required] |
**name** | Option<**String**> | Updated name of the pet | |
**status** | Option<**String**> | Updated status of the pet | |

Expand All @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes

## upload_file

> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file)
> crate::models::ApiResponse upload_file(petid, additionalmetadata, file)
uploads an image


Expand All @@ -240,8 +240,8 @@ uploads an image

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**pet_id** | **i64** | ID of pet to update | [required] |
**additional_metadata** | Option<**String**> | Additional data to pass to server | |
**petid** | **i64** | ID of pet to update | [required] |
**additionalmetadata** | Option<**String**> | Additional data to pass to server | |
**file** | Option<**std::path::PathBuf**> | file to upload | |

### Return type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Method | HTTP request | Description

## delete_order

> delete_order(order_id)
> delete_order(orderid)
Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Expand All @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**order_id** | **String** | ID of the order that needs to be deleted | [required] |
**orderid** | **String** | ID of the order that needs to be deleted | [required] |

### Return type

Expand Down Expand Up @@ -70,7 +70,7 @@ This endpoint does not need any parameter.

## get_order_by_id

> crate::models::Order get_order_by_id(order_id)
> crate::models::Order get_order_by_id(orderid)
Find purchase order by ID

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Expand All @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**order_id** | **i64** | ID of pet that needs to be fetched | [required] |
**orderid** | **i64** | ID of pet that needs to be fetched | [required] |

### Return type

Expand Down
Loading