change version to string
This commit is contained in:
parent
a69c90ec6d
commit
6e8e9f59a2
4 changed files with 85 additions and 83 deletions
|
|
@ -516,7 +516,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes existing tag category. The tag category to be deleted must have no usages.
|
/// Deletes existing tag category. The tag category to be deleted must have no usages.
|
||||||
pub async fn delete_tag_category<T>(&self, name: T, version: u32) -> SzurubooruResult<()>
|
pub async fn delete_tag_category<T>(&self, name: T, version: String) -> SzurubooruResult<()>
|
||||||
where
|
where
|
||||||
T: AsRef<str> + Display,
|
T: AsRef<str> + Display,
|
||||||
{
|
{
|
||||||
|
|
@ -593,7 +593,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes existing tag. The tag to be deleted must have no usages.
|
/// Deletes existing tag. The tag to be deleted must have no usages.
|
||||||
pub async fn delete_tag<T>(&self, name: T, version: u32) -> SzurubooruResult<()>
|
pub async fn delete_tag<T>(&self, name: T, version: String) -> SzurubooruResult<()>
|
||||||
where
|
where
|
||||||
T: AsRef<str> + Display,
|
T: AsRef<str> + Display,
|
||||||
{
|
{
|
||||||
|
|
@ -1127,7 +1127,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes existing post. Related posts and tags are kept.
|
/// Deletes existing post. Related posts and tags are kept.
|
||||||
pub async fn delete_post(&self, post_id: u32, version: u32) -> SzurubooruResult<()> {
|
pub async fn delete_post(&self, post_id: u32, version: String) -> SzurubooruResult<()> {
|
||||||
let path = format!("/api/post/{post_id}");
|
let path = format!("/api/post/{post_id}");
|
||||||
let version_obj = ResourceVersion { version };
|
let version_obj = ResourceVersion { version };
|
||||||
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
||||||
|
|
@ -1249,7 +1249,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
pub async fn delete_pool_category<T>(
|
pub async fn delete_pool_category<T>(
|
||||||
&self,
|
&self,
|
||||||
category_name: T,
|
category_name: T,
|
||||||
version: u32,
|
version: String,
|
||||||
) -> SzurubooruResult<()>
|
) -> SzurubooruResult<()>
|
||||||
where
|
where
|
||||||
T: AsRef<str> + Display,
|
T: AsRef<str> + Display,
|
||||||
|
|
@ -1330,7 +1330,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
|
|
||||||
/// Deletes existing pool. All posts in the pool will only have their relation to the pool
|
/// Deletes existing pool. All posts in the pool will only have their relation to the pool
|
||||||
/// removed.
|
/// removed.
|
||||||
pub async fn delete_pool(&self, pool_id: u32, version: u32) -> SzurubooruResult<()> {
|
pub async fn delete_pool(&self, pool_id: u32, version: String) -> SzurubooruResult<()> {
|
||||||
let path = format!("/api/pool/{pool_id}");
|
let path = format!("/api/pool/{pool_id}");
|
||||||
let version_obj = ResourceVersion { version };
|
let version_obj = ResourceVersion { version };
|
||||||
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
||||||
|
|
@ -1384,7 +1384,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes existing comment
|
/// Deletes existing comment
|
||||||
pub async fn delete_comment(&self, comment_id: u32, version: u32) -> SzurubooruResult<()> {
|
pub async fn delete_comment(&self, comment_id: u32, version: String) -> SzurubooruResult<()> {
|
||||||
let path = format!("/api/comment/{comment_id}");
|
let path = format!("/api/comment/{comment_id}");
|
||||||
let version_obj = ResourceVersion { version };
|
let version_obj = ResourceVersion { version };
|
||||||
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
self.do_request::<Value, _, _>(Method::DELETE, &path, None, Some(&version_obj))
|
||||||
|
|
@ -1590,7 +1590,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes existing user
|
/// Deletes existing user
|
||||||
pub async fn delete_user<T>(&self, name: T, version: u32) -> SzurubooruResult<()>
|
pub async fn delete_user<T>(&self, name: T, version: String) -> SzurubooruResult<()>
|
||||||
where
|
where
|
||||||
T: AsRef<str> + Display,
|
T: AsRef<str> + Display,
|
||||||
{
|
{
|
||||||
|
|
@ -1656,7 +1656,7 @@ impl<'a> SzurubooruRequest<'a> {
|
||||||
&self,
|
&self,
|
||||||
name: T,
|
name: T,
|
||||||
token: T,
|
token: T,
|
||||||
version: u32,
|
version: String,
|
||||||
) -> SzurubooruResult<()>
|
) -> SzurubooruResult<()>
|
||||||
where
|
where
|
||||||
T: AsRef<str> + Display,
|
T: AsRef<str> + Display,
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@
|
||||||
//! See [here](https://github.com/rr-/szurubooru/blob/master/doc/API.md#field-selecting) for
|
//! See [here](https://github.com/rr-/szurubooru/blob/master/doc/API.md#field-selecting) for
|
||||||
//! more information.
|
//! more information.
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
|
||||||
use crate::errors::SzurubooruClientError;
|
use crate::errors::SzurubooruClientError;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use derive_builder::Builder;
|
use derive_builder::Builder;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::cmp::Ordering;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use strum_macros::AsRefStr;
|
use strum_macros::AsRefStr;
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ impl MicroTagResource {
|
||||||
/// ```json
|
/// ```json
|
||||||
/// {
|
/// {
|
||||||
/// ...,
|
/// ...,
|
||||||
/// "version": 2
|
/// "version": "2026-08-16T14:45:37.088202Z"
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
@ -134,7 +134,7 @@ impl MicroTagResource {
|
||||||
/// encouraged to notify the user about the situation.
|
/// encouraged to notify the user about the situation.
|
||||||
pub struct ResourceVersion {
|
pub struct ResourceVersion {
|
||||||
/// The version itself
|
/// The version itself
|
||||||
pub version: u32,
|
pub version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
||||||
|
|
@ -146,7 +146,7 @@ pub struct ResourceVersion {
|
||||||
/// A single tag. Tags are used to let users search for posts.
|
/// A single tag. Tags are used to let users search for posts.
|
||||||
pub struct TagResource {
|
pub struct TagResource {
|
||||||
/// resource version. See [versioning](ResourceVersion)
|
/// resource version. See [versioning](ResourceVersion)
|
||||||
pub version: u32,
|
pub version: String,
|
||||||
/// a list of tag names (aliases). Tagging a post with any name will automatically assign
|
/// a list of tag names (aliases). Tagging a post with any name will automatically assign
|
||||||
/// the first name from this list.
|
/// the first name from this list.
|
||||||
pub names: Option<Vec<String>>,
|
pub names: Option<Vec<String>>,
|
||||||
|
|
@ -202,7 +202,7 @@ pub struct CreateUpdateTag {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
/// resource version. See [versioning](ResourceVersion)
|
/// resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
/// Tag names and aliases, must match `tag_name_regex` from the server's configuration
|
/// Tag names and aliases, must match `tag_name_regex` from the server's configuration
|
||||||
|
|
@ -234,7 +234,7 @@ pub struct CreateUpdateTag {
|
||||||
/// types (such as characters, media type etc.), which improves user experience.
|
/// types (such as characters, media type etc.), which improves user experience.
|
||||||
pub struct TagCategoryResource {
|
pub struct TagCategoryResource {
|
||||||
/// resource version. See [versioning](ResourceVersion)
|
/// resource version. See [versioning](ResourceVersion)
|
||||||
pub version: u32,
|
pub version: String,
|
||||||
/// The name of the tag category
|
/// The name of the tag category
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
/// The display color of the tag category
|
/// The display color of the tag category
|
||||||
|
|
@ -265,7 +265,7 @@ pub struct CreateUpdateTagCategory {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The name of the category to create
|
/// The name of the category to create
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
|
|
@ -288,12 +288,12 @@ pub struct CreateUpdateTagCategory {
|
||||||
pub struct MergeTags {
|
pub struct MergeTags {
|
||||||
/// Version of the tag to remove
|
/// Version of the tag to remove
|
||||||
#[serde(rename = "removeVersion")]
|
#[serde(rename = "removeVersion")]
|
||||||
pub remove_tag_version: u32,
|
pub remove_tag_version: String,
|
||||||
/// The name of the tag to remove
|
/// The name of the tag to remove
|
||||||
#[serde(rename = "remove")]
|
#[serde(rename = "remove")]
|
||||||
pub remove_tag: String,
|
pub remove_tag: String,
|
||||||
/// The version of the tag to merge TO
|
/// The version of the tag to merge TO
|
||||||
pub merge_to_version: u32,
|
pub merge_to_version: String,
|
||||||
/// The name of the tag to merge TO
|
/// The name of the tag to merge TO
|
||||||
#[serde(rename = "mergeTo")]
|
#[serde(rename = "mergeTo")]
|
||||||
pub merge_to_tag: String,
|
pub merge_to_tag: String,
|
||||||
|
|
@ -420,7 +420,7 @@ pub(crate) struct PostId {
|
||||||
/// A post resource
|
/// A post resource
|
||||||
pub struct PostResource {
|
pub struct PostResource {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The post identifier
|
/// The post identifier
|
||||||
pub id: Option<u32>,
|
pub id: Option<u32>,
|
||||||
/// Time the post was created
|
/// Time the post was created
|
||||||
|
|
@ -545,7 +545,7 @@ pub struct CreateUpdatePost {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// Tags to use for this post. If specified tags do not exist yet, they will be automatically
|
/// Tags to use for this post. If specified tags do not exist yet, they will be automatically
|
||||||
/// created. Tags created automatically have no implications, no suggestions, one name and
|
/// created. Tags created automatically have no implications, no suggestions, one name and
|
||||||
/// their category is set to the first tag category found
|
/// their category is set to the first tag category found
|
||||||
|
|
@ -606,12 +606,12 @@ pub struct TemporaryFileUpload {
|
||||||
pub struct MergePost {
|
pub struct MergePost {
|
||||||
/// The version of the post to remove
|
/// The version of the post to remove
|
||||||
#[serde(rename = "removeVersion")]
|
#[serde(rename = "removeVersion")]
|
||||||
pub remove_post_version: u32,
|
pub remove_post_version: String,
|
||||||
/// The ID of the post to remove
|
/// The ID of the post to remove
|
||||||
#[serde(rename = "remove")]
|
#[serde(rename = "remove")]
|
||||||
pub remove_post: u32,
|
pub remove_post: u32,
|
||||||
/// The version of the post to merge TO
|
/// The version of the post to merge TO
|
||||||
pub merge_to_version: u32,
|
pub merge_to_version: String,
|
||||||
/// The post ID of the post to merge TO
|
/// The post ID of the post to merge TO
|
||||||
#[serde(rename = "mergeTo")]
|
#[serde(rename = "mergeTo")]
|
||||||
pub merge_to_post: u32,
|
pub merge_to_post: u32,
|
||||||
|
|
@ -645,11 +645,13 @@ pub struct NoteResource {
|
||||||
|
|
||||||
impl PartialEq for NoteResource {
|
impl PartialEq for NoteResource {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
self.text == other.text &&
|
self.text == other.text
|
||||||
self.polygon.len() == other.polygon.len() &&
|
&& self.polygon.len() == other.polygon.len()
|
||||||
self.polygon.iter().zip(other.polygon.iter()).all(|(a, b)| {
|
&& self.polygon.iter().zip(other.polygon.iter()).all(|(a, b)| {
|
||||||
a.len() == b.len() &&
|
a.len() == b.len()
|
||||||
a.iter().zip(b.iter()).all(|(a, b)| a.total_cmp(b) == Ordering::Equal)
|
&& a.iter()
|
||||||
|
.zip(b.iter())
|
||||||
|
.all(|(a, b)| a.total_cmp(b) == Ordering::Equal)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -711,11 +713,11 @@ pub struct UserResource {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[cfg(feature = "python")]
|
#[cfg(feature = "python")]
|
||||||
#[pyo3(get)]
|
#[pyo3(get)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
|
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[cfg(not(feature = "python"))]
|
#[cfg(not(feature = "python"))]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
|
|
||||||
/// The user's username
|
/// The user's username
|
||||||
#[cfg(feature = "python")]
|
#[cfg(feature = "python")]
|
||||||
|
|
@ -896,7 +898,7 @@ pub struct CreateUpdateUser {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The username
|
/// The username
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
|
@ -972,7 +974,7 @@ pub struct UserAuthTokenResource {
|
||||||
/// Time when the token expires
|
/// Time when the token expires
|
||||||
pub expiration_time: Option<DateTime<Utc>>,
|
pub expiration_time: Option<DateTime<Utc>>,
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// time the user token was created
|
/// time the user token was created
|
||||||
pub creation_time: Option<DateTime<Utc>>,
|
pub creation_time: Option<DateTime<Utc>>,
|
||||||
/// time the user token was edited
|
/// time the user token was edited
|
||||||
|
|
@ -1009,7 +1011,7 @@ pub struct CreateUpdateUserAuthToken {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// Whether the token is still valid for authentication
|
/// Whether the token is still valid for authentication
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
|
|
@ -1112,7 +1114,7 @@ impl GlobalInfo {
|
||||||
/// types (such as series, relations etc.), which improves user experience.
|
/// types (such as series, relations etc.), which improves user experience.
|
||||||
pub struct PoolCategoryResource {
|
pub struct PoolCategoryResource {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The category name
|
/// The category name
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
/// The category color
|
/// The category color
|
||||||
|
|
@ -1151,7 +1153,7 @@ pub struct CreateUpdatePoolCategory {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
/// Category version (used for updating)
|
/// Category version (used for updating)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// Category name
|
/// Category name
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
|
|
@ -1171,7 +1173,7 @@ pub struct CreateUpdatePoolCategory {
|
||||||
/// Type that represents a Pool resource
|
/// Type that represents a Pool resource
|
||||||
pub struct PoolResource {
|
pub struct PoolResource {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The pool identifier
|
/// The pool identifier
|
||||||
pub id: Option<u32>,
|
pub id: Option<u32>,
|
||||||
/// A list of pool names (aliases)
|
/// A list of pool names (aliases)
|
||||||
|
|
@ -1229,7 +1231,7 @@ pub struct CreateUpdatePool {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// Names and aliases for this pool. When creating a new pool the first name in this list
|
/// Names and aliases for this pool. When creating a new pool the first name in this list
|
||||||
/// is used as the pool name
|
/// is used as the pool name
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
|
|
@ -1269,12 +1271,12 @@ pub struct CreateUpdatePool {
|
||||||
pub struct MergePool {
|
pub struct MergePool {
|
||||||
/// Version of the pool to remove. Must match the current Pool version
|
/// Version of the pool to remove. Must match the current Pool version
|
||||||
#[serde(rename = "removeVersion")]
|
#[serde(rename = "removeVersion")]
|
||||||
pub remove_pool_version: u32,
|
pub remove_pool_version: String,
|
||||||
/// Pool ID to remove
|
/// Pool ID to remove
|
||||||
#[serde(rename = "remove")]
|
#[serde(rename = "remove")]
|
||||||
pub remove_pool: u32,
|
pub remove_pool: u32,
|
||||||
/// Version of the pool to merge TO
|
/// Version of the pool to merge TO
|
||||||
pub merge_to_version: u32,
|
pub merge_to_version: String,
|
||||||
/// Pool ID of the pool to merge TO
|
/// Pool ID of the pool to merge TO
|
||||||
#[serde(rename = "mergeTo")]
|
#[serde(rename = "mergeTo")]
|
||||||
pub merge_to_pool: u32,
|
pub merge_to_pool: u32,
|
||||||
|
|
@ -1319,7 +1321,7 @@ impl MicroPoolResource {
|
||||||
/// A type representing a Comment on a post
|
/// A type representing a Comment on a post
|
||||||
pub struct CommentResource {
|
pub struct CommentResource {
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The comment ID
|
/// The comment ID
|
||||||
pub id: Option<u32>,
|
pub id: Option<u32>,
|
||||||
/// The post ID this comment belongs to
|
/// The post ID this comment belongs to
|
||||||
|
|
@ -1369,7 +1371,7 @@ pub struct CreateUpdateComment {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
/// Resource version. See [versioning](ResourceVersion)
|
/// Resource version. See [versioning](ResourceVersion)
|
||||||
/// Omitted when creating a new comment
|
/// Omitted when creating a new comment
|
||||||
pub version: Option<u32>,
|
pub version: Option<String>,
|
||||||
/// The text of the comment
|
/// The text of the comment
|
||||||
pub text: String,
|
pub text: String,
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_tag_category(
|
pub async fn update_tag_category(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
color: Option<String>,
|
color: Option<String>,
|
||||||
order: Option<u32>,
|
order: Option<u32>,
|
||||||
|
|
@ -147,7 +147,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes a tag category (async version)
|
/// Deletes a tag category (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_tag_category` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_tag_category` for parameters and return type
|
||||||
pub async fn delete_tag_category(&self, name: String, version: u32) -> PyResult<()> {
|
pub async fn delete_tag_category(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_tag_category(name, version)
|
.delete_tag_category(name, version)
|
||||||
|
|
@ -241,7 +241,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_tag(
|
pub async fn update_tag(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
names: Option<Py<PyAny>>,
|
names: Option<Py<PyAny>>,
|
||||||
category: Option<String>,
|
category: Option<String>,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
|
|
@ -305,7 +305,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes an existing tag (async version)
|
/// Deletes an existing tag (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_tag` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_tag` for parameters and return type
|
||||||
pub async fn delete_tag(&self, name: String, version: u32) -> PyResult<()> {
|
pub async fn delete_tag(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_tag(name, version)
|
.delete_tag(name, version)
|
||||||
|
|
@ -321,9 +321,9 @@ impl PythonAsyncClient {
|
||||||
pub async fn merge_tags(
|
pub async fn merge_tags(
|
||||||
&self,
|
&self,
|
||||||
remove_tag: String,
|
remove_tag: String,
|
||||||
remove_tag_version: u32,
|
remove_tag_version: String,
|
||||||
merge_to_tag: String,
|
merge_to_tag: String,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<TagResource> {
|
) -> PyResult<TagResource> {
|
||||||
let mtags = MergeTagsBuilder::default()
|
let mtags = MergeTagsBuilder::default()
|
||||||
|
|
@ -458,7 +458,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_post(
|
pub async fn update_post(
|
||||||
&self,
|
&self,
|
||||||
post_id: u32,
|
post_id: u32,
|
||||||
post_version: u32,
|
post_version: String,
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
token: Option<String>,
|
token: Option<String>,
|
||||||
file_path: Option<PathBuf>,
|
file_path: Option<PathBuf>,
|
||||||
|
|
@ -636,7 +636,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes a post by its ID (async version)
|
/// Deletes a post by its ID (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_post` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_post` for parameters and return type
|
||||||
pub async fn delete_post(&self, post_id: u32, version: u32) -> PyResult<()> {
|
pub async fn delete_post(&self, post_id: u32, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_post(post_id, version)
|
.delete_post(post_id, version)
|
||||||
|
|
@ -653,9 +653,9 @@ impl PythonAsyncClient {
|
||||||
pub async fn merge_post(
|
pub async fn merge_post(
|
||||||
&self,
|
&self,
|
||||||
remove_post: u32,
|
remove_post: u32,
|
||||||
remove_post_version: u32,
|
remove_post_version: String,
|
||||||
merge_to_post: u32,
|
merge_to_post: u32,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
replace_post_content: bool,
|
replace_post_content: bool,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<PostResource> {
|
) -> PyResult<PostResource> {
|
||||||
|
|
@ -804,7 +804,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_pool_category(
|
pub async fn update_pool_category(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
color: Option<String>,
|
color: Option<String>,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
|
|
@ -844,7 +844,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes existing pool category (async version)
|
/// Deletes existing pool category (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_pool_category` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_pool_category` for parameters and return type
|
||||||
pub async fn delete_pool_category(&self, name: String, version: u32) -> PyResult<()> {
|
pub async fn delete_pool_category(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_pool_category(name, version)
|
.delete_pool_category(name, version)
|
||||||
|
|
@ -941,7 +941,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_pool(
|
pub async fn update_pool(
|
||||||
&self,
|
&self,
|
||||||
pool_id: u32,
|
pool_id: u32,
|
||||||
version: u32,
|
version: String,
|
||||||
new_names: Option<Vec<String>>,
|
new_names: Option<Vec<String>>,
|
||||||
category: Option<String>,
|
category: Option<String>,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
|
|
@ -990,7 +990,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes existing pool (async version)
|
/// Deletes existing pool (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_pool` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_pool` for parameters and return type
|
||||||
pub async fn delete_pool(&self, pool_id: u32, version: u32) -> PyResult<()> {
|
pub async fn delete_pool(&self, pool_id: u32, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_pool(pool_id, version)
|
.delete_pool(pool_id, version)
|
||||||
|
|
@ -1005,9 +1005,9 @@ impl PythonAsyncClient {
|
||||||
pub async fn merge_pools(
|
pub async fn merge_pools(
|
||||||
&self,
|
&self,
|
||||||
remove_pool: u32,
|
remove_pool: u32,
|
||||||
remove_pool_version: u32,
|
remove_pool_version: String,
|
||||||
merge_to_pool: u32,
|
merge_to_pool: u32,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<PoolResource> {
|
) -> PyResult<PoolResource> {
|
||||||
let mpool = MergePoolBuilder::default()
|
let mpool = MergePoolBuilder::default()
|
||||||
|
|
@ -1073,7 +1073,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_comment(
|
pub async fn update_comment(
|
||||||
&self,
|
&self,
|
||||||
comment_id: u32,
|
comment_id: u32,
|
||||||
version: u32,
|
version: String,
|
||||||
text: String,
|
text: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<CommentResource> {
|
) -> PyResult<CommentResource> {
|
||||||
|
|
@ -1108,7 +1108,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes an existing comment (async version)
|
/// Deletes an existing comment (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_comment` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_comment` for parameters and return type
|
||||||
pub async fn delete_comment(&self, comment_id: u32, version: u32) -> PyResult<()> {
|
pub async fn delete_comment(&self, comment_id: u32, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_comment(comment_id, version)
|
.delete_comment(comment_id, version)
|
||||||
|
|
@ -1200,7 +1200,7 @@ impl PythonAsyncClient {
|
||||||
pub async fn update_user(
|
pub async fn update_user(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
password: Option<String>,
|
password: Option<String>,
|
||||||
rank: Option<UserRank>,
|
rank: Option<UserRank>,
|
||||||
|
|
@ -1256,7 +1256,7 @@ impl PythonAsyncClient {
|
||||||
/// Deletes an existing user (async version)
|
/// Deletes an existing user (async version)
|
||||||
///
|
///
|
||||||
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_user` for parameters and return type
|
/// :see: :func:`~szurubooru_client.SzurubooruSyncClient.delete_user` for parameters and return type
|
||||||
pub async fn delete_user(&self, user_name: String, version: u32) -> PyResult<()> {
|
pub async fn delete_user(&self, user_name: String, version: String) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
.delete_user(user_name, version)
|
.delete_user(user_name, version)
|
||||||
|
|
@ -1320,7 +1320,7 @@ impl PythonAsyncClient {
|
||||||
&self,
|
&self,
|
||||||
user_name: String,
|
user_name: String,
|
||||||
token: String,
|
token: String,
|
||||||
version: u32,
|
version: String,
|
||||||
enabled: Option<bool>,
|
enabled: Option<bool>,
|
||||||
note: Option<String>,
|
note: Option<String>,
|
||||||
expiration_time: Option<DateTime<Utc>>,
|
expiration_time: Option<DateTime<Utc>>,
|
||||||
|
|
@ -1352,7 +1352,7 @@ impl PythonAsyncClient {
|
||||||
&self,
|
&self,
|
||||||
user_name: String,
|
user_name: String,
|
||||||
token: String,
|
token: String,
|
||||||
version: u32,
|
version: String,
|
||||||
) -> PyResult<()> {
|
) -> PyResult<()> {
|
||||||
self.client
|
self.client
|
||||||
.request()
|
.request()
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_tag_category(
|
pub fn update_tag_category(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
color: Option<String>,
|
color: Option<String>,
|
||||||
order: Option<u32>,
|
order: Option<u32>,
|
||||||
|
|
@ -144,7 +144,7 @@ impl PythonSyncClient {
|
||||||
/// :param str name: The tag category's name
|
/// :param str name: The tag category's name
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
///
|
///
|
||||||
pub fn delete_tag_category(&self, name: String, version: u32) -> PyResult<()> {
|
pub fn delete_tag_category(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_tag_category(name, version))
|
.block_on(self.client.delete_tag_category(name, version))
|
||||||
}
|
}
|
||||||
|
|
@ -262,7 +262,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_tag(
|
pub fn update_tag(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
names: Option<Py<PyAny>>,
|
names: Option<Py<PyAny>>,
|
||||||
category: Option<String>,
|
category: Option<String>,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
|
|
@ -305,7 +305,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param str name: The name of the tag to delete
|
/// :param str name: The name of the tag to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_tag(&self, name: String, version: u32) -> PyResult<()> {
|
pub fn delete_tag(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.runtime.block_on(self.client.delete_tag(name, version))
|
self.runtime.block_on(self.client.delete_tag(name, version))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -331,9 +331,9 @@ impl PythonSyncClient {
|
||||||
pub fn merge_tags(
|
pub fn merge_tags(
|
||||||
&self,
|
&self,
|
||||||
remove_tag: String,
|
remove_tag: String,
|
||||||
remove_tag_version: u32,
|
remove_tag_version: String,
|
||||||
merge_to_tag: String,
|
merge_to_tag: String,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<TagResource> {
|
) -> PyResult<TagResource> {
|
||||||
self.runtime.block_on(self.client.merge_tags(
|
self.runtime.block_on(self.client.merge_tags(
|
||||||
|
|
@ -490,7 +490,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_post(
|
pub fn update_post(
|
||||||
&self,
|
&self,
|
||||||
post_id: u32,
|
post_id: u32,
|
||||||
post_version: u32,
|
post_version: String,
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
token: Option<String>,
|
token: Option<String>,
|
||||||
file_path: Option<PathBuf>,
|
file_path: Option<PathBuf>,
|
||||||
|
|
@ -623,7 +623,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param int post_id: The ID of the post to delete
|
/// :param int post_id: The ID of the post to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_post(&self, post_id: u32, version: u32) -> PyResult<()> {
|
pub fn delete_post(&self, post_id: u32, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_post(post_id, version))
|
.block_on(self.client.delete_post(post_id, version))
|
||||||
}
|
}
|
||||||
|
|
@ -654,9 +654,9 @@ impl PythonSyncClient {
|
||||||
pub fn merge_post(
|
pub fn merge_post(
|
||||||
&self,
|
&self,
|
||||||
remove_post: u32,
|
remove_post: u32,
|
||||||
remove_post_version: u32,
|
remove_post_version: String,
|
||||||
merge_to_post: u32,
|
merge_to_post: u32,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
replace_post_content: bool,
|
replace_post_content: bool,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<PostResource> {
|
) -> PyResult<PostResource> {
|
||||||
|
|
@ -829,7 +829,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_pool_category(
|
pub fn update_pool_category(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
color: Option<String>,
|
color: Option<String>,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
|
|
@ -868,7 +868,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param str name: The name of the pool category to delete
|
/// :param str name: The name of the pool category to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_pool_category(&self, name: String, version: u32) -> PyResult<()> {
|
pub fn delete_pool_category(&self, name: String, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_pool_category(name, version))
|
.block_on(self.client.delete_pool_category(name, version))
|
||||||
}
|
}
|
||||||
|
|
@ -988,7 +988,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_pool(
|
pub fn update_pool(
|
||||||
&self,
|
&self,
|
||||||
pool_id: u32,
|
pool_id: u32,
|
||||||
version: u32,
|
version: String,
|
||||||
new_names: Option<Vec<String>>,
|
new_names: Option<Vec<String>>,
|
||||||
category: Option<String>,
|
category: Option<String>,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
|
|
@ -1030,7 +1030,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param int pool_id: The ID of the pool to delete
|
/// :param int pool_id: The ID of the pool to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_pool(&self, pool_id: u32, version: u32) -> PyResult<()> {
|
pub fn delete_pool(&self, pool_id: u32, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_pool(pool_id, version))
|
.block_on(self.client.delete_pool(pool_id, version))
|
||||||
}
|
}
|
||||||
|
|
@ -1056,9 +1056,9 @@ impl PythonSyncClient {
|
||||||
pub fn merge_pools(
|
pub fn merge_pools(
|
||||||
&self,
|
&self,
|
||||||
remove_pool: u32,
|
remove_pool: u32,
|
||||||
remove_pool_version: u32,
|
remove_pool_version: String,
|
||||||
merge_to_pool: u32,
|
merge_to_pool: u32,
|
||||||
merge_to_version: u32,
|
merge_to_version: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<PoolResource> {
|
) -> PyResult<PoolResource> {
|
||||||
self.runtime.block_on(self.client.merge_pools(
|
self.runtime.block_on(self.client.merge_pools(
|
||||||
|
|
@ -1147,7 +1147,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_comment(
|
pub fn update_comment(
|
||||||
&self,
|
&self,
|
||||||
comment_id: u32,
|
comment_id: u32,
|
||||||
version: u32,
|
version: String,
|
||||||
text: String,
|
text: String,
|
||||||
fields: Option<Vec<String>>,
|
fields: Option<Vec<String>>,
|
||||||
) -> PyResult<CommentResource> {
|
) -> PyResult<CommentResource> {
|
||||||
|
|
@ -1185,7 +1185,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param int comment_id: The ID of the comment to delete
|
/// :param int comment_id: The ID of the comment to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_comment(&self, comment_id: u32, version: u32) -> PyResult<()> {
|
pub fn delete_comment(&self, comment_id: u32, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_comment(comment_id, version))
|
.block_on(self.client.delete_comment(comment_id, version))
|
||||||
}
|
}
|
||||||
|
|
@ -1312,7 +1312,7 @@ impl PythonSyncClient {
|
||||||
pub fn update_user(
|
pub fn update_user(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
version: u32,
|
version: String,
|
||||||
new_name: Option<String>,
|
new_name: Option<String>,
|
||||||
password: Option<String>,
|
password: Option<String>,
|
||||||
rank: Option<UserRank>,
|
rank: Option<UserRank>,
|
||||||
|
|
@ -1358,7 +1358,7 @@ impl PythonSyncClient {
|
||||||
///
|
///
|
||||||
/// :param str user_name: The username of the user to delete
|
/// :param str user_name: The username of the user to delete
|
||||||
/// :param int version: The existing resource's version
|
/// :param int version: The existing resource's version
|
||||||
pub fn delete_user(&self, user_name: String, version: u32) -> PyResult<()> {
|
pub fn delete_user(&self, user_name: String, version: String) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_user(user_name, version))
|
.block_on(self.client.delete_user(user_name, version))
|
||||||
}
|
}
|
||||||
|
|
@ -1438,7 +1438,7 @@ impl PythonSyncClient {
|
||||||
&self,
|
&self,
|
||||||
user_name: String,
|
user_name: String,
|
||||||
token: String,
|
token: String,
|
||||||
version: u32,
|
version: String,
|
||||||
enabled: Option<bool>,
|
enabled: Option<bool>,
|
||||||
note: Option<String>,
|
note: Option<String>,
|
||||||
expiration_time: Option<DateTime<Utc>>,
|
expiration_time: Option<DateTime<Utc>>,
|
||||||
|
|
@ -1468,7 +1468,7 @@ impl PythonSyncClient {
|
||||||
&self,
|
&self,
|
||||||
user_name: String,
|
user_name: String,
|
||||||
token: String,
|
token: String,
|
||||||
version: u32,
|
version: String,
|
||||||
) -> PyResult<()> {
|
) -> PyResult<()> {
|
||||||
self.runtime
|
self.runtime
|
||||||
.block_on(self.client.delete_user_token(user_name, token, version))
|
.block_on(self.client.delete_user_token(user_name, token, version))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue