From 669be07c683290a43f8a9dd740155c767fde62b2 Mon Sep 17 00:00:00 2001 From: Scott Lyons Date: Thu, 15 Aug 2024 09:13:19 -0700 Subject: [PATCH] refactor(models): removing unnecessary python classes --- szurubooru-client/src/lib.rs | 5 ++--- szurubooru-client/src/models.rs | 9 +-------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/szurubooru-client/src/lib.rs b/szurubooru-client/src/lib.rs index 5f931df..3cdc990 100644 --- a/szurubooru-client/src/lib.rs +++ b/szurubooru-client/src/lib.rs @@ -47,15 +47,14 @@ use pyo3::prelude::*; #[cfg(feature = "python")] #[cfg_attr(feature = "python", pymodule)] +/// A Python wrapper around [SzurubooruClient] mod szurubooru_client { use pyo3::prelude::*; #[pymodule_export] pub use crate::{ models::{ - AroundPostResult, CommentResource, CreateUpdateComment, CreateUpdatePool, - CreateUpdatePoolCategory, CreateUpdatePost, CreateUpdateTag, CreateUpdateTagCategory, - CreateUpdateUser, CreateUpdateUserAuthToken, GlobalInfo, ImageSearchResult, + AroundPostResult, CommentResource, GlobalInfo, ImageSearchResult, ImageSearchSimilarPost, MergePool, MergePost, MergeTags, MicroPoolResource, MicroPostResource, MicroTagResource, MicroUserResource, NoteResource, PoolCategoryResource, PoolResource, PostResource, PostSafety, PostType, diff --git a/szurubooru-client/src/models.rs b/szurubooru-client/src/models.rs index 94e7125..9c21597 100644 --- a/szurubooru-client/src/models.rs +++ b/szurubooru-client/src/models.rs @@ -186,7 +186,6 @@ impl TagResource { /// ``` #[derive(Debug, Clone, Serialize, Deserialize, Builder, Default)] //#[builder(pattern="owned")] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] pub struct CreateUpdateTag { #[serde(skip_serializing_if = "Option::is_none")] @@ -244,7 +243,7 @@ impl TagCategoryResource { #[derive(Debug, Clone, Serialize, Deserialize, Default, Builder)] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] + /// Used for creating or updating a Tag Category pub struct CreateUpdateTagCategory { /// Resource version. See [versioning](ResourceVersion) @@ -499,7 +498,6 @@ impl WithBaseURL for PostResource { } #[derive(Debug, Clone, Serialize, Deserialize, Builder)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] #[serde(rename_all = "camelCase")] /// A `struct` used to create or update a post. For updating purposes @@ -774,7 +772,6 @@ impl WithBaseURL for UserResource { } #[derive(Debug, Clone, Serialize, Deserialize, Default, Builder)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] #[serde(rename_all = "camelCase")] /// `struct` used to create or update a user resource. The version field is only used when @@ -878,7 +875,6 @@ impl WithBaseURL for UserAuthTokenResource { } #[derive(Debug, Clone, Serialize, Deserialize, Builder, Default)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(into, strip_option), build_fn(error = "SzurubooruClientError"))] #[serde(rename_all = "kebab-case")] /// `struct` to create or update a UserAuthToken. `version` is only required when updating an @@ -999,7 +995,6 @@ impl PoolCategoryResource { } #[derive(Debug, Clone, Serialize, Deserialize, Builder)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] /// `struct` used for creating or updating a pool category. This type uses a Builder pattern like /// so: @@ -1072,7 +1067,6 @@ impl WithBaseURL for PoolResource { } #[derive(Debug, Clone, Serialize, Deserialize, Builder, Default)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] #[serde(rename_all = "camelCase")] /// This type is used when creating or updating a pool object. It uses the builder pattern like so: @@ -1202,7 +1196,6 @@ impl CommentResource { } #[derive(Debug, Clone, Serialize, Deserialize, Builder, Default)] -#[cfg_attr(all(feature = "python"), pyclass(get_all))] #[builder(setter(strip_option), build_fn(error = "SzurubooruClientError"))] #[serde(rename_all = "camelCase")] /// This type is used when creating or updating a comment. This type uses the builder pattern like