#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; extern crate serde_xml_rs; extern crate futures; extern crate chrono; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; extern crate swagger; use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; pub use futures::Future; #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; pub use swagger::{ApiError, ContextWrapper}; pub const BASE_PATH: &'static str = "/v2"; pub const API_VERSION: &'static str = "1.0.0"; #[derive(Debug, PartialEq)] pub enum TestSpecialTagsResponse { /// successful operation SuccessfulOperation ( models::Client ) , } #[derive(Debug, PartialEq)] pub enum FakeOuterBooleanSerializeResponse { /// Output boolean OutputBoolean ( models::OuterBoolean ) , } #[derive(Debug, PartialEq)] pub enum FakeOuterCompositeSerializeResponse { /// Output composite OutputComposite ( models::OuterComposite ) , } #[derive(Debug, PartialEq)] pub enum FakeOuterNumberSerializeResponse { /// Output number OutputNumber ( models::OuterNumber ) , } #[derive(Debug, PartialEq)] pub enum FakeOuterStringSerializeResponse { /// Output string OutputString ( models::OuterString ) , } #[derive(Debug, PartialEq)] pub enum TestBodyWithQueryParamsResponse { /// Success Success , } #[derive(Debug, PartialEq)] pub enum TestClientModelResponse { /// successful operation SuccessfulOperation ( models::Client ) , } #[derive(Debug, PartialEq)] pub enum TestEndpointParametersResponse { /// Invalid username supplied InvalidUsernameSupplied , /// User not found UserNotFound , } #[derive(Debug, PartialEq)] pub enum TestEnumParametersResponse { /// Invalid request InvalidRequest , /// Not found NotFound , } #[derive(Debug, PartialEq)] pub enum TestInlineAdditionalPropertiesResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum TestJsonFormDataResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum TestClassnameResponse { /// successful operation SuccessfulOperation ( models::Client ) , } #[derive(Debug, PartialEq)] pub enum AddPetResponse { /// Invalid input InvalidInput , } #[derive(Debug, PartialEq)] pub enum DeletePetResponse { /// Invalid pet value InvalidPetValue , } #[derive(Debug, PartialEq)] pub enum FindPetsByStatusResponse { /// successful operation SuccessfulOperation ( Vec ) , /// Invalid status value InvalidStatusValue , } #[derive(Debug, PartialEq)] pub enum FindPetsByTagsResponse { /// successful operation SuccessfulOperation ( Vec ) , /// Invalid tag value InvalidTagValue , } #[derive(Debug, PartialEq)] pub enum GetPetByIdResponse { /// successful operation SuccessfulOperation ( models::Pet ) , /// Invalid ID supplied InvalidIDSupplied , /// Pet not found PetNotFound , } #[derive(Debug, PartialEq)] pub enum UpdatePetResponse { /// Invalid ID supplied InvalidIDSupplied , /// Pet not found PetNotFound , /// Validation exception ValidationException , } #[derive(Debug, PartialEq)] pub enum UpdatePetWithFormResponse { /// Invalid input InvalidInput , } #[derive(Debug, PartialEq)] pub enum UploadFileResponse { /// successful operation SuccessfulOperation ( models::ApiResponse ) , } #[derive(Debug, PartialEq)] pub enum DeleteOrderResponse { /// Invalid ID supplied InvalidIDSupplied , /// Order not found OrderNotFound , } #[derive(Debug, PartialEq)] pub enum GetInventoryResponse { /// successful operation SuccessfulOperation ( HashMap ) , } #[derive(Debug, PartialEq)] pub enum GetOrderByIdResponse { /// successful operation SuccessfulOperation ( models::Order ) , /// Invalid ID supplied InvalidIDSupplied , /// Order not found OrderNotFound , } #[derive(Debug, PartialEq)] pub enum PlaceOrderResponse { /// successful operation SuccessfulOperation ( models::Order ) , /// Invalid Order InvalidOrder , } #[derive(Debug, PartialEq)] pub enum CreateUserResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum CreateUsersWithArrayInputResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum CreateUsersWithListInputResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum DeleteUserResponse { /// Invalid username supplied InvalidUsernameSupplied , /// User not found UserNotFound , } #[derive(Debug, PartialEq)] pub enum GetUserByNameResponse { /// successful operation SuccessfulOperation ( models::User ) , /// Invalid username supplied InvalidUsernameSupplied , /// User not found UserNotFound , } #[derive(Debug, PartialEq)] pub enum LoginUserResponse { /// successful operation SuccessfulOperation { body: String, x_rate_limit: i32, x_expires_after: chrono::DateTime } , /// Invalid username/password supplied InvalidUsername , } #[derive(Debug, PartialEq)] pub enum LogoutUserResponse { /// successful operation SuccessfulOperation , } #[derive(Debug, PartialEq)] pub enum UpdateUserResponse { /// Invalid user supplied InvalidUserSupplied , /// User not found UserNotFound , } /// API pub trait Api { /// To test special tags fn test_special_tags(&self, client: models::Client, context: &C) -> Box>; fn fake_outer_boolean_serialize(&self, body: Option, context: &C) -> Box>; fn fake_outer_composite_serialize(&self, outer_composite: Option, context: &C) -> Box>; fn fake_outer_number_serialize(&self, body: Option, context: &C) -> Box>; fn fake_outer_string_serialize(&self, body: Option, context: &C) -> Box>; fn test_body_with_query_params(&self, query: String, user: models::User, context: &C) -> Box>; /// To test \"client\" model fn test_client_model(&self, client: models::Client, context: &C) -> Box>; /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &C) -> Box>; /// To test enum parameters fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option, context: &C) -> Box>; /// test inline additionalProperties fn test_inline_additional_properties(&self, request_body: HashMap, context: &C) -> Box>; /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String, context: &C) -> Box>; /// To test class name in snake case fn test_classname(&self, client: models::Client, context: &C) -> Box>; /// Add a new pet to the store fn add_pet(&self, pet: models::Pet, context: &C) -> Box>; /// Deletes a pet fn delete_pet(&self, pet_id: i64, api_key: Option, context: &C) -> Box>; /// Finds Pets by status fn find_pets_by_status(&self, status: &Vec, context: &C) -> Box>; /// Finds Pets by tags fn find_pets_by_tags(&self, tags: &Vec, context: &C) -> Box>; /// Find pet by ID fn get_pet_by_id(&self, pet_id: i64, context: &C) -> Box>; /// Update an existing pet fn update_pet(&self, pet: models::Pet, context: &C) -> Box>; /// Updates a pet in the store with form data fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &C) -> Box>; /// uploads an image fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option, context: &C) -> Box>; /// Delete purchase order by ID fn delete_order(&self, order_id: String, context: &C) -> Box>; /// Returns pet inventories by status fn get_inventory(&self, context: &C) -> Box>; /// Find purchase order by ID fn get_order_by_id(&self, order_id: i64, context: &C) -> Box>; /// Place an order for a pet fn place_order(&self, order: models::Order, context: &C) -> Box>; /// Create user fn create_user(&self, user: models::User, context: &C) -> Box>; /// Creates list of users with given input array fn create_users_with_array_input(&self, user: &Vec, context: &C) -> Box>; /// Creates list of users with given input array fn create_users_with_list_input(&self, user: &Vec, context: &C) -> Box>; /// Delete user fn delete_user(&self, username: String, context: &C) -> Box>; /// Get user by user name fn get_user_by_name(&self, username: String, context: &C) -> Box>; /// Logs user into the system fn login_user(&self, username: String, password: String, context: &C) -> Box>; /// Logs out current logged in user session fn logout_user(&self, context: &C) -> Box>; /// Updated user fn update_user(&self, username: String, user: models::User, context: &C) -> Box>; } /// API without a `Context` pub trait ApiNoContext { /// To test special tags fn test_special_tags(&self, client: models::Client) -> Box>; fn fake_outer_boolean_serialize(&self, body: Option) -> Box>; fn fake_outer_composite_serialize(&self, outer_composite: Option) -> Box>; fn fake_outer_number_serialize(&self, body: Option) -> Box>; fn fake_outer_string_serialize(&self, body: Option) -> Box>; fn test_body_with_query_params(&self, query: String, user: models::User) -> Box>; /// To test \"client\" model fn test_client_model(&self, client: models::Client) -> Box>; /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box>; /// To test enum parameters fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box>; /// test inline additionalProperties fn test_inline_additional_properties(&self, request_body: HashMap) -> Box>; /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String) -> Box>; /// To test class name in snake case fn test_classname(&self, client: models::Client) -> Box>; /// Add a new pet to the store fn add_pet(&self, pet: models::Pet) -> Box>; /// Deletes a pet fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box>; /// Finds Pets by status fn find_pets_by_status(&self, status: &Vec) -> Box>; /// Finds Pets by tags fn find_pets_by_tags(&self, tags: &Vec) -> Box>; /// Find pet by ID fn get_pet_by_id(&self, pet_id: i64) -> Box>; /// Update an existing pet fn update_pet(&self, pet: models::Pet) -> Box>; /// Updates a pet in the store with form data fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box>; /// uploads an image fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box>; /// Delete purchase order by ID fn delete_order(&self, order_id: String) -> Box>; /// Returns pet inventories by status fn get_inventory(&self) -> Box>; /// Find purchase order by ID fn get_order_by_id(&self, order_id: i64) -> Box>; /// Place an order for a pet fn place_order(&self, order: models::Order) -> Box>; /// Create user fn create_user(&self, user: models::User) -> Box>; /// Creates list of users with given input array fn create_users_with_array_input(&self, user: &Vec) -> Box>; /// Creates list of users with given input array fn create_users_with_list_input(&self, user: &Vec) -> Box>; /// Delete user fn delete_user(&self, username: String) -> Box>; /// Get user by user name fn get_user_by_name(&self, username: String) -> Box>; /// Logs user into the system fn login_user(&self, username: String, password: String) -> Box>; /// Logs out current logged in user session fn logout_user(&self) -> Box>; /// Updated user fn update_user(&self, username: String, user: models::User) -> Box>; } /// Trait to extend an API to make it easy to bind it to a context. pub trait ContextWrapperExt<'a, C> where Self: Sized { /// Binds this API to a context. fn with_context(self: &'a Self, context: C) -> ContextWrapper<'a, Self, C>; } impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { fn with_context(self: &'a T, context: C) -> ContextWrapper<'a, T, C> { ContextWrapper::::new(self, context) } } impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { /// To test special tags fn test_special_tags(&self, client: models::Client) -> Box> { self.api().test_special_tags(client, &self.context()) } fn fake_outer_boolean_serialize(&self, body: Option) -> Box> { self.api().fake_outer_boolean_serialize(body, &self.context()) } fn fake_outer_composite_serialize(&self, outer_composite: Option) -> Box> { self.api().fake_outer_composite_serialize(outer_composite, &self.context()) } fn fake_outer_number_serialize(&self, body: Option) -> Box> { self.api().fake_outer_number_serialize(body, &self.context()) } fn fake_outer_string_serialize(&self, body: Option) -> Box> { self.api().fake_outer_string_serialize(body, &self.context()) } fn test_body_with_query_params(&self, query: String, user: models::User) -> Box> { self.api().test_body_with_query_params(query, user, &self.context()) } /// To test \"client\" model fn test_client_model(&self, client: models::Client) -> Box> { self.api().test_client_model(client, &self.context()) } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box> { self.api().test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, &self.context()) } /// To test enum parameters fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box> { self.api().test_enum_parameters(enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, &self.context()) } /// test inline additionalProperties fn test_inline_additional_properties(&self, request_body: HashMap) -> Box> { self.api().test_inline_additional_properties(request_body, &self.context()) } /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String) -> Box> { self.api().test_json_form_data(param, param2, &self.context()) } /// To test class name in snake case fn test_classname(&self, client: models::Client) -> Box> { self.api().test_classname(client, &self.context()) } /// Add a new pet to the store fn add_pet(&self, pet: models::Pet) -> Box> { self.api().add_pet(pet, &self.context()) } /// Deletes a pet fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box> { self.api().delete_pet(pet_id, api_key, &self.context()) } /// Finds Pets by status fn find_pets_by_status(&self, status: &Vec) -> Box> { self.api().find_pets_by_status(status, &self.context()) } /// Finds Pets by tags fn find_pets_by_tags(&self, tags: &Vec) -> Box> { self.api().find_pets_by_tags(tags, &self.context()) } /// Find pet by ID fn get_pet_by_id(&self, pet_id: i64) -> Box> { self.api().get_pet_by_id(pet_id, &self.context()) } /// Update an existing pet fn update_pet(&self, pet: models::Pet) -> Box> { self.api().update_pet(pet, &self.context()) } /// Updates a pet in the store with form data fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box> { self.api().update_pet_with_form(pet_id, name, status, &self.context()) } /// uploads an image fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box> { self.api().upload_file(pet_id, additional_metadata, file, &self.context()) } /// Delete purchase order by ID fn delete_order(&self, order_id: String) -> Box> { self.api().delete_order(order_id, &self.context()) } /// Returns pet inventories by status fn get_inventory(&self) -> Box> { self.api().get_inventory(&self.context()) } /// Find purchase order by ID fn get_order_by_id(&self, order_id: i64) -> Box> { self.api().get_order_by_id(order_id, &self.context()) } /// Place an order for a pet fn place_order(&self, order: models::Order) -> Box> { self.api().place_order(order, &self.context()) } /// Create user fn create_user(&self, user: models::User) -> Box> { self.api().create_user(user, &self.context()) } /// Creates list of users with given input array fn create_users_with_array_input(&self, user: &Vec) -> Box> { self.api().create_users_with_array_input(user, &self.context()) } /// Creates list of users with given input array fn create_users_with_list_input(&self, user: &Vec) -> Box> { self.api().create_users_with_list_input(user, &self.context()) } /// Delete user fn delete_user(&self, username: String) -> Box> { self.api().delete_user(username, &self.context()) } /// Get user by user name fn get_user_by_name(&self, username: String) -> Box> { self.api().get_user_by_name(username, &self.context()) } /// Logs user into the system fn login_user(&self, username: String, password: String) -> Box> { self.api().login_user(username, password, &self.context()) } /// Logs out current logged in user session fn logout_user(&self) -> Box> { self.api().logout_user(&self.context()) } /// Updated user fn update_user(&self, username: String, user: models::User) -> Box> { self.api().update_user(username, user, &self.context()) } } #[cfg(feature = "client")] pub mod client; // Re-export Client as a top-level name #[cfg(feature = "client")] pub use self::client::Client; #[cfg(feature = "server")] pub mod server; // Re-export router() as a top-level name #[cfg(feature = "server")] pub use self::server::Service; pub mod models;