From 257a4a7ac42a84d33b55fcc50e493a383cd5fcc7 Mon Sep 17 00:00:00 2001 From: Delcio Torres Date: Wed, 6 Mar 2019 18:52:05 -0300 Subject: [PATCH] added one_time_password to enter_exchange --- intralinks/__init__.py | 6 +++--- intralinks/functions/v1/splashes.py | 9 +++++++-- intralinks/functions/v2/splashes.py | 10 ++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/intralinks/__init__.py b/intralinks/__init__.py index 8025c77..99b619c 100644 --- a/intralinks/__init__.py +++ b/intralinks/__init__.py @@ -228,13 +228,13 @@ def download_splash_image(self, exchange, path_without_extension): return intralinks.functions.v1.splashes.download_splash_image(self.api_client, exchange_id, path_without_extension) - def enter_exchange(self, exchange, accept_splash=None): + def enter_exchange(self, exchange, accept_splash=None, one_time_password=None): exchange_id = self._get_id(exchange) if self.api_client.is_v1() or self.use_v1: - return intralinks.functions.v1.splashes.enter_exchange(self.api_client, exchange_id, accept_splash=accept_splash) + return intralinks.functions.v1.splashes.enter_exchange(self.api_client, exchange_id, accept_splash=accept_splash, one_time_password=one_time_password) else: - return intralinks.functions.v2.splashes.enter_exchange(self.api_client, exchange_id, accept_splash=accept_splash) + return intralinks.functions.v2.splashes.enter_exchange(self.api_client, exchange_id, accept_splash=accept_splash, one_time_password=one_time_password) ########################################################################################################### # Folders diff --git a/intralinks/functions/v1/splashes.py b/intralinks/functions/v1/splashes.py index a72f0d6..abaefa4 100644 --- a/intralinks/functions/v1/splashes.py +++ b/intralinks/functions/v1/splashes.py @@ -17,13 +17,18 @@ def get_splash(api_client, exchange_id): return data -def enter_exchange(api_client, exchange_id, accept_splash=None): +def enter_exchange(api_client, exchange_id, accept_splash=None, one_time_password=False): + if one_time_password: + enter_content = {'xml':to_xml({'acceptSplash':accept_splash, 'oneTimePassword':one_time_password }, 'workspaceEntryRequest')} + else: + enter_content = {'xml':to_xml({'acceptSplash':accept_splash}, 'workspaceEntryRequest')} + response = api_client.create( '/services/workspaces/entry', params={ 'workspaceId':exchange_id }, - data={'xml':to_xml({'acceptSplash':accept_splash}, 'workspaceEntryRequest')}, + data=enter_content, api_version=1 ) diff --git a/intralinks/functions/v2/splashes.py b/intralinks/functions/v2/splashes.py index 454ee53..33f5f7b 100644 --- a/intralinks/functions/v2/splashes.py +++ b/intralinks/functions/v2/splashes.py @@ -17,10 +17,16 @@ def get_splash(api_client, exchange_id): return get_node_as_item(data, 'splash') -def enter_exchange(api_client, exchange_id, accept_splash=False): +def enter_exchange(api_client, exchange_id, accept_splash=False, one_time_password=False): + + enter_content = {'acceptSplash': accept_splash} + + if one_time_password: + enter_content['oneTimePassword'] = one_time_password + response = api_client.create( '/v2/workspaces/{}/splash'.format(exchange_id), - data=json.dumps({'acceptSplash': accept_splash}), + data=json.dumps(enter_content), headers={'Content-Type': 'application/json'}, api_version=2 )