From 55e6ed5b83510a379ead948eaacc83d95adf9ff5 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Tue, 5 May 2026 06:19:02 -0700 Subject: [PATCH 1/2] fix: Mark id field of AIAgentReference required (box/box-openapi#1629) (box/box-openapi#595) --- .codegen.json | 2 +- box_sdk_gen/schemas/ai_agent_reference.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.codegen.json b/.codegen.json index 3b548676..120a38d2 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "c571efa", "specHash": "f899bf6", "version": "10.8.0" } +{ "engineHash": "c571efa", "specHash": "65c9c57", "version": "10.8.0" } diff --git a/box_sdk_gen/schemas/ai_agent_reference.py b/box_sdk_gen/schemas/ai_agent_reference.py index 9f7dd1dc..5b95d3b7 100644 --- a/box_sdk_gen/schemas/ai_agent_reference.py +++ b/box_sdk_gen/schemas/ai_agent_reference.py @@ -1,7 +1,5 @@ from enum import Enum -from typing import Optional - from box_sdk_gen.internal.base_object import BaseObject from box_sdk_gen.box.errors import BoxSDKError @@ -16,19 +14,19 @@ class AiAgentReference(BaseObject): def __init__( self, + id: str, *, type: AiAgentReferenceTypeField = AiAgentReferenceTypeField.AI_AGENT_ID, - id: Optional[str] = None, **kwargs ): """ - :param type: The type of AI agent used to handle queries., defaults to AiAgentReferenceTypeField.AI_AGENT_ID - :type type: AiAgentReferenceTypeField, optional :param id: The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`) or a unique identifier for pre-built agents (for example, `enhanced_extract_agent` - for the [Enhanced Extract Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent))., defaults to None - :type id: Optional[str], optional + for the [Enhanced Extract Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)). + :type id: str + :param type: The type of AI agent used to handle queries., defaults to AiAgentReferenceTypeField.AI_AGENT_ID + :type type: AiAgentReferenceTypeField, optional """ super().__init__(**kwargs) - self.type = type self.id = id + self.type = type From f684352af7210110e15144817fcb6a9966811afb Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Tue, 5 May 2026 06:21:20 -0700 Subject: [PATCH 2/2] fix: Fix metadata template schema (box/box-openapi#596) --- .codegen.json | 2 +- box_sdk_gen/managers/metadata_templates.py | 9 ++- box_sdk_gen/schemas/metadata_template.py | 66 +++++++++++++++++++++- 3 files changed, 72 insertions(+), 5 deletions(-) diff --git a/.codegen.json b/.codegen.json index 120a38d2..d4f1eb8c 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "c571efa", "specHash": "65c9c57", "version": "10.8.0" } +{ "engineHash": "c571efa", "specHash": "fa39a3f", "version": "10.8.0" } diff --git a/box_sdk_gen/managers/metadata_templates.py b/box_sdk_gen/managers/metadata_templates.py index 3c6e12b8..aa93dede 100644 --- a/box_sdk_gen/managers/metadata_templates.py +++ b/box_sdk_gen/managers/metadata_templates.py @@ -199,12 +199,14 @@ class CreateMetadataTemplateFields(BaseObject): _fields_to_json_mapping: Dict[str, str] = { 'display_name': 'displayName', 'taxonomy_key': 'taxonomyKey', + 'taxonomy_id': 'taxonomyId', 'options_rules': 'optionsRules', **BaseObject._fields_to_json_mapping, } _json_to_fields_mapping: Dict[str, str] = { 'displayName': 'display_name', 'taxonomyKey': 'taxonomy_key', + 'taxonomyId': 'taxonomy_id', 'optionsRules': 'options_rules', **BaseObject._json_to_fields_mapping, } @@ -227,6 +229,7 @@ def __init__( hidden: Optional[bool] = None, options: Optional[List[CreateMetadataTemplateFieldsOptionsField]] = None, taxonomy_key: Optional[str] = None, + taxonomy_id: Optional[str] = None, namespace: Optional[str] = None, options_rules: Optional[CreateMetadataTemplateFieldsOptionsRulesField] = None, **kwargs @@ -237,7 +240,7 @@ def __init__( date-time picker. Additionally, metadata templates support an `enum` field for a basic list - of items, and ` multiSelect` field for a similar list of items where the + of items, and `multiSelect` field for a similar list of items where the user can select more than one value. Metadata taxonomies are also supported as a `taxonomy` field type @@ -260,6 +263,9 @@ def __init__( :param taxonomy_key: The unique key of the metadata taxonomy to use for this taxonomy field. This property is required when the field `type` is set to `taxonomy`., defaults to None :type taxonomy_key: Optional[str], optional + :param taxonomy_id: The unique ID of the metadata taxonomy to use for this taxonomy field. + This property is required when the field `type` is set to `taxonomy`., defaults to None + :type taxonomy_id: Optional[str], optional :param namespace: The namespace of the metadata taxonomy to use for this taxonomy field. This property is required when the field `type` is set to `taxonomy`., defaults to None :type namespace: Optional[str], optional @@ -275,6 +281,7 @@ def __init__( self.hidden = hidden self.options = options self.taxonomy_key = taxonomy_key + self.taxonomy_id = taxonomy_id self.namespace = namespace self.options_rules = options_rules diff --git a/box_sdk_gen/schemas/metadata_template.py b/box_sdk_gen/schemas/metadata_template.py index d844ab9a..b7965827 100644 --- a/box_sdk_gen/schemas/metadata_template.py +++ b/box_sdk_gen/schemas/metadata_template.py @@ -21,8 +21,8 @@ class MetadataTemplateFieldsTypeField(str, Enum): DATE = 'date' ENUM = 'enum' MULTISELECT = 'multiSelect' - INTEGER = 'integer' TAXONOMY = 'taxonomy' + INTEGER = 'integer' class MetadataTemplateFieldsOptionsField(BaseObject): @@ -39,13 +39,50 @@ def __init__(self, key: str, *, id: Optional[str] = None, **kwargs): self.id = id +class MetadataTemplateFieldsOptionsRulesField(BaseObject): + _fields_to_json_mapping: Dict[str, str] = { + 'multi_select': 'multiSelect', + 'selectable_levels': 'selectableLevels', + **BaseObject._fields_to_json_mapping, + } + _json_to_fields_mapping: Dict[str, str] = { + 'multiSelect': 'multi_select', + 'selectableLevels': 'selectable_levels', + **BaseObject._json_to_fields_mapping, + } + + def __init__( + self, + *, + multi_select: Optional[bool] = None, + selectable_levels: Optional[List[int]] = None, + **kwargs + ): + """ + :param multi_select: Whether to allow users to select multiple values., defaults to None + :type multi_select: Optional[bool], optional + :param selectable_levels: An array of integers defining which levels of the taxonomy are + selectable by users., defaults to None + :type selectable_levels: Optional[List[int]], optional + """ + super().__init__(**kwargs) + self.multi_select = multi_select + self.selectable_levels = selectable_levels + + class MetadataTemplateFieldsField(BaseObject): _fields_to_json_mapping: Dict[str, str] = { 'display_name': 'displayName', + 'taxonomy_key': 'taxonomyKey', + 'taxonomy_id': 'taxonomyId', + 'options_rules': 'optionsRules', **BaseObject._fields_to_json_mapping, } _json_to_fields_mapping: Dict[str, str] = { 'displayName': 'display_name', + 'taxonomyKey': 'taxonomy_key', + 'taxonomyId': 'taxonomy_id', + 'optionsRules': 'options_rules', **BaseObject._json_to_fields_mapping, } _discriminator = 'type', { @@ -54,8 +91,8 @@ class MetadataTemplateFieldsField(BaseObject): 'date', 'enum', 'multiSelect', - 'integer', 'taxonomy', + 'integer', } def __init__( @@ -67,6 +104,10 @@ def __init__( description: Optional[str] = None, hidden: Optional[bool] = None, options: Optional[List[MetadataTemplateFieldsOptionsField]] = None, + taxonomy_key: Optional[str] = None, + taxonomy_id: Optional[str] = None, + namespace: Optional[str] = None, + options_rules: Optional[MetadataTemplateFieldsOptionsRulesField] = None, id: Optional[str] = None, **kwargs ): @@ -76,9 +117,12 @@ def __init__( date-time picker. Additionally, metadata templates support an `enum` field for a basic list - of items, and ` multiSelect` field for a similar list of items where the + of items, and `multiSelect` field for a similar list of items where the user can select more than one value. + Metadata taxonomies are also supported as a `taxonomy` field type + with a specific set of additional properties, which describe its structure. + **Note**: The `integer` value is deprecated. It is still present in the response, but cannot be used in the POST request. @@ -97,6 +141,18 @@ def __init__( :param options: A list of options for this field. This is used in combination with the `enum` and `multiSelect` field types., defaults to None :type options: Optional[List[MetadataTemplateFieldsOptionsField]], optional + :param taxonomy_key: The unique key of the metadata taxonomy to use for this taxonomy field. + This property is required when the field `type` is set to `taxonomy`., defaults to None + :type taxonomy_key: Optional[str], optional + :param taxonomy_id: The unique ID of the metadata taxonomy to use for this taxonomy field. + This property is required when the field `type` is set to `taxonomy`., defaults to None + :type taxonomy_id: Optional[str], optional + :param namespace: The namespace of the metadata taxonomy to use for this taxonomy field. + This property is required when the field `type` is set to `taxonomy`., defaults to None + :type namespace: Optional[str], optional + :param options_rules: An object defining additional rules for the options of the taxonomy field. + This property is required when the field `type` is set to `taxonomy`., defaults to None + :type options_rules: Optional[MetadataTemplateFieldsOptionsRulesField], optional :param id: The unique ID of the metadata template field., defaults to None :type id: Optional[str], optional """ @@ -107,6 +163,10 @@ def __init__( self.description = description self.hidden = hidden self.options = options + self.taxonomy_key = taxonomy_key + self.taxonomy_id = taxonomy_id + self.namespace = namespace + self.options_rules = options_rules self.id = id