1919
2020
2121class 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+ """
108+
22109 class AskDataEnablement :
23110 Enabled = "Enabled"
24111 Disabled = "Disabled"
@@ -33,28 +120,28 @@ def __repr__(self):
33120 )
34121
35122 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
123+ self ._ask_data_enablement : Optional [ str ] = None
124+ self ._certified : Optional [ bool ] = None
125+ self ._certification_note : Optional [ str ] = None
126+ self ._connections : Optional [ list [ ConnectionItem ]] = None
40127 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
128+ self ._created_at : Optional [ datetime . datetime ] = None
129+ self ._datasource_type : Optional [ str ] = None
130+ self ._description : Optional [ str ] = None
131+ self ._encrypt_extracts : Optional [ bool ] = None
132+ self ._has_extracts : Optional [ bool ] = None
46133 self ._id : Optional [str ] = None
47134 self ._initial_tags : set = set ()
48135 self ._project_name : Optional [str ] = None
49136 self ._revisions = None
50137 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
138+ self ._updated_at : Optional [ datetime . datetime ] = None
139+ self ._use_remote_query_agent : Optional [ bool ] = None
140+ self ._webpage_url : Optional [ str ] = None
141+ self .description : Optional [ str ] = None
142+ self .name : Optional [ str ] = name
56143 self .owner_id : Optional [str ] = None
57- self .project_id = project_id
144+ self .project_id : Optional [ str ] = project_id
58145 self .tags : set [str ] = set ()
59146
60147 self ._permissions = None
@@ -63,16 +150,16 @@ def __init__(self, project_id: Optional[str] = None, name: Optional[str] = None)
63150 return None
64151
65152 @property
66- def ask_data_enablement (self ) -> Optional [AskDataEnablement ]:
153+ def ask_data_enablement (self ) -> Optional [str ]:
67154 return self ._ask_data_enablement
68155
69156 @ask_data_enablement .setter
70157 @property_is_enum (AskDataEnablement )
71- def ask_data_enablement (self , value : Optional [AskDataEnablement ]):
158+ def ask_data_enablement (self , value : Optional [str ]):
72159 self ._ask_data_enablement = value
73160
74161 @property
75- def connections (self ) -> Optional [ list [ ConnectionItem ]] :
162+ def connections (self ):
76163 if self ._connections is None :
77164 error = "Datasource item must be populated with connections first."
78165 raise UnpopulatedPropertyError (error )
@@ -112,7 +199,7 @@ def certification_note(self, value: Optional[str]):
112199 self ._certification_note = value
113200
114201 @property
115- def encrypt_extracts (self ):
202+ def encrypt_extracts (self ) -> Optional [ bool ] :
116203 return self ._encrypt_extracts
117204
118205 @encrypt_extracts .setter
@@ -156,7 +243,7 @@ def description(self) -> Optional[str]:
156243 return self ._description
157244
158245 @description .setter
159- def description (self , value : str ):
246+ def description (self , value : Optional [ str ] ):
160247 self ._description = value
161248
162249 @property
@@ -187,7 +274,7 @@ def revisions(self) -> list[RevisionItem]:
187274 def size (self ) -> Optional [int ]:
188275 return self ._size
189276
190- def _set_connections (self , connections ):
277+ def _set_connections (self , connections ) -> None :
191278 self ._connections = connections
192279
193280 def _set_permissions (self , permissions ):
0 commit comments