chore(codegen): implemented Eq
for OpenApiSchema
This commit is contained in:
parent
c8bdcc81c4
commit
6aaa06f501
|
@ -79,7 +79,7 @@ pub struct OpenApiPathBody<'a> {
|
|||
pub operation_id: Option<OperationId>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct OpenApiPath<'a> {
|
||||
#[serde(borrow)]
|
||||
pub get: OpenApiPathBody<'a>,
|
||||
|
|
|
@ -3,7 +3,7 @@ use serde::Deserialize;
|
|||
|
||||
use super::{parameter::OpenApiParameter, path::OpenApiPath, r#type::OpenApiType};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct Components<'a> {
|
||||
#[serde(borrow)]
|
||||
pub schemas: IndexMap<&'a str, OpenApiType<'a>>,
|
||||
|
@ -11,7 +11,7 @@ pub struct Components<'a> {
|
|||
pub parameters: IndexMap<&'a str, OpenApiParameter<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct OpenApiSchema<'a> {
|
||||
#[serde(borrow)]
|
||||
pub paths: IndexMap<&'a str, OpenApiPath<'a>>,
|
||||
|
|
|
@ -4,12 +4,15 @@ use futures::{Stream, StreamExt};
|
|||
use http::{header::AUTHORIZATION, HeaderMap, HeaderValue};
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::request::{ApiRequest, ApiResponse, IntoRequest};
|
||||
#[cfg(feature = "scopes")]
|
||||
use crate::scopes::{
|
||||
BulkFactionScope, BulkForumScope, BulkMarketScope, BulkRacingScope, BulkTornScope,
|
||||
BulkUserScope, FactionScope, ForumScope, MarketScope, RacingScope, TornScope, UserScope,
|
||||
};
|
||||
use crate::{
|
||||
request::{ApiRequest, ApiResponse, IntoRequest},
|
||||
scopes::{BulkKeyScope, KeyScope},
|
||||
};
|
||||
|
||||
pub trait Executor: Sized {
|
||||
type Error: From<serde_json::Error> + From<crate::ApiError> + Send;
|
||||
|
@ -125,6 +128,8 @@ pub trait ExecutorExt: Executor + Sized {
|
|||
fn racing(self) -> RacingScope<Self>;
|
||||
|
||||
fn forum(self) -> ForumScope<Self>;
|
||||
|
||||
fn key(self) -> KeyScope<Self>;
|
||||
}
|
||||
|
||||
#[cfg(feature = "scopes")]
|
||||
|
@ -155,6 +160,10 @@ where
|
|||
fn forum(self) -> ForumScope<Self> {
|
||||
ForumScope::new(self)
|
||||
}
|
||||
|
||||
fn key(self) -> KeyScope<Self> {
|
||||
KeyScope::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "scopes")]
|
||||
|
@ -170,6 +179,8 @@ pub trait BulkExecutorExt: BulkExecutor + Sized {
|
|||
fn racing_bulk(self) -> BulkRacingScope<Self>;
|
||||
|
||||
fn forum_bulk(self) -> BulkForumScope<Self>;
|
||||
|
||||
fn key_bulk(self) -> BulkKeyScope<Self>;
|
||||
}
|
||||
|
||||
#[cfg(feature = "scopes")]
|
||||
|
@ -200,6 +211,10 @@ where
|
|||
fn forum_bulk(self) -> BulkForumScope<Self> {
|
||||
BulkForumScope::new(self)
|
||||
}
|
||||
|
||||
fn key_bulk(self) -> BulkKeyScope<Self> {
|
||||
BulkKeyScope::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ReqwestClient(reqwest::Client);
|
||||
|
|
|
@ -970,4 +970,18 @@ pub(super) mod test {
|
|||
|
||||
client.user().reports(|b| b).await.unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn key_info() {
|
||||
let client = test_client().await;
|
||||
|
||||
client.key().info(|b| b).await.unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn key_log() {
|
||||
let client = test_client().await;
|
||||
|
||||
client.key().log(|b| b).await.unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue