diff --git a/.codegen.json b/.codegen.json index 591b2619..748587d6 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "e6b1577", "specHash": "1715587", "version": "10.0.1" } +{ "engineHash": "8cdcb1b", "specHash": "1715587", "version": "10.0.1" } diff --git a/docs/enterprise_configurations.md b/docs/enterprise_configurations.md index 751ae4d0..b0d60a8a 100644 --- a/docs/enterprise_configurations.md +++ b/docs/enterprise_configurations.md @@ -11,7 +11,13 @@ This operation is performed by calling function `get_enterprise_configuration_by See the endpoint docs at [API Reference](https://developer.box.com/reference/v2025.0/get-enterprise-configurations-id/). -_Currently we don't have an example for calling `get_enterprise_configuration_by_id_v2025_r0` in integration tests_ + + +```python +admin_client.enterprise_configurations.get_enterprise_configuration_by_id_v2025_r0( + enterprise_id, ["user_settings", "content_and_sharing", "security", "shield"] +) +``` ### Arguments diff --git a/test/enterprise_configurations.py b/test/enterprise_configurations.py new file mode 100644 index 00000000..bb9b0af8 --- /dev/null +++ b/test/enterprise_configurations.py @@ -0,0 +1,57 @@ +from box_sdk_gen.internal.utils import to_string + +from box_sdk_gen.client import BoxClient + +from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_v2025_r0 import ( + EnterpriseConfigurationV2025R0, +) + +from box_sdk_gen.internal.utils import get_env_var + +from test.commons import get_default_client_with_user_subject + +from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_user_settings_v2025_r0 import ( + EnterpriseConfigurationUserSettingsV2025R0, +) + +from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_content_and_sharing_v2025_r0 import ( + EnterpriseConfigurationContentAndSharingV2025R0, +) + +from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_security_v2025_r0 import ( + EnterpriseConfigurationSecurityV2025R0, +) + +from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_shield_v2025_r0 import ( + EnterpriseConfigurationShieldV2025R0, +) + +admin_client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID')) + + +def testGetEnterpriseConfigurationById(): + enterprise_id: str = get_env_var('ENTERPRISE_ID') + enterprise_configuration: EnterpriseConfigurationV2025R0 = ( + admin_client.enterprise_configurations.get_enterprise_configuration_by_id_v2025_r0( + enterprise_id, + ['user_settings', 'content_and_sharing', 'security', 'shield'], + ) + ) + assert to_string(enterprise_configuration.type) == 'enterprise_configuration' + user_settings: EnterpriseConfigurationUserSettingsV2025R0 = ( + enterprise_configuration.user_settings + ) + assert user_settings.is_enterprise_sso_required.value == False + assert user_settings.new_user_default_language.value == 'English (US)' + assert user_settings.new_user_default_storage_limit.value == -1 + content_and_sharing: EnterpriseConfigurationContentAndSharingV2025R0 = ( + enterprise_configuration.content_and_sharing + ) + assert ( + content_and_sharing.collaboration_permissions.value.is_editor_role_enabled + == True + ) + security: EnterpriseConfigurationSecurityV2025R0 = enterprise_configuration.security + assert security.is_managed_user_signup_enabled.value == False + shield: EnterpriseConfigurationShieldV2025R0 = enterprise_configuration.shield + assert len(shield.shield_rules) == 0