19
19
20
20
21
21
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
+ """
22
108
class AskDataEnablement :
23
109
Enabled = "Enabled"
24
110
Disabled = "Disabled"
@@ -33,28 +119,28 @@ def __repr__(self):
33
119
)
34
120
35
121
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
40
126
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
46
132
self ._id : Optional [str ] = None
47
133
self ._initial_tags : set = set ()
48
134
self ._project_name : Optional [str ] = None
49
135
self ._revisions = None
50
136
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
56
142
self .owner_id : Optional [str ] = None
57
- self .project_id = project_id
143
+ self .project_id : Optional [ str ] = project_id
58
144
self .tags : set [str ] = set ()
59
145
60
146
self ._permissions = None
@@ -63,16 +149,16 @@ def __init__(self, project_id: Optional[str] = None, name: Optional[str] = None)
63
149
return None
64
150
65
151
@property
66
- def ask_data_enablement (self ) -> Optional [AskDataEnablement ]:
152
+ def ask_data_enablement (self ) -> Optional [str ]:
67
153
return self ._ask_data_enablement
68
154
69
155
@ask_data_enablement .setter
70
156
@property_is_enum (AskDataEnablement )
71
- def ask_data_enablement (self , value : Optional [AskDataEnablement ]):
157
+ def ask_data_enablement (self , value : Optional [str ]):
72
158
self ._ask_data_enablement = value
73
159
74
160
@property
75
- def connections (self ) -> Optional [ list [ ConnectionItem ]] :
161
+ def connections (self ):
76
162
if self ._connections is None :
77
163
error = "Datasource item must be populated with connections first."
78
164
raise UnpopulatedPropertyError (error )
@@ -112,7 +198,7 @@ def certification_note(self, value: Optional[str]):
112
198
self ._certification_note = value
113
199
114
200
@property
115
- def encrypt_extracts (self ):
201
+ def encrypt_extracts (self ) -> Optional [ bool ] :
116
202
return self ._encrypt_extracts
117
203
118
204
@encrypt_extracts .setter
@@ -156,7 +242,7 @@ def description(self) -> Optional[str]:
156
242
return self ._description
157
243
158
244
@description .setter
159
- def description (self , value : str ):
245
+ def description (self , value : Optional [ str ] ):
160
246
self ._description = value
161
247
162
248
@property
@@ -187,7 +273,7 @@ def revisions(self) -> list[RevisionItem]:
187
273
def size (self ) -> Optional [int ]:
188
274
return self ._size
189
275
190
- def _set_connections (self , connections ):
276
+ def _set_connections (self , connections ) -> None :
191
277
self ._connections = connections
192
278
193
279
def _set_permissions (self , permissions ):
0 commit comments