Skip to content

Commit

Permalink
[Rust] Regenerate petstore sample
Browse files Browse the repository at this point in the history
  • Loading branch information
euank committed Mar 19, 2018
1 parent dced4c2 commit 80c592c
Show file tree
Hide file tree
Showing 5 changed files with 389 additions and 71 deletions.
2 changes: 1 addition & 1 deletion samples/client/petstore/rust/docs/UserApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Get user by user name

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |

### Return type

Expand Down
16 changes: 16 additions & 0 deletions samples/client/petstore/rust/src/apis/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,24 @@
*/

use hyper;
use std::collections::HashMap;

pub struct Configuration<C: hyper::client::Connect> {
pub base_path: String,
pub user_agent: Option<String>,
pub client: hyper::client::Client<C>,

pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub api_key: Option<ApiKey>,
// TODO: take an oauth2 token source, similar to the go one
}

pub type BasicAuth = (String, Option<String>);

pub struct ApiKey {
pub prefix: Option<String>,
pub key: String,
}

impl<C: hyper::client::Connect> Configuration<C> {
Expand All @@ -22,6 +35,9 @@ impl<C: hyper::client::Connect> Configuration<C> {
base_path: "http://petstore.swagger.io/v2".to_owned(),
user_agent: Some("Swagger-Codegen/1.0.0/rust".to_owned()),
client: client,
basic_auth: None,
oauth_access_token: None,
api_key: None,
}
}
}
Loading

0 comments on commit 80c592c

Please sign in to comment.