8000 Enhancement #117: Add support for the oAuth flag · irislips/server-client-python@01235ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 01235ea

Browse files
hugoboosRussell Hay
authored andcommitted
Enhancement tableau#117: Add support for the oAuth flag
* Add support for the oAuth flag when publishing workbooks and data sources
1 parent 9d0c8ca commit 01235ea

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tableauserverclient/models/connection_credentials.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ class ConnectionCredentials(object):
99
1010
"""
1111

12-
def __init__(self, name, password, embed=True):
12+
def __init__(self, name, password, embed=True, oauth=False):
1313
self.name = name
1414
self.password = password
1515
self.embed = embed
16+
self.oauth = oauth
1617

1718
@property
1819
def embed(< 8000 span class=pl-s1>self):
@@ -22,3 +23,12 @@ def embed(self):
2223
@property_is_boolean
2324
def embed(self, value):
2425
self._embed = value
26+
27+
@property
28+
def oauth(self):
29+
return self._oauth
30+
31+
@oauth.setter
32+
@property_is_boolean
33+
def oauth(self, value):
34+
self._oauth = value

tableauserverclient/server/request_factory.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def _generate_xml(self, datasource_item, connection_credentials=None):
4242
credentials_element.attrib['name'] = connection_credentials.name
4343
credentials_element.attrib['password'] = connection_credentials.password
4444
credentials_element.attrib['embed'] = 'true' if connection_credentials.embed else 'false'
45+
46+
if connection_credentials.oauth:
47+
credentials_element.attrib['oAuth'] = 'true'
4548
return ET.tostring(xml_request)
4649

4750
def update_req(self, datasource_item):
@@ -279,6 +282,9 @@ def _generate_xml(self, workbook_item, connection_credentials=None):
279282
credentials_element.attrib['name'] = connection_credentials.name
280283
credentials_element.attrib['password'] = connection_credentials.password
281284
credentials_element.attrib['embed'] = 'true' if connection_credentials.embed else 'false'
285+
286+
if connection_credentials.oauth:
287+
credentials_element.attrib['oAuth'] = 'true'
282288
return ET.tostring(xml_request)
283289

284290
def update_req(self, workbook_item):

0 commit comments

Comments
 (0)
0