"""Fastn Confluence connector — auto-generated type stubs.

Do not edit manually. Regenerate with `fastn connector sync`.
"""
from __future__ import annotations

from typing import Any, Dict, List, Optional, TypedDict


class _ConfluenceCreateBlogPostBody(TypedDict, total=False):
    representation: str
    value: str

class _ConfluenceCreatePageBody(TypedDict, total=False):
    representation: str
    value: str

class _ConfluenceUpdateBlogPostBody(TypedDict, total=False):
    representation: str
    value: str

class _ConfluenceUpdateBlogPostVersion(TypedDict, total=False):
    message: str
    number: int

class _ConfluenceUpdatePageBody(TypedDict, total=False):
    representation: str
    value: str

class _ConfluenceUpdatePageVersion(TypedDict, total=False):
    message: str
    number: int

class ConfluenceConnector:
    """Confluence connector ().

    Provides 12 tools.
    """

    def confluence_create_blog_post(
        self,
        spaceId: str,
        title: str,
        body: Optional[_ConfluenceCreateBlogPostBody] = None,
        createdAt: Optional[str] = None,
        private: Optional[bool] = None,
        status: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Creates a new blog post in a specified Confluence space. Use this tool to publish new blog content, announcements, or team updates. Requires a title, body content, and a target space ID. A new blog post ID will be returned upon success. Do not use this tool to modify an existing blog post — use confluence_update_blog_post instead.

        Args:
            spaceId: The ID of the space where the blog post will be created. (required)
            title: The title of the blog post. (required)
            body: The content of the blog post.
            createdAt: The date and time when the blog post was created.  This field is typically generated by the server and should not be set in the request.
            private: Specifies whether the blog post should be private (true) or public (false).
            status: The status of the blog post (e.g., 'draft', 'current').
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_create_page(
        self,
        spaceId: str,
        title: str,
        body: Optional[_ConfluenceCreatePageBody] = None,
        embedded: Optional[bool] = None,
        parentId: Optional[str] = None,
        private: Optional[bool] = None,
        rootlevel: Optional[bool] = None,
        status: Optional[str] = None,
        subtype: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Creates a new page in a specified Confluence space. Use this tool to publish new documentation, notes, or project content. Requires a title, body content, and a target space ID. A new page ID will be returned upon success. Do not use this tool to modify an existing page — use confluence_update_page instead.

        Args:
            spaceId: The ID of the space where the page will be created. (required)
            title: The title of the page. (required)
            body: The content of the page.
            embedded: Whether the page is embedded.
            parentId: The ID of the parent page (if applicable).
            private: Whether the page is private.
            rootlevel: Whether the page is at the root level.
            status: The status of the page (e.g., 'current').
            subtype: The subtype of the page (if applicable).
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_delete_blog_post(
        self,
        blogpostId: str,
        draft: Optional[bool] = None,
        purge: Optional[bool] = None,
    ) -> Dict[str, Any]:
        """Permanently deletes a Confluence blog post by its ID. Use this tool only when the blog post must be removed entirely. This action is irreversible — the blog post and all its content will be deleted and cannot be recovered through this connector. Consider using confluence_update_blog_post to revise content instead of deleting it.

        Args:
            blogpostId: The ID of the blog post to delete. (required)
            draft: If true, deletes the blog post even if it is a draft.
            purge: If true, permanently deletes the blog post (may not be reversible).
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_delete_page(
        self,
        pageId: str,
        draft: Optional[bool] = None,
        purge: Optional[bool] = None,
    ) -> Dict[str, Any]:
        """Permanently deletes a Confluence page by its ID. Use this tool only when the page must be removed entirely. This action is irreversible — the page and all its content will be deleted and cannot be recovered through this connector. Consider using confluence_update_page to archive or revise content instead of deleting it.

        Args:
            pageId: The ID of the page to be deleted. (required)
            draft: If true, deletes the draft version of the page as well.
            purge: If true, completely purges the page, bypassing the recycle bin.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_get_blog_post(
        self,
        blogpostId: str,
        bodyformat: Optional[str] = None,
        getdraft: Optional[str] = None,
        includecollaborators: Optional[str] = None,
        includefavoritedbycurrentuserstatus: Optional[str] = None,
        includelabels: Optional[str] = None,
        includelikes: Optional[str] = None,
        includeoperations: Optional[str] = None,
        includeproperties: Optional[str] = None,
        includeversion: Optional[str] = None,
        includeversions: Optional[str] = None,
        includewebresources: Optional[str] = None,
        status: Optional[str] = None,
        version: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Retrieves a single Confluence blog post by its ID, including its title, body content, version, and metadata. Use this tool when you need the full details of a specific blog post. Use confluence_list_blog_posts instead when you do not yet know the blog post ID and need to search or browse.

        Args:
            blogpostId: The ID of the blog post to retrieve. (required)
            bodyformat: The format of the blog post body (e.g., "html", "storage").
            getdraft: Whether to retrieve a draft version of the blog post.
            includecollaborators: Whether to include collaborators information.
            includefavoritedbycurrentuserstatus: Whether to include the favorited status by the current user.
            includelabels: Whether to include labels associated with the blog post.
            includelikes: Whether to include like information.
            includeoperations: Whether to include operation information.
            includeproperties: Whether to include custom properties associated with the blog post.
            includeversion: Whether to include specific version information.
            includeversions: Whether to include all versions of the blog post.
            includewebresources: Whether to include associated web resources.
            status: The status of the blog post (e.g., "current", "draft").
            version: The specific version of the blog post to retrieve.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_get_page(
        self,
        pageId: str,
        bodyformat: Optional[str] = None,
        getdraft: Optional[bool] = None,
        includecollaborators: Optional[bool] = None,
        includedirectchildren: Optional[bool] = None,
        includefavoritedbycurrentuserstatus: Optional[bool] = None,
        includelabels: Optional[bool] = None,
        includelikes: Optional[bool] = None,
        includeoperations: Optional[bool] = None,
        includeproperties: Optional[bool] = None,
        includeversion: Optional[bool] = None,
        includeversions: Optional[bool] = None,
        includewebresources: Optional[bool] = None,
        status: Optional[str] = None,
        version: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Retrieves a single Confluence page by its ID, including its title, body content, version, and metadata. Use this tool when you need the full details of a specific page. Use confluence_list_pages instead when you do not yet know the page ID and need to search or browse.

        Args:
            pageId: The ID of the page to retrieve. (required)
            bodyformat: Format of the page body (e.g., 'storage', 'view').
            getdraft: Whether to retrieve the draft version of the page (true/false).
            includecollaborators: Whether to include collaborator information (true/false).
            includedirectchildren: Whether to include direct child pages (true/false).
            includefavoritedbycurrentuserstatus: Whether to include favorited status for the current user (true/false).
            includelabels: Whether to include page labels (true/false).
            includelikes: Whether to include like information (true/false).
            includeoperations: Whether to include operation information (true/false).
            includeproperties: Whether to include page properties (true/false).
            includeversion: Whether to include specific version information (true/false).
            includeversions: Whether to include all versions information (true/false).
            includewebresources: Whether to include web resource information (true/false).
            status: Filter pages by status.
            version: Specific version number to retrieve.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_get_space(
        self,
        spaceId: str,
        descriptionformat: Optional[str] = None,
        includeicon: Optional[bool] = None,
        includelabels: Optional[bool] = None,
        includeoperations: Optional[bool] = None,
        includepermissions: Optional[bool] = None,
        includeproperties: Optional[bool] = None,
        includeroleassignments: Optional[bool] = None,
    ) -> Dict[str, Any]:
        """Retrieves a single Confluence space by its ID. Use this tool when you need detailed metadata about a specific space, such as its name, key, description, or permissions. Use confluence_list_spaces instead when you need to browse or search across multiple spaces.

        Args:
            spaceId: The ID of the Confluence space to retrieve. (required)
            descriptionformat: The format of the space description (e.g., 'plain', 'storage').
            includeicon: Whether to include the space icon in the response.
            includelabels: Whether to include space labels in the response.
            includeoperations: Whether to include space operations in the response.
            includepermissions: Whether to include space permissions in the response.
            includeproperties: Whether to include space properties in the response.
            includeroleassignments: Whether to include space role assignments in the response.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_list_blog_posts(
        self,
        bodyformat: Optional[str] = None,
        cursor: Optional[str] = None,
        id: Optional[str] = None,
        limit: Optional[str] = None,
        sort: Optional[str] = None,
        spaceid: Optional[str] = None,
        status: Optional[str] = None,
        title: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Lists all blog posts in Confluence. Use this tool when you need to retrieve a collection of blog posts, optionally filtered by space or date. Returns blog post metadata including IDs, titles, and authors. Use confluence_get_blog_post instead when you already know the specific blog post ID.

        Args:
            bodyformat: The format of the blog post body (e.g., 'storage', 'view').
            cursor: A cursor for pagination.
            id: The ID of a specific blog post.
            limit: The maximum number of blog posts to return.
            sort: The order to sort blog posts (e.g., 'created asc', 'created desc').
            spaceid: The ID of the space containing the blog posts.
            status: The status of the blog posts (e.g., 'current', 'draft').
            title: The title of the blog post.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_list_pages(
        self,
        bodyformat: Optional[str] = None,
        cursor: Optional[str] = None,
        id: Optional[str] = None,
        limit: Optional[str] = None,
        sort: Optional[str] = None,
        spaceid: Optional[str] = None,
        status: Optional[str] = None,
        subtype: Optional[str] = None,
        title: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Lists all pages in Confluence. Use this tool when you need to retrieve a collection of pages, optionally filtered by space or other criteria. Returns page metadata including IDs, titles, and space associations. Use confluence_get_page instead when you already know the specific page ID.

        Args:
            bodyformat: The format of the page body (e.g., storage, view).
            cursor: Cursor for pagination.
            id: The ID of a specific page to retrieve.
            limit: The maximum number of pages to return.
            sort: The sorting order for the results (e.g., created, updated).
            spaceid: The ID of the space to retrieve pages from.
            status: Filter pages by status (e.g., current, draft).
            subtype: Filter pages by subtype (e.g., page, blogpost).
            title: Filter pages by title.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_list_spaces(
        self,
        cursor: Optional[str] = None,
        descriptionformat: Optional[str] = None,
        favoritedby: Optional[str] = None,
        ids: Optional[str] = None,
        includeicon: Optional[bool] = None,
        keys: Optional[str] = None,
        labels: Optional[str] = None,
        limit: Optional[str] = None,
        notfavoritedby: Optional[str] = None,
        sort: Optional[str] = None,
        status: Optional[str] = None,
        type: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Lists all spaces in Confluence. Use this tool when you need to browse or enumerate available spaces. Returns space metadata including IDs, keys, and names. Use confluence_get_space instead when you already know the specific space ID.

        Args:
            cursor: Cursor for pagination.
            descriptionformat: Format of the space description (e.g., plain text, HTML).
            favoritedby: Filter spaces favorited by a specific user.
            ids: Comma-separated list of space IDs.
            includeicon: Whether to include space icons in the results.
            keys: Comma-separated list of space keys.
            labels: Filter spaces by labels.
            limit: Maximum number of spaces to return.
            notfavoritedby: Filter spaces not favorited by a specific user.
            sort: Sort order (e.g., name asc, name desc).
            status: Filter spaces by status (e.g., current, archived).
            type: Filter spaces by type (e.g., personal, global).
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_update_blog_post(
        self,
        blogpostId: str,
        id: str,
        status: str,
        title: str,
        body: Optional[_ConfluenceUpdateBlogPostBody] = None,
        createdAt: Optional[str] = None,
        spaceId: Optional[str] = None,
        version: Optional[_ConfluenceUpdateBlogPostVersion] = None,
    ) -> Dict[str, Any]:
        """Updates the title, content, or metadata of an existing Confluence blog post identified by its ID. Use this tool to edit blog post body text, change the title, or update other properties. Requires the current blog post version number to avoid overwriting concurrent edits. Do not use this tool to create a new blog post — use confluence_create_blog_post instead.

        Args:
            blogpostId: The unique identifier of the blog post to be updated. (required)
            id: The unique identifier for the blog post. (required)
            status: The status of the blog post (e.g., 'current', 'draft'). (required)
            title: The title of the blog post. (required)
            body: The content of the blog post.
            createdAt: Timestamp indicating when the blog post was created.
            spaceId: The ID of the space where the blog post resides.
            version: Version information for the blog post.
        Returns:
            API response as a dictionary.
        """
        ...

    def confluence_update_page(
        self,
        id: str,
        pageId: str,
        status: str,
        title: str,
        body: Optional[_ConfluenceUpdatePageBody] = None,
        version: Optional[_ConfluenceUpdatePageVersion] = None,
    ) -> Dict[str, Any]:
        """Updates the title, content, or metadata of an existing Confluence page identified by its ID. Use this tool to edit page body text, change the title, or update other page properties. Requires the current page version number to avoid overwriting concurrent edits. Do not use this tool to create a new page — use confluence_create_page instead.

        Args:
            id: The ID of the Confluence page. (required)
            pageId: The ID of the Confluence page to be updated. (required)
            status: The status of the Confluence page (e.g., 'current', 'draft'). (required)
            title: The title of the Confluence page. (required)
            body: The content of the Confluence page.
            version: Version information for the page.
        Returns:
            API response as a dictionary.
        """
        ...

