Skip to content

Commit 113faa3

Browse files
fix(boxsdkgen): Add missing discriminators for schema types (box/box-codegen#931) (#1367)
1 parent 6df014e commit 113faa3

49 files changed

Lines changed: 110 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "7c01dda", "specHash": "74a1e4a", "version": "4.5.0" }
1+
{ "engineHash": "02fdae4", "specHash": "74a1e4a", "version": "4.5.0" }

box_sdk_gen/schemas/ai_single_agent_response_full.py

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

2929

3030
class AiSingleAgentResponseFull(AiSingleAgentResponse):
31+
_discriminator = 'type', {'ai_agent'}
32+
3133
def __init__(
3234
self,
3335
id: str,

box_sdk_gen/schemas/comment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def __init__(
2929

3030

3131
class Comment(CommentBase):
32+
_discriminator = 'type', {'comment'}
33+
3234
def __init__(
3335
self,
3436
*,

box_sdk_gen/schemas/comment_full.py

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

1717

1818
class CommentFull(Comment):
19+
_discriminator = 'type', {'comment'}
20+
1921
def __init__(
2022
self,
2123
*,

box_sdk_gen/schemas/conflict_error.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def __init__(self, *, conflicts: Optional[List[FileConflict]] = None, **kwargs):
2828

2929

3030
class ConflictError(ClientError):
31+
_discriminator = 'type', {'error'}
32+
3133
def __init__(
3234
self,
3335
*,

box_sdk_gen/schemas/file.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ class FileItemStatusField(str, Enum):
175175

176176

177177
class File(FileMini):
178+
_discriminator = 'type', {'file'}
179+
178180
def __init__(
179181
self,
180182
id: str,

box_sdk_gen/schemas/file_conflict.py

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

1313

1414
class FileConflict(FileMini):
15+
_discriminator = 'type', {'file'}
16+
1517
def __init__(
1618
self,
1719
id: str,

box_sdk_gen/schemas/file_full.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ class FileFullSharedLinkPermissionOptionsField(str, Enum):
414414

415415

416416
class FileFull(File):
417+
_discriminator = 'type', {'file'}
418+
417419
def __init__(
418420
self,
419421
id: str,

box_sdk_gen/schemas/file_mini.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class FileMini(FileBase):
2020
'sha1': 'sha_1',
2121
**FileBase._json_to_fields_mapping,
2222
}
23+
_discriminator = 'type', {'file'}
2324

2425
def __init__(
2526
self,

box_sdk_gen/schemas/file_version.py

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

1515

1616
class FileVersion(FileVersionMini):
17+
_discriminator = 'type', {'file_version'}
18+
1719
def __init__(
1820
self,
1921
id: str,

0 commit comments

Comments
 (0)