Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: docstrings for views #1523

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions tableauserverclient/models/view_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,64 @@
from defusedxml.ElementTree import fromstring

from tableauserverclient.datetime_helpers import parse_datetime
from .exceptions import UnpopulatedPropertyError
from .permissions_item import PermissionsRule
from .tag_item import TagItem
from tableauserverclient.models.exceptions import UnpopulatedPropertyError
from tableauserverclient.models.permissions_item import PermissionsRule
from tableauserverclient.models.tag_item import TagItem


class ViewItem:
"""
Contains the members or attributes for the view resources on Tableau Server.
The ViewItem class defines the information you can request or query from
Tableau Server. The class members correspond to the attributes of a server
request or response payload.

Attributes
----------
content_url: Optional[str], default None
The name of the view as it would appear in a URL.

created_at: Optional[datetime], default None
The date and time when the view was created.

id: Optional[str], default None
The unique identifier for the view.

image: Optional[Callable[[], bytes]], default None
The image of the view. You must first call the `views.populate_image`
method to access the image.

name: Optional[str], default None
The name of the view.

owner_id: Optional[str], default None
The ID for the owner of the view.

pdf: Optional[Callable[[], bytes]], default None
The PDF of the view. You must first call the `views.populate_pdf`
method to access the PDF.

preview_image: Optional[Callable[[], bytes]], default None
The preview image of the view. You must first call the
`views.populate_preview_image` method to access the preview image.

project_id: Optional[str], default None
The ID for the project that contains the view.

tags: set[str], default set()
The tags associated with the view.

total_views: Optional[int], default None
The total number of views for the view.

updated_at: Optional[datetime], default None
The date and time when the view was last updated.

workbook_id: Optional[str], default None
The ID for the workbook that contains the view.

"""

def __init__(self) -> None:
self._content_url: Optional[str] = None
self._created_at: Optional[datetime] = None
Expand Down
Loading
Loading