Skip to content

Commit 25e90d1

Browse files
fix: Remove enum types from GET enterprise configuration endpoint (box/box-openapi#560) (#1151)
1 parent 4670a23 commit 25e90d1

File tree

7 files changed

+16
-41
lines changed

7 files changed

+16
-41
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "b98d1dc", "specHash": "cf21406", "version": "10.0.1" }
1+
{ "engineHash": "4421f42", "specHash": "1715587", "version": "10.0.1" }

box_sdk_gen/managers/enterprise_configurations.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Optional
22

3+
from typing import List
4+
35
from typing import Dict
46

57
from box_sdk_gen.internal.utils import to_string
@@ -54,7 +56,7 @@ def __init__(
5456
def get_enterprise_configuration_by_id_v2025_r0(
5557
self,
5658
enterprise_id: str,
57-
categories: str,
59+
categories: List[str],
5860
*,
5961
box_version: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._2025_0,
6062
extra_headers: Optional[Dict[str, Optional[str]]] = None
@@ -64,9 +66,9 @@ def get_enterprise_configuration_by_id_v2025_r0(
6466
:param enterprise_id: The ID of the enterprise.
6567
Example: "3442311"
6668
:type enterprise_id: str
67-
:param categories: The comma-delimited list of the enterprise configuration categories.
69+
:param categories: A comma-separated list of the enterprise configuration categories.
6870
Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
69-
:type categories: str
71+
:type categories: List[str]
7072
:param box_version: Version header., defaults to BoxVersionHeaderV2025R0._2025_0
7173
:type box_version: BoxVersionHeaderV2025R0, optional
7274
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None

box_sdk_gen/networking/retries.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ def should_retry(
5959
is_successful: bool = (
6060
fetch_response.status >= 200 and fetch_response.status < 400
6161
)
62-
retry_after_header: Optional[str] = fetch_response.headers.get('Retry-After')
62+
retry_after_header: Optional[str] = (
63+
fetch_response.headers.get('Retry-After')
64+
if 'Retry-After' in fetch_response.headers
65+
else None
66+
)
6367
is_accepted_with_retry_after: bool = (
6468
fetch_response.status == 202 and not retry_after_header == None
6569
)

box_sdk_gen/schemas/v2025_r0/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from box_sdk_gen.schemas.v2025_r0.collaboration_permissions_v2025_r0 import *
88

9-
from box_sdk_gen.schemas.v2025_r0.collaboration_restriction_v2025_r0 import *
10-
119
from box_sdk_gen.schemas.v2025_r0.custom_session_duration_group_item_v2025_r0 import *
1210

1311
from box_sdk_gen.schemas.v2025_r0.doc_gen_batch_base_v2025_r0 import *

box_sdk_gen/schemas/v2025_r0/collaboration_restriction_v2025_r0.py

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

box_sdk_gen/schemas/v2025_r0/enterprise_configuration_content_and_sharing_v2025_r0.py

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

33
from typing import List
44

5-
from enum import Enum
6-
75
from box_sdk_gen.internal.base_object import BaseObject
86

97
from box_sdk_gen.schemas.v2025_r0.enterprise_feature_settings_item_v2025_r0 import (
@@ -30,10 +28,6 @@
3028
CollaborationPermissionsV2025R0,
3129
)
3230

33-
from box_sdk_gen.schemas.v2025_r0.collaboration_restriction_v2025_r0 import (
34-
CollaborationRestrictionV2025R0,
35-
)
36-
3731
from box_sdk_gen.schemas.v2025_r0.list_user_v2025_r0 import ListUserV2025R0
3832

3933
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_item_integer_v2025_r0 import (
@@ -85,7 +79,7 @@ class EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsFi
8579
def __init__(
8680
self,
8781
*,
88-
value: Optional[List[CollaborationRestrictionV2025R0]] = None,
82+
value: Optional[List[str]] = None,
8983
is_used: Optional[bool] = None,
9084
**kwargs
9185
):
@@ -97,30 +91,15 @@ def __init__(
9791
self.value = value
9892

9993

100-
class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField(
101-
str, Enum
102-
):
103-
ENABLE_EXTERNAL_COLLABORATION = 'enable_external_collaboration'
104-
LIMIT_COLLABORATION_TO_ALLOWLISTED_DOMAINS = (
105-
'limit_collaboration_to_allowlisted_domains'
106-
)
107-
108-
10994
class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField(
11095
EnterpriseConfigurationItemV2025R0
11196
):
11297
def __init__(
113-
self,
114-
*,
115-
value: Optional[
116-
EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField
117-
] = None,
118-
is_used: Optional[bool] = None,
119-
**kwargs
98+
self, *, value: Optional[str] = None, is_used: Optional[bool] = None, **kwargs
12099
):
121100
"""
122101
:param value: The external collaboration status., defaults to None
123-
:type value: Optional[EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField], optional
102+
:type value: Optional[str], optional
124103
:param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None
125104
:type is_used: Optional[bool], optional
126105
"""

docs/enterprise_configurations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ _Currently we don't have an example for calling `get_enterprise_configuration_by
1717

1818
- enterprise_id `str`
1919
- The ID of the enterprise. Example: "3442311"
20-
- categories `str`
21-
- The comma-delimited list of the enterprise configuration categories. Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
20+
- categories `List[str]`
21+
- A comma-separated list of the enterprise configuration categories. Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
2222
- box_version `BoxVersionHeaderV2025R0`
2323
- Version header.
2424
- extra_headers `Optional[Dict[str, Optional[str]]]`

0 commit comments

Comments
 (0)