Skip to content

Commit b109bb8

Browse files
committed
docs: DatasourceItem and Endpoint docstrings
1 parent 3275925 commit b109bb8

File tree

2 files changed

+665
-23
lines changed

2 files changed

+665
-23
lines changed

tableauserverclient/models/datasource_item.py

+107-21
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,92 @@
1919

2020

2121
class DatasourceItem:
22+
"""
23+
Represents a Tableau datasource item.
24+
25+
Parameters
26+
----------
27+
project_id : Optional[str]
28+
The project ID that the datasource belongs to.
29+
30+
name : Optional[str]
31+
The name of the datasource.
32+
33+
Attributes
34+
----------
35+
ask_data_enablement : Optional[str]
36+
Determines if a data source allows use of Ask Data. The value can be
37+
TSC.DatasourceItem.AskDataEnablement.Enabled,
38+
TSC.DatasourceItem.AskDataEnablement.Disabled, or
39+
TSC.DatasourceItem.AskDataEnablement.SiteDefault. If no setting is
40+
specified, it will default to SiteDefault. See REST API Publish
41+
Datasource for more information about ask_data_enablement.
42+
43+
connections : list[ConnectionItem]
44+
The list of data connections (ConnectionItem) for the specified data
45+
source. You must first call the populate_connections method to access
46+
this data. See the ConnectionItem class.
47+
48+
content_url : Optional[str]
49+
The name of the data source as it would appear in a URL.
50+
51+
created_at : Optional[datetime.datetime]
52+
The time the data source was created.
53+
54+
certified : Optional[bool]
55+
A Boolean value that indicates whether the data source is certified.
56+
57+
certification_note : Optional[str]
58+
The optional note that describes the certified data source.
59+
60+
datasource_type : Optional[str]
61+
The type of data source, for example, sqlserver or excel-direct.
62+
63+
description : Optional[str]
64+
The description for the data source.
65+
66+
encrypt_extracts : Optional[bool]
67+
A Boolean value to determine if a datasource should be encrypted or not.
68+
See Extract and Encryption Methods for more information.
69+
70+
has_extracts : Optional[bool]
71+
A Boolean value that indicates whether the datasource has extracts.
72+
73+
id : Optional[str]
74+
The identifier for the data source. You need this value to query a
75+
specific data source or to delete a data source with the get_by_id and
76+
delete methods.
77+
78+
name : Optional[str]
79+
The name of the data source. If not specified, the name of the published
80+
data source file is used.
81+
82+
owner_id : Optional[str]
83+
The identifier of the owner of the data source.
84+
85+
project_id : Optional[str]
86+
The identifier of the project associated with the data source. You must
87+
provide this identifier when you create an instance of a DatasourceItem.
88+
89+
project_name : Optional[str]
90+
The name of the project associated with the data source.
91+
92+
tags : Optional[set[str]]
93+
The tags (list of strings) that have been added to the data source.
94+
95+
updated_at : Optional[datetime.datetime]
96+
The date and time when the data source was last updated.
97+
98+
use_remote_query_agent : Optional[bool]
99+
A Boolean value that indicates whether to allow or disallow your Tableau
100+
Cloud site to use Tableau Bridge clients. Bridge allows you to maintain
101+
data sources with live connections to supported on-premises data
102+
sources. See Configure and Manage the Bridge Client Pool for more
103+
information.
104+
105+
webpage_url : Optional[str]
106+
The url of the datasource as displayed in browsers.
107+
"""
22108
class AskDataEnablement:
23109
Enabled = "Enabled"
24110
Disabled = "Disabled"
@@ -33,28 +119,28 @@ def __repr__(self):
33119
)
34120

35121
def __init__(self, project_id: Optional[str] = None, name: Optional[str] = None) -> None:
36-
self._ask_data_enablement = None
37-
self._certified = None
38-
self._certification_note = None
39-
self._connections = None
122+
self._ask_data_enablement: Optional[str] = None
123+
self._certified: Optional[bool] = None
124+
self._certification_note: Optional[str] = None
125+
self._connections: Optional[list[ConnectionItem]] = None
40126
self._content_url: Optional[str] = None
41-
self._created_at = None
42-
self._datasource_type = None
43-
self._description = None
44-
self._encrypt_extracts = None
45-
self._has_extracts = None
127+
self._created_at: Optional[datetime.datetime] = None
128+
self._datasource_type: Optional[str] = None
129+
self._description: Optional[str] = None
130+
self._encrypt_extracts: Optional[bool] = None
131+
self._has_extracts: Optional[bool] = None
46132
self._id: Optional[str] = None
47133
self._initial_tags: set = set()
48134
self._project_name: Optional[str] = None
49135
self._revisions = None
50136
self._size: Optional[int] = None
51-
self._updated_at = None
52-
self._use_remote_query_agent = None
53-
self._webpage_url = None
54-
self.description = None
55-
self.name = name
137+
self._updated_at: Optional[datetime.datetime] = None
138+
self._use_remote_query_agent: Optional[bool] = None
139+
self._webpage_url: Optional[str] = None
140+
self.description: Optional[str] = None
141+
self.name: Optional[str] = name
56142
self.owner_id: Optional[str] = None
57-
self.project_id = project_id
143+
self.project_id: Optional[str] = project_id
58144
self.tags: set[str] = set()
59145

60146
self._permissions = None
@@ -63,16 +149,16 @@ def __init__(self, project_id: Optional[str] = None, name: Optional[str] = None)
63149
return None
64150

65151
@property
66-
def ask_data_enablement(self) -> Optional[AskDataEnablement]:
152+
def ask_data_enablement(self) -> Optional[str]:
67153
return self._ask_data_enablement
68154

69155
@ask_data_enablement.setter
70156
@property_is_enum(AskDataEnablement)
71-
def ask_data_enablement(self, value: Optional[AskDataEnablement]):
157+
def ask_data_enablement(self, value: Optional[str]):
72158
self._ask_data_enablement = value
73159

74160
@property
75-
def connections(self) -> Optional[list[ConnectionItem]]:
161+
def connections(self):
76162
if self._connections is None:
77163
error = "Datasource item must be populated with connections first."
78164
raise UnpopulatedPropertyError(error)
@@ -112,7 +198,7 @@ def certification_note(self, value: Optional[str]):
112198
self._certification_note = value
113199

114200
@property
115-
def encrypt_extracts(self):
201+
def encrypt_extracts(self) -> Optional[bool]:
116202
return self._encrypt_extracts
117203

118204
@encrypt_extracts.setter
@@ -156,7 +242,7 @@ def description(self) -> Optional[str]:
156242
return self._description
157243

158244
@description.setter
159-
def description(self, value: str):
245+
def description(self, value: Optional[str]):
160246
self._description = value
161247

162248
@property
@@ -187,7 +273,7 @@ def revisions(self) -> list[RevisionItem]:
187273
def size(self) -> Optional[int]:
188274
return self._size
189275

190-
def _set_connections(self, connections):
276+
def _set_connections(self, connections) -> None:
191277
self._connections = connections
192278

193279
def _set_permissions(self, permissions):

0 commit comments

Comments
 (0)