diff --git a/.codegen.json b/.codegen.json index d73dc97..c15a185 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "ac37b50", "specHash": "c27c421", "version": "1.15.0" } +{ "engineHash": "c34d8bf", "specHash": "c27c421", "version": "1.15.0" } diff --git a/docs/archives.md b/docs/archives.md index 4236f77..cc730a3 100644 --- a/docs/archives.md +++ b/docs/archives.md @@ -13,7 +13,11 @@ This operation is performed by calling function `get_archives_v2025_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2025.0/get-archives/). -_Currently we don't have an example for calling `get_archives_v2025_r0` in integration tests_ + + +```python +client.archives.get_archives_v2025_r0(limit=100) +``` ### Arguments @@ -41,7 +45,11 @@ This operation is performed by calling function `create_archive_v2025_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2025.0/post-archives/). -_Currently we don't have an example for calling `create_archive_v2025_r0` in integration tests_ + + +```python +client.archives.create_archive_v2025_r0(archive_name) +``` ### Arguments @@ -67,7 +75,11 @@ This operation is performed by calling function `delete_archive_by_id_v2025_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2025.0/delete-archives-id/). -_Currently we don't have an example for calling `delete_archive_by_id_v2025_r0` in integration tests_ + + +```python +client.archives.delete_archive_by_id_v2025_r0(archive.id) +``` ### Arguments diff --git a/test/archives.py b/test/archives.py new file mode 100644 index 0000000..49ffb2d --- /dev/null +++ b/test/archives.py @@ -0,0 +1,31 @@ +from box_sdk_gen.internal.utils import to_string + +import pytest + +from box_sdk_gen.client import BoxClient + +from box_sdk_gen.schemas.v2025_r0.archive_v2025_r0 import ArchiveV2025R0 + +from box_sdk_gen.schemas.v2025_r0.archives_v2025_r0 import ArchivesV2025R0 + +from box_sdk_gen.internal.utils import get_uuid + +from box_sdk_gen.internal.utils import get_env_var + +from test.commons import get_default_client_with_user_subject + +user_id: str = get_env_var('USER_ID') + +client: BoxClient = get_default_client_with_user_subject(user_id) + + +def testArchivesCreateListDelete(): + archive_name: str = get_uuid() + archive: ArchiveV2025R0 = client.archives.create_archive_v2025_r0(archive_name) + assert to_string(archive.type) == 'archive' + assert archive.name == archive_name + archives: ArchivesV2025R0 = client.archives.get_archives_v2025_r0(limit=100) + assert len(archives.entries) > 0 + client.archives.delete_archive_by_id_v2025_r0(archive.id) + with pytest.raises(Exception): + client.archives.delete_archive_by_id_v2025_r0(archive.id)