redditwarp.siteprocs.draft.SYNC
#
- class redditwarp.siteprocs.draft.SYNC.DraftProcedures(client: Client)[source]#
Bases:
object
- retrieve() SubmissionDraftList [source]#
Retrieve the current user’s drafts.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
- read_public(user: str, uuid: str) SubmissionDraft [source]#
Read a public draft.
- Parameters:
user (str) – User name.
uuid (str) – Draft UUID.
- Return type:
~.models.submission_draft.SubmissionDraft
- Raises:
redditwarp.exceptions.RedditError –
FORBIDDEN
:There is no user context.
The specified draft does not exist.
You do not have permission to view the draft.
BAD_GATEWAY
:The specified ID is not a valid UUID.
NOT_FOUND
:The specified draft could not be found.
- create(*, body: str | Mapping[str, JSON_ro], public: bool | None = None, subreddit_id: int | str | None = None, title: str | None = None, reply_notifications: bool | None = None, spoiler: bool | None = None, nsfw: bool | None = None, oc: bool | None = None, flair_uuid: str | None = None, flair_text: str | None = None) str [source]#
Create a draft.
- Parameters:
body (
Union
[str
,Mapping
[str
,JSON_ro
]]) –public (Optional[bool]) –
subreddit_id (Optional[Union[int, str]]) –
title (Optional[str]) –
reply_notifications (Optional[bool]) –
spoiler (Optional[bool]) –
nsfw (Optional[bool]) –
oc (Optional[bool]) –
flair_uuid (Optional[str]) –
flair_text (Optional[str]) –
- Returns:
The UUID of the newly created draft.
- Return type:
str
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
- replace(uuid: str, *, body: str | Mapping[str, JSON_ro], public: bool | None = None, subreddit_id: int | str | None = None, title: str | None = None, reply_notifications: bool | None = None, spoiler: bool | None = None, nsfw: bool | None = None, oc: bool | None = None, flair_uuid: str | None = None, flair_text: str | None = None) None [source]#
Update a draft.
Every parameter should be specified otherwise their effective default will be used!
- delete(uuid: str) None [source]#
Delete a draft.
- Parameters:
uuid (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
VALIDATION_ERRORS
:The specified draft does not exist.
The specified draft UUID is not valid.
UNKNOWN_THRIFT_ERROR
:The specified draft no longer exists.