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