Skip to content

Commit

Permalink
generated with codegen at box/box-codegen@e7f791d and spec at box/box…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Sep 6, 2023
1 parent 3f24d37 commit 5140f17
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
24 changes: 20 additions & 4 deletions docs/collaboration_allowlist_exempt_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ This operation is performed by calling function `get_collaboration_whitelist_exe
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets/).

_Currently we don't have an example for calling `get_collaboration_whitelist_exempt_targets` in integration tests_
<!-- sample get_collaboration_whitelist_exempt_targets -->

```python
client.collaboration_allowlist_exempt_targets.get_collaboration_whitelist_exempt_targets()
```

### Arguments

Expand All @@ -42,7 +46,11 @@ This operation is performed by calling function `create_collaboration_whitelist_
See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-collaboration-whitelist-exempt-targets/).

_Currently we don't have an example for calling `create_collaboration_whitelist_exempt_target` in integration tests_
<!-- sample post_collaboration_whitelist_exempt_targets -->

```python
client.collaboration_allowlist_exempt_targets.create_collaboration_whitelist_exempt_target(user=CreateCollaborationWhitelistExemptTargetUserArg(id=user.id))
```

### Arguments

Expand All @@ -67,7 +75,11 @@ This operation is performed by calling function `get_collaboration_whitelist_exe
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets-id/).

_Currently we don't have an example for calling `get_collaboration_whitelist_exempt_target_by_id` in integration tests_
<!-- sample get_collaboration_whitelist_exempt_targets_id -->

```python
client.collaboration_allowlist_exempt_targets.get_collaboration_whitelist_exempt_target_by_id(collaboration_whitelist_exempt_target_id=exempt_target.id)
```

### Arguments

Expand All @@ -92,7 +104,11 @@ This operation is performed by calling function `delete_collaboration_whitelist_
See the endpoint docs at
[API Reference](https://developer.box.com/reference/delete-collaboration-whitelist-exempt-targets-id/).

_Currently we don't have an example for calling `delete_collaboration_whitelist_exempt_target_by_id` in integration tests_
<!-- sample delete_collaboration_whitelist_exempt_targets_id -->

```python
client.collaboration_allowlist_exempt_targets.delete_collaboration_whitelist_exempt_target_by_id(collaboration_whitelist_exempt_target_id=exempt_target.id)
```

### Arguments

Expand Down
61 changes: 61 additions & 0 deletions test/collaboration_allowlist_exempt_targets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import pytest

from box_sdk_gen.schemas import CollaborationAllowlistExemptTargets

from box_sdk_gen.schemas import User

from box_sdk_gen.schemas import CollaborationAllowlistExemptTarget

from box_sdk_gen.managers.collaboration_allowlist_exempt_targets import (
CreateCollaborationWhitelistExemptTargetUserArg,
)

from box_sdk_gen.utils import decode_base_64

from box_sdk_gen.utils import get_env_var

from box_sdk_gen.utils import get_uuid

from box_sdk_gen.client import Client

from box_sdk_gen.jwt_auth import JWTAuth

from box_sdk_gen.jwt_auth import JWTConfig

client: Client = Client(
auth=JWTAuth(
config=JWTConfig.from_config_json_string(
decode_base_64(get_env_var('JWT_CONFIG_BASE_64'))
)
)
)


def collaborationAllowlistExemptTargets():
exempt_targets: CollaborationAllowlistExemptTargets = (
client.collaboration_allowlist_exempt_targets.get_collaboration_whitelist_exempt_targets()
)
assert len(exempt_targets.entries) >= 0
user: User = client.users.create_user(
name=get_uuid(),
login=''.join([get_uuid(), '@boxdemo.com']),
is_platform_access_only=True,
)
new_exempt_target: CollaborationAllowlistExemptTarget = client.collaboration_allowlist_exempt_targets.create_collaboration_whitelist_exempt_target(
user=CreateCollaborationWhitelistExemptTargetUserArg(id=user.id)
)
assert new_exempt_target.type == 'collaboration_whitelist_exempt_target'
assert new_exempt_target.user.id == user.id
exempt_target: CollaborationAllowlistExemptTarget = client.collaboration_allowlist_exempt_targets.get_collaboration_whitelist_exempt_target_by_id(
collaboration_whitelist_exempt_target_id=new_exempt_target.id
)
assert exempt_target.id == new_exempt_target.id
assert exempt_target.user.id == user.id
client.collaboration_allowlist_exempt_targets.delete_collaboration_whitelist_exempt_target_by_id(
collaboration_whitelist_exempt_target_id=exempt_target.id
)
with pytest.raises(Exception):
client.collaboration_allowlist_exempt_targets.get_collaboration_whitelist_exempt_target_by_id(
collaboration_whitelist_exempt_target_id=exempt_target.id
)
client.users.delete_user_by_id(user_id=user.id)
2 changes: 1 addition & 1 deletion test/recent_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def testRecentItems():
auth.as_user(get_env_var('USER_ID'))
client: Client = Client(auth=auth)
recent_items: RecentItems = client.recent_items.get_recent_items()
assert len(recent_items.entries) > 0
assert len(recent_items.entries) >= 0

0 comments on commit 5140f17

Please sign in to comment.