Skip to content

Commit 6a5134f

Browse files
authored
feat!: Remove deprecated API: CollaborationWhitelist (#651)
Removed deprecated classes: `CollaborationWhitelist`, `CollaborationWhitelistEntry` and `CollaborationWhitelistExemptTarget`. Replaced with `CollaborationAllowlist`, `CollaborationAllowlistEntry` and `CollaborationAllowlistExemptTarget.` Closes: SDK-1887
1 parent 3c08b42 commit 6a5134f

13 files changed

+4
-423
lines changed

boxsdk/client/client.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from ..util.api_call_decorator import api_call
99
from ..object.search import Search
1010
from ..object.events import Events
11-
from ..object.collaboration_whitelist import CollaborationWhitelist
1211
from ..object.collaboration_allowlist import CollaborationAllowlist
1312
from ..object.trash import Trash
1413
from ..pagination.limit_offset_based_object_collection import LimitOffsetBasedObjectCollection
@@ -228,53 +227,6 @@ def collaboration(self, collab_id):
228227
"""
229228
return self.translator.get('collaboration')(session=self._session, object_id=collab_id)
230229

231-
@deprecated('Use collaboration_allowlist instead')
232-
def collaboration_whitelist(self):
233-
"""
234-
Initilializes a :class:`CollaborationWhitelist` object.
235-
236-
:return:
237-
A :class:`CollaborationWhitelist` object.
238-
:rype:
239-
:class:`CollaborationWhitelist`.
240-
"""
241-
return CollaborationWhitelist(self._session)
242-
243-
@deprecated('Use collaboration_allowlist_entry instead')
244-
def collaboration_whitelist_entry(self, entry_id):
245-
"""
246-
Initialize a :class:`CollaborationWhitelistEntry` object, whose box id is entry_id.
247-
248-
:param entry_id:
249-
The box id of the :class:`CollaborationWhitelistEntry` object.
250-
:type entry_id:
251-
`unicode`
252-
:return:
253-
A :class:`CollaborationWhitelistEntry` object with the given entry id.
254-
:rtype:
255-
:class:`CollaborationWhitelistEntry`
256-
"""
257-
return self.translator.get('collaboration_whitelist_entry')(session=self._session, object_id=entry_id)
258-
259-
@deprecated('Use collaboration_allowlist_exempt_target instead')
260-
def collaboration_whitelist_exempt_target(self, exemption_id):
261-
"""
262-
Initialize a :class:`CollaborationWhitelistExemptTarget` object, whose box id is target_id.
263-
264-
:param exemption_id:
265-
The box id of the :class:`CollaborationWhitelistExemptTarget` object.
266-
:type exemption_id:
267-
`unicode`
268-
:return:
269-
A :class:`CollaborationWhitelistExemptTarget` object with the given target id.
270-
:rtype:
271-
:class:`CollaborationWhitelistExemptTarget`
272-
"""
273-
return self.translator.get('collaboration_whitelist_exempt_target')(
274-
session=self._session,
275-
object_id=exemption_id
276-
)
277-
278230
def collaboration_allowlist(self):
279231
"""
280232
Initilializes a :class:`CollaborationAllowlist` object.

boxsdk/object/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
__all__ = list(map(str, [
44
'collaboration',
5-
'collaboration_whitelist',
6-
'collaboration_whitelist_entry',
7-
'collaboration_whitelist_exempt_target',
85
'collaboration_allowlist',
96
'collaboration_allowlist_entry',
107
'collaboration_allowlist_exempt_target',

boxsdk/object/collaboration_allowlist_entry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# coding: utf-8
2-
from .collaboration_whitelist_entry import CollaborationWhitelistEntry
2+
from .base_object import BaseObject
33

44

5-
class CollaborationAllowlistEntry(CollaborationWhitelistEntry):
5+
class CollaborationAllowlistEntry(BaseObject):
66
"""Represents a allowlisted email domain for enterprise collaboration."""
77

88
_item_type = 'collaboration_whitelist_entry'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# coding: utf-8
2-
from boxsdk.object.collaboration_whitelist_exempt_target import CollaborationWhitelistExemptTarget
2+
from .base_object import BaseObject
33

44

5-
class CollaborationAllowlistExemptTarget(CollaborationWhitelistExemptTarget):
5+
class CollaborationAllowlistExemptTarget(BaseObject):
66
"""Represents a user who is exempted from the collaboration allowlist."""
77

88
_item_type = 'collaboration_whitelist_exempt_target'

boxsdk/object/collaboration_whitelist.py

Lines changed: 0 additions & 142 deletions
This file was deleted.

boxsdk/object/collaboration_whitelist_entry.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

boxsdk/object/collaboration_whitelist_exempt_target.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/source/boxsdk.object.rst

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,6 @@ boxsdk.object.collaboration\_allowlist\_exempt\_target module
8484
:undoc-members:
8585
:show-inheritance:
8686

87-
boxsdk.object.collaboration\_whitelist module
88-
---------------------------------------------
89-
90-
.. automodule:: boxsdk.object.collaboration_whitelist
91-
:members:
92-
:undoc-members:
93-
:show-inheritance:
94-
95-
boxsdk.object.collaboration\_whitelist\_entry module
96-
----------------------------------------------------
97-
98-
.. automodule:: boxsdk.object.collaboration_whitelist_entry
99-
:members:
100-
:undoc-members:
101-
:show-inheritance:
102-
103-
boxsdk.object.collaboration\_whitelist\_exempt\_target module
104-
-------------------------------------------------------------
105-
106-
.. automodule:: boxsdk.object.collaboration_whitelist_exempt_target
107-
:members:
108-
:undoc-members:
109-
:show-inheritance:
110-
11187
boxsdk.object.collection module
11288
-------------------------------
11389

test/unit/client/test_client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from boxsdk.config import API
1414
from boxsdk.network.default_network import DefaultNetworkResponse
1515
from boxsdk.object.collaboration import Collaboration
16-
from boxsdk.object.collaboration_whitelist import CollaborationWhitelist
1716
from boxsdk.object.collaboration_allowlist import CollaborationAllowlist
1817
from boxsdk.object.email_alias import EmailAlias
1918
from boxsdk.object.collection import Collection
@@ -555,11 +554,6 @@ def test_events_returns_event_object(mock_client):
555554
assert isinstance(mock_client.events(), Events)
556555

557556

558-
def test_collaboration_whitelist_initializer(mock_client):
559-
collaboration_whitelist = mock_client.collaboration_whitelist()
560-
assert isinstance(collaboration_whitelist, CollaborationWhitelist)
561-
562-
563557
def test_collaboration_allowlist_initializer(mock_client):
564558
collaboration_allowlist = mock_client.collaboration_allowlist()
565559
assert isinstance(collaboration_allowlist, CollaborationAllowlist)

test/unit/object/conftest.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
from boxsdk.object.storage_policy_assignment import StoragePolicyAssignment
2828
from boxsdk.object.terms_of_service import TermsOfService
2929
from boxsdk.object.terms_of_service_user_status import TermsOfServiceUserStatus
30-
from boxsdk.object.collaboration_whitelist import CollaborationWhitelist
31-
from boxsdk.object.collaboration_whitelist_entry import CollaborationWhitelistEntry
32-
from boxsdk.object.collaboration_whitelist_exempt_target import CollaborationWhitelistExemptTarget
3330
from boxsdk.object.collaboration_allowlist import CollaborationAllowlist
3431
from boxsdk.object.collaboration_allowlist_entry import CollaborationAllowlistEntry
3532
from boxsdk.object.collaboration_allowlist_exempt_target import CollaborationAllowlistExemptTarget
@@ -109,21 +106,6 @@ def test_comment(mock_box_session, mock_object_id):
109106
return Comment(mock_box_session, mock_object_id)
110107

111108

112-
@pytest.fixture()
113-
def test_collaboration_whitelist(mock_box_session):
114-
return CollaborationWhitelist(mock_box_session)
115-
116-
117-
@pytest.fixture()
118-
def test_collaboration_whitelist_entry(mock_box_session, mock_object_id):
119-
return CollaborationWhitelistEntry(mock_box_session, mock_object_id)
120-
121-
122-
@pytest.fixture()
123-
def test_collaboration_whitelist_exemption(mock_box_session, mock_object_id):
124-
return CollaborationWhitelistExemptTarget(mock_box_session, mock_object_id)
125-
126-
127109
@pytest.fixture()
128110
def test_collaboration_allowlist(mock_box_session):
129111
return CollaborationAllowlist(mock_box_session)

0 commit comments

Comments
 (0)