redditwarp.siteprocs.draft.ASYNC#

class redditwarp.siteprocs.draft.ASYNC.DraftProcedures(client: Client)[source]#

Bases: object

async retrieve() SubmissionDraftList[source]#

Retrieve the current user’s drafts.

Return type:

SubmissionDraftList

Raises:

redditwarp.exceptions.RedditError

  • USER_REQUIRED:

    There is no user context.

async 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.

async 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.

async 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!

async 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.