Skip to content

Commit 7850463

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat: add Metadata Taxonomies api (box/box-openapi#569) (#1252)
Co-authored-by: box-sdk-build <box-sdk-build@box.com>
1 parent f99512f commit 7850463

20 files changed

+1797
-5
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "f97463c", "specHash": "b7abe0d", "version": "10.2.0" }
1+
{ "engineHash": "b5860f1", "specHash": "1e0848d", "version": "10.2.0" }

box_sdk_gen/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@
168168

169169
from box_sdk_gen.managers.ai_studio import AiStudioManager
170170

171+
from box_sdk_gen.managers.metadata_taxonomies import MetadataTaxonomiesManager
172+
171173
from box_sdk_gen.managers.docgen_template import DocgenTemplateManager
172174

173175
from box_sdk_gen.managers.docgen import DocgenManager
@@ -427,6 +429,9 @@ def __init__(self, auth: Authentication, *, network_session: NetworkSession = No
427429
self.ai_studio = AiStudioManager(
428430
auth=self.auth, network_session=self.network_session
429431
)
432+
self.metadata_taxonomies = MetadataTaxonomiesManager(
433+
auth=self.auth, network_session=self.network_session
434+
)
430435
self.docgen_template = DocgenTemplateManager(
431436
auth=self.auth, network_session=self.network_session
432437
)

box_sdk_gen/managers/__init__.py

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

143143
from box_sdk_gen.managers.ai_studio import *
144144

145+
from box_sdk_gen.managers.metadata_taxonomies import *
146+
145147
from box_sdk_gen.managers.docgen_template import *
146148

147149
from box_sdk_gen.managers.docgen import *

box_sdk_gen/managers/file_metadata.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ def __init__(
132132
self.network_session = network_session
133133

134134
def get_file_metadata(
135-
self, file_id: str, *, extra_headers: Optional[Dict[str, Optional[str]]] = None
135+
self,
136+
file_id: str,
137+
*,
138+
view: Optional[str] = None,
139+
extra_headers: Optional[Dict[str, Optional[str]]] = None
136140
) -> Metadatas:
137141
"""
138142
Retrieves all metadata for a given file.
@@ -145,11 +149,18 @@ def get_file_metadata(
145149
the `file_id` is `123`.
146150
Example: "12345"
147151
:type file_id: str
152+
:param view: Taxonomy field values are returned in `API view` by default, meaning
153+
the value is represented with a taxonomy node identifier.
154+
To retrieve the `Hydrated view`, where taxonomy values are represented
155+
with the full taxonomy node information, set this parameter to `hydrated`.
156+
This is the only supported value for this parameter., defaults to None
157+
:type view: Optional[str], optional
148158
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
149159
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
150160
"""
151161
if extra_headers is None:
152162
extra_headers = {}
163+
query_params_map: Dict[str, str] = prepare_params({'view': to_string(view)})
153164
headers_map: Dict[str, str] = prepare_params({**extra_headers})
154165
response: FetchResponse = self.network_session.network_client.fetch(
155166
FetchOptions(
@@ -162,6 +173,7 @@ def get_file_metadata(
162173
]
163174
),
164175
method='GET',
176+
params=query_params_map,
165177
headers=headers_map,
166178
response_format=ResponseFormat.JSON,
167179
auth=self.auth,
@@ -176,6 +188,7 @@ def get_file_metadata_by_id(
176188
scope: GetFileMetadataByIdScope,
177189
template_key: str,
178190
*,
191+
view: Optional[str] = None,
179192
extra_headers: Optional[Dict[str, Optional[str]]] = None
180193
) -> MetadataFull:
181194
"""
@@ -198,11 +211,18 @@ def get_file_metadata_by_id(
198211
:param template_key: The name of the metadata template.
199212
Example: "properties"
200213
:type template_key: str
214+
:param view: Taxonomy field values are returned in `API view` by default, meaning
215+
the value is represented with a taxonomy node identifier.
216+
To retrieve the `Hydrated view`, where taxonomy values are represented
217+
with the full taxonomy node information, set this parameter to `hydrated`.
218+
This is the only supported value for this parameter., defaults to None
219+
:type view: Optional[str], optional
201220
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
202221
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
203222
"""
204223
if extra_headers is None:
205224
extra_headers = {}
225+
query_params_map: Dict[str, str] = prepare_params({'view': to_string(view)})
206226
headers_map: Dict[str, str] = prepare_params({**extra_headers})
207227
response: FetchResponse = self.network_session.network_client.fetch(
208228
FetchOptions(
@@ -218,6 +238,7 @@ def get_file_metadata_by_id(
218238
]
219239
),
220240
method='GET',
241+
params=query_params_map,
221242
headers=headers_map,
222243
response_format=ResponseFormat.JSON,
223244
auth=self.auth,

box_sdk_gen/managers/folder_metadata.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def get_folder_metadata(
135135
self,
136136
folder_id: str,
137137
*,
138+
view: Optional[str] = None,
138139
extra_headers: Optional[Dict[str, Optional[str]]] = None
139140
) -> Metadatas:
140141
"""
@@ -154,11 +155,18 @@ def get_folder_metadata(
154155
always represented by the ID `0`.
155156
Example: "12345"
156157
:type folder_id: str
158+
:param view: Taxonomy field values are returned in `API view` by default, meaning
159+
the value is represented with a taxonomy node identifier.
160+
To retrieve the `Hydrated view`, where taxonomy values are represented
161+
with the full taxonomy node information, set this parameter to `hydrated`.
162+
This is the only supported value for this parameter., defaults to None
163+
:type view: Optional[str], optional
157164
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
158165
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
159166
"""
160167
if extra_headers is None:
161168
extra_headers = {}
169+
query_params_map: Dict[str, str] = prepare_params({'view': to_string(view)})
162170
headers_map: Dict[str, str] = prepare_params({**extra_headers})
163171
response: FetchResponse = self.network_session.network_client.fetch(
164172
FetchOptions(
@@ -171,6 +179,7 @@ def get_folder_metadata(
171179
]
172180
),
173181
method='GET',
182+
params=query_params_map,
174183
headers=headers_map,
175184
response_format=ResponseFormat.JSON,
176185
auth=self.auth,

0 commit comments

Comments
 (0)