From 2430fd989da8cd1fa02a9e25617a09e402487758 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Tue, 26 Sep 2023 05:08:30 -0700 Subject: [PATCH] generated with codegen at box/box-codegen@a1233bf and spec at box/box-openapi@c1e2439 --- box_sdk_gen/base_object.py | 50 ++++--- box_sdk_gen/managers/avatars.py | 6 +- box_sdk_gen/managers/chunked_uploads.py | 16 ++- .../collaboration_allowlist_entries.py | 4 +- .../collaboration_allowlist_exempt_targets.py | 4 +- box_sdk_gen/managers/collections.py | 18 ++- box_sdk_gen/managers/comments.py | 28 ++-- box_sdk_gen/managers/device_pinners.py | 10 +- box_sdk_gen/managers/downloads.py | 2 +- box_sdk_gen/managers/email_aliases.py | 12 +- box_sdk_gen/managers/events.py | 136 +++++++++++++++++- box_sdk_gen/managers/file_classifications.py | 8 +- box_sdk_gen/managers/file_metadata.py | 28 ++-- box_sdk_gen/managers/file_requests.py | 18 ++- .../managers/file_version_legal_holds.py | 2 +- .../managers/file_version_retentions.py | 2 +- box_sdk_gen/managers/file_versions.py | 38 +++-- box_sdk_gen/managers/file_watermarks.py | 12 +- box_sdk_gen/managers/files.py | 31 ++-- .../managers/folder_classifications.py | 8 +- box_sdk_gen/managers/folder_locks.py | 4 +- box_sdk_gen/managers/folder_metadata.py | 28 ++-- box_sdk_gen/managers/folder_watermarks.py | 12 +- box_sdk_gen/managers/folders.py | 38 ++--- box_sdk_gen/managers/groups.py | 24 ++-- box_sdk_gen/managers/integration_mappings.py | 4 +- box_sdk_gen/managers/invites.py | 12 +- box_sdk_gen/managers/legal_hold_policies.py | 21 ++- .../managers/legal_hold_policy_assignments.py | 22 +-- box_sdk_gen/managers/list_collaborations.py | 38 +++-- box_sdk_gen/managers/memberships.py | 37 +++-- .../managers/metadata_cascade_policies.py | 6 +- box_sdk_gen/managers/metadata_templates.py | 16 ++- box_sdk_gen/managers/recent_items.py | 6 +- box_sdk_gen/managers/retention_policies.py | 27 ++-- .../managers/retention_policy_assignments.py | 22 +-- box_sdk_gen/managers/search.py | 64 +++++---- box_sdk_gen/managers/shared_links_files.py | 38 ++++- box_sdk_gen/managers/shared_links_folders.py | 30 +++- .../managers/shared_links_web_links.py | 22 ++- .../shield_information_barrier_reports.py | 2 +- ...eld_information_barrier_segment_members.py | 4 +- ...nformation_barrier_segment_restrictions.py | 4 +- .../shield_information_barrier_segments.py | 6 +- .../managers/shield_information_barriers.py | 2 +- box_sdk_gen/managers/sign_requests.py | 16 ++- box_sdk_gen/managers/sign_templates.py | 4 +- box_sdk_gen/managers/skills.py | 12 +- box_sdk_gen/managers/storage_policies.py | 13 +- .../managers/storage_policy_assignments.py | 6 +- box_sdk_gen/managers/task_assignments.py | 25 +++- box_sdk_gen/managers/tasks.py | 8 +- .../terms_of_service_user_statuses.py | 2 +- box_sdk_gen/managers/terms_of_services.py | 10 +- box_sdk_gen/managers/transfer.py | 10 +- box_sdk_gen/managers/trashed_files.py | 16 ++- box_sdk_gen/managers/trashed_folders.py | 20 ++- box_sdk_gen/managers/trashed_items.py | 6 +- box_sdk_gen/managers/trashed_web_links.py | 20 ++- box_sdk_gen/managers/uploads.py | 18 ++- box_sdk_gen/managers/user_collaborations.py | 22 ++- box_sdk_gen/managers/users.py | 30 ++-- box_sdk_gen/managers/web_links.py | 6 +- box_sdk_gen/managers/webhooks.py | 6 +- box_sdk_gen/managers/workflows.py | 4 +- box_sdk_gen/managers/zip_downloads.py | 8 +- box_sdk_gen/serialization.py | 11 +- box_sdk_gen/utils.py | 16 ++- docs/collections.md | 4 +- docs/comments.md | 8 +- docs/events.md | 2 +- docs/file_versions.md | 6 +- docs/groups.md | 8 +- docs/invites.md | 4 +- docs/legal_hold_policies.md | 2 +- docs/legal_hold_policy_assignments.md | 6 +- docs/list_collaborations.md | 6 +- docs/memberships.md | 6 +- docs/recent_items.md | 2 +- docs/retention_policies.md | 4 +- docs/retention_policy_assignments.md | 4 +- docs/search.md | 26 ++-- docs/shared_links_files.md | 2 +- docs/shared_links_folders.md | 2 +- docs/shared_links_web_links.md | 2 +- docs/storage_policies.md | 2 +- docs/transfer.md | 2 +- docs/trashed_files.md | 4 +- docs/trashed_folders.md | 4 +- docs/trashed_items.md | 2 +- docs/trashed_web_links.md | 4 +- docs/user_collaborations.md | 4 +- docs/users.md | 10 +- test/auth.py | 4 +- test/files.py | 4 +- test/folders.py | 2 +- test/groups.py | 2 +- 97 files changed, 898 insertions(+), 451 deletions(-) diff --git a/box_sdk_gen/base_object.py b/box_sdk_gen/base_object.py index f6eb41f..27644c0 100644 --- a/box_sdk_gen/base_object.py +++ b/box_sdk_gen/base_object.py @@ -15,7 +15,7 @@ def from_dict(cls, data: dict): for key, value in data.items(): mapping_field_name = cls._json_to_fields_mapping.get(key, key) annotation = cls.__init__.__annotations__.get(mapping_field_name, None) - unpacked_attributes[mapping_field_name] = cls.__deserialize( + unpacked_attributes[mapping_field_name] = cls._deserialize( key, value, annotation ) return cls(**unpacked_attributes) @@ -41,66 +41,78 @@ def to_dict(self) -> dict: return result_dict @classmethod - def __deserialize(cls, key, value, annotation=None): + def _deserialize(cls, key, value, annotation=None): if annotation is None: return value if get_origin(annotation) == Optional: - return cls.__deserialize(key, value, get_args(annotation)) + return cls._deserialize(key, value, get_args(annotation)) if get_origin(annotation) == Union: union_without_none_type = [ arg for arg in get_args(annotation) if arg is not type(None) ] if len(union_without_none_type) == 1: - return cls.__deserialize(key, value, union_without_none_type[0]) + return cls._deserialize(key, value, union_without_none_type[0]) if get_origin(annotation) == list: - return cls.__deserialize_list(key, value, annotation) + return cls._deserialize_list(key, value, annotation) elif get_origin(annotation) == Union: - return cls.__deserialize_union(key, value, annotation) + return cls._deserialize_union(key, value, annotation) elif isinstance(annotation, EnumMeta): - return cls.__deserialize_enum(key, value, annotation) + return cls._deserialize_enum(key, value, annotation) else: - return cls.__deserialize_nested_type(key, value, annotation) + return cls._deserialize_nested_type(key, value, annotation) @classmethod - def __deserialize_list(cls, key, value, annotation: list): + def _deserialize_list(cls, key, value, annotation: list): list_type = get_args(annotation)[0] try: return [ - cls.__deserialize(key, list_entry, list_type) for list_entry in value + cls._deserialize(key, list_entry, list_type) for list_entry in value ] except Exception: return value @classmethod - def __deserialize_union(cls, key, value, annotation): + def _deserialize_union(cls, key, value, annotation): possible_types = get_args(annotation) - type_field_value = value.get('type', None) or value.get('skillCardType', None) + if 'type' in value: + type_field = 'type' + else: + type_field = 'skillCardType' + type_field_value = value.get(type_field, None) type = None for i, possible_type in enumerate(possible_types): - # remove special characters - if type_field_value.replace("_", "") in possible_types[i].__name__.lower(): - type = possible_types[i] - break + try: + if ( + type_field_value.replace("_", "") + in possible_types[i].__name__.lower() + or possible_types[i].__init__.__annotations__[type_field][ + type_field_value.upper() + ] + ): + type = possible_types[i] + break + except Exception: + continue if not type: print('Could not deserialize Union: ', annotation, 'of value:', value) try: - return cls.__deserialize(key, value, type) + return cls._deserialize(key, value, type) except Exception: return value @classmethod - def __deserialize_enum(cls, key, value, annotation): + def _deserialize_enum(cls, key, value, annotation): try: return getattr(annotation, value.upper().replace(' ', '_')) except Exception: return value @classmethod - def __deserialize_nested_type(cls, key, value, annotation): + def _deserialize_nested_type(cls, key, value, annotation): try: return annotation.from_dict(value) except Exception: diff --git a/box_sdk_gen/managers/avatars.py b/box_sdk_gen/managers/avatars.py index 3e1405a..91ac65b 100644 --- a/box_sdk_gen/managers/avatars.py +++ b/box_sdk_gen/managers/avatars.py @@ -53,7 +53,7 @@ def get_user_avatar( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/avatar']), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id), '/avatar']), FetchOptions( method='GET', headers=headers_map, @@ -91,7 +91,7 @@ def create_user_avatar( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/avatar']), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id), '/avatar']), FetchOptions( method='POST', headers=headers_map, @@ -129,7 +129,7 @@ def delete_user_avatar( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/avatar']), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id), '/avatar']), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/chunked_uploads.py b/box_sdk_gen/managers/chunked_uploads.py index 39d78de..fb26046 100644 --- a/box_sdk_gen/managers/chunked_uploads.py +++ b/box_sdk_gen/managers/chunked_uploads.py @@ -154,7 +154,11 @@ def create_file_upload_session_for_existing_file( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://upload.box.com/api/2.0/files/', file_id, '/upload_sessions'] + [ + 'https://upload.box.com/api/2.0/files/', + to_string(file_id), + '/upload_sessions', + ] ), FetchOptions( method='POST', @@ -188,7 +192,7 @@ def get_file_upload_session_by_id( ''.join( [ 'https://upload.box.com/api/2.0/files/upload_sessions/', - upload_session_id, + to_string(upload_session_id), ] ), FetchOptions( @@ -252,7 +256,7 @@ def upload_file_part( ''.join( [ 'https://upload.box.com/api/2.0/files/upload_sessions/', - upload_session_id, + to_string(upload_session_id), ] ), FetchOptions( @@ -290,7 +294,7 @@ def delete_file_upload_session_by_id( ''.join( [ 'https://upload.box.com/api/2.0/files/upload_sessions/', - upload_session_id, + to_string(upload_session_id), ] ), FetchOptions( @@ -338,7 +342,7 @@ def get_file_upload_session_parts( ''.join( [ 'https://upload.box.com/api/2.0/files/upload_sessions/', - upload_session_id, + to_string(upload_session_id), '/parts', ] ), @@ -409,7 +413,7 @@ def create_file_upload_session_commit( ''.join( [ 'https://upload.box.com/api/2.0/files/upload_sessions/', - upload_session_id, + to_string(upload_session_id), '/commit', ] ), diff --git a/box_sdk_gen/managers/collaboration_allowlist_entries.py b/box_sdk_gen/managers/collaboration_allowlist_entries.py index 36c1813..adf9631 100644 --- a/box_sdk_gen/managers/collaboration_allowlist_entries.py +++ b/box_sdk_gen/managers/collaboration_allowlist_entries.py @@ -146,7 +146,7 @@ def get_collaboration_whitelist_entry_by_id( ''.join( [ 'https://api.box.com/2.0/collaboration_whitelist_entries/', - collaboration_whitelist_entry_id, + to_string(collaboration_whitelist_entry_id), ] ), FetchOptions( @@ -182,7 +182,7 @@ def delete_collaboration_whitelist_entry_by_id( ''.join( [ 'https://api.box.com/2.0/collaboration_whitelist_entries/', - collaboration_whitelist_entry_id, + to_string(collaboration_whitelist_entry_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/collaboration_allowlist_exempt_targets.py b/box_sdk_gen/managers/collaboration_allowlist_exempt_targets.py index 9cc97a1..dfc2eab 100644 --- a/box_sdk_gen/managers/collaboration_allowlist_exempt_targets.py +++ b/box_sdk_gen/managers/collaboration_allowlist_exempt_targets.py @@ -147,7 +147,7 @@ def get_collaboration_whitelist_exempt_target_by_id( ''.join( [ 'https://api.box.com/2.0/collaboration_whitelist_exempt_targets/', - collaboration_whitelist_exempt_target_id, + to_string(collaboration_whitelist_exempt_target_id), ] ), FetchOptions( @@ -183,7 +183,7 @@ def delete_collaboration_whitelist_exempt_target_by_id( ''.join( [ 'https://api.box.com/2.0/collaboration_whitelist_exempt_targets/', - collaboration_whitelist_exempt_target_id, + to_string(collaboration_whitelist_exempt_target_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/collections.py b/box_sdk_gen/managers/collections.py index ebaa0a4..b340f06 100644 --- a/box_sdk_gen/managers/collections.py +++ b/box_sdk_gen/managers/collections.py @@ -1,5 +1,7 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -38,7 +40,7 @@ def __init__( def get_collections( self, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, offset: Optional[int] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -59,7 +61,7 @@ def get_collections( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param offset: The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected @@ -96,7 +98,7 @@ def get_collections( def get_collection_items( self, collection_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, offset: Optional[int] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -117,7 +119,7 @@ def get_collection_items( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param offset: The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected @@ -139,7 +141,13 @@ def get_collection_items( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/collections/', collection_id, '/items']), + ''.join( + [ + 'https://api.box.com/2.0/collections/', + to_string(collection_id), + '/items', + ] + ), FetchOptions( method='GET', params=query_params_map, diff --git a/box_sdk_gen/managers/comments.py b/box_sdk_gen/managers/comments.py index d48345c..991e909 100644 --- a/box_sdk_gen/managers/comments.py +++ b/box_sdk_gen/managers/comments.py @@ -4,6 +4,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -67,7 +69,7 @@ def __init__( def get_file_comments( self, file_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, offset: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -90,7 +92,7 @@ def get_file_comments( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param offset: The offset of the item at which to begin the response. @@ -112,7 +114,9 @@ def get_file_comments( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/comments']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/comments'] + ), FetchOptions( method='GET', params=query_params_map, @@ -127,7 +131,7 @@ def get_file_comments( def get_comment_by_id( self, comment_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> CommentFull: """ @@ -146,7 +150,7 @@ def get_comment_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -155,7 +159,7 @@ def get_comment_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/comments/', comment_id]), + ''.join(['https://api.box.com/2.0/comments/', to_string(comment_id)]), FetchOptions( method='GET', params=query_params_map, @@ -171,7 +175,7 @@ def update_comment_by_id( self, comment_id: str, message: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> CommentFull: """ @@ -189,7 +193,7 @@ def update_comment_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -199,7 +203,7 @@ def update_comment_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/comments/', comment_id]), + ''.join(['https://api.box.com/2.0/comments/', to_string(comment_id)]), FetchOptions( method='PUT', params=query_params_map, @@ -228,7 +232,7 @@ def delete_comment_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/comments/', comment_id]), + ''.join(['https://api.box.com/2.0/comments/', to_string(comment_id)]), FetchOptions( method='DELETE', headers=headers_map, @@ -244,7 +248,7 @@ def create_comment( message: str, item: CreateCommentItemArg, tagged_message: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Comment: """ @@ -276,7 +280,7 @@ def create_comment( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ diff --git a/box_sdk_gen/managers/device_pinners.py b/box_sdk_gen/managers/device_pinners.py index 644f5c6..4527116 100644 --- a/box_sdk_gen/managers/device_pinners.py +++ b/box_sdk_gen/managers/device_pinners.py @@ -60,7 +60,9 @@ def get_device_pinner_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/device_pinners/', device_pinner_id]), + ''.join( + ['https://api.box.com/2.0/device_pinners/', to_string(device_pinner_id)] + ), FetchOptions( method='GET', headers=headers_map, @@ -88,7 +90,9 @@ def delete_device_pinner_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/device_pinners/', device_pinner_id]), + ''.join( + ['https://api.box.com/2.0/device_pinners/', to_string(device_pinner_id)] + ), FetchOptions( method='DELETE', headers=headers_map, @@ -144,7 +148,7 @@ def get_enterprise_device_pinners( ''.join( [ 'https://api.box.com/2.0/enterprises/', - enterprise_id, + to_string(enterprise_id), '/device_pinners', ] ), diff --git a/box_sdk_gen/managers/downloads.py b/box_sdk_gen/managers/downloads.py index 4990d18..4aa456e 100644 --- a/box_sdk_gen/managers/downloads.py +++ b/box_sdk_gen/managers/downloads.py @@ -78,7 +78,7 @@ def download_file( {'range': to_string(range), 'boxapi': to_string(boxapi), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/content']), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id), '/content']), FetchOptions( method='GET', params=query_params_map, diff --git a/box_sdk_gen/managers/email_aliases.py b/box_sdk_gen/managers/email_aliases.py index d4dfe9b..ebda443 100644 --- a/box_sdk_gen/managers/email_aliases.py +++ b/box_sdk_gen/managers/email_aliases.py @@ -58,7 +58,9 @@ def get_user_email_aliases( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/email_aliases']), + ''.join( + ['https://api.box.com/2.0/users/', to_string(user_id), '/email_aliases'] + ), FetchOptions( method='GET', headers=headers_map, @@ -95,7 +97,9 @@ def create_user_email_alias( request_body = BaseObject(email=email) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/email_aliases']), + ''.join( + ['https://api.box.com/2.0/users/', to_string(user_id), '/email_aliases'] + ), FetchOptions( method='POST', headers=headers_map, @@ -132,9 +136,9 @@ def delete_user_email_alias_by_id( ''.join( [ 'https://api.box.com/2.0/users/', - user_id, + to_string(user_id), '/email_aliases/', - email_alias_id, + to_string(email_alias_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/events.py b/box_sdk_gen/managers/events.py index cb4b44f..9a4d54a 100644 --- a/box_sdk_gen/managers/events.py +++ b/box_sdk_gen/managers/events.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -37,6 +39,136 @@ class GetEventsStreamTypeArg(str, Enum): ADMIN_LOGS_STREAMING = 'admin_logs_streaming' +class GetEventsEventTypeArg(str, Enum): + ACCESS_GRANTED = 'ACCESS_GRANTED' + ACCESS_REVOKED = 'ACCESS_REVOKED' + ADD_DEVICE_ASSOCIATION = 'ADD_DEVICE_ASSOCIATION' + ADD_LOGIN_ACTIVITY_DEVICE = 'ADD_LOGIN_ACTIVITY_DEVICE' + ADMIN_LOGIN = 'ADMIN_LOGIN' + APPLICATION_CREATED = 'APPLICATION_CREATED' + APPLICATION_PUBLIC_KEY_ADDED = 'APPLICATION_PUBLIC_KEY_ADDED' + APPLICATION_PUBLIC_KEY_DELETED = 'APPLICATION_PUBLIC_KEY_DELETED' + CHANGE_ADMIN_ROLE = 'CHANGE_ADMIN_ROLE' + CHANGE_FOLDER_PERMISSION = 'CHANGE_FOLDER_PERMISSION' + COLLABORATION_ACCEPT = 'COLLABORATION_ACCEPT' + COLLABORATION_EXPIRATION = 'COLLABORATION_EXPIRATION' + COLLABORATION_INVITE = 'COLLABORATION_INVITE' + COLLABORATION_REMOVE = 'COLLABORATION_REMOVE' + COLLABORATION_ROLE_CHANGE = 'COLLABORATION_ROLE_CHANGE' + COMMENT_CREATE = 'COMMENT_CREATE' + COMMENT_DELETE = 'COMMENT_DELETE' + CONTENT_WORKFLOW_ABNORMAL_DOWNLOAD_ACTIVITY = ( + 'CONTENT_WORKFLOW_ABNORMAL_DOWNLOAD_ACTIVITY' + ) + CONTENT_WORKFLOW_AUTOMATION_ADD = 'CONTENT_WORKFLOW_AUTOMATION_ADD' + CONTENT_WORKFLOW_AUTOMATION_DELETE = 'CONTENT_WORKFLOW_AUTOMATION_DELETE' + CONTENT_WORKFLOW_POLICY_ADD = 'CONTENT_WORKFLOW_POLICY_ADD' + CONTENT_WORKFLOW_SHARING_POLICY_VIOLATION = ( + 'CONTENT_WORKFLOW_SHARING_POLICY_VIOLATION' + ) + CONTENT_WORKFLOW_UPLOAD_POLICY_VIOLATION = ( + 'CONTENT_WORKFLOW_UPLOAD_POLICY_VIOLATION' + ) + COPY = 'COPY' + DATA_RETENTION_CREATE_RETENTION = 'DATA_RETENTION_CREATE_RETENTION' + DATA_RETENTION_REMOVE_RETENTION = 'DATA_RETENTION_REMOVE_RETENTION' + DELETE = 'DELETE' + DELETE_USER = 'DELETE_USER' + DEVICE_TRUST_CHECK_FAILED = 'DEVICE_TRUST_CHECK_FAILED' + DOWNLOAD = 'DOWNLOAD' + EDIT = 'EDIT' + EDIT_USER = 'EDIT_USER' + EMAIL_ALIAS_CONFIRM = 'EMAIL_ALIAS_CONFIRM' + EMAIL_ALIAS_REMOVE = 'EMAIL_ALIAS_REMOVE' + ENTERPRISE_APP_AUTHORIZATION_UPDATE = 'ENTERPRISE_APP_AUTHORIZATION_UPDATE' + EXTERNAL_COLLAB_SECURITY_SETTINGS = 'EXTERNAL_COLLAB_SECURITY_SETTINGS' + FAILED_LOGIN = 'FAILED_LOGIN' + FILE_MARKED_MALICIOUS = 'FILE_MARKED_MALICIOUS' + FILE_WATERMARKED_DOWNLOAD = 'FILE_WATERMARKED_DOWNLOAD' + GROUP_ADD_ITEM = 'GROUP_ADD_ITEM' + GROUP_ADD_USER = 'GROUP_ADD_USER' + GROUP_CREATION = 'GROUP_CREATION' + GROUP_DELETION = 'GROUP_DELETION' + GROUP_EDITED = 'GROUP_EDITED' + GROUP_REMOVE_ITEM = 'GROUP_REMOVE_ITEM' + GROUP_REMOVE_USER = 'GROUP_REMOVE_USER' + ITEM_MODIFY = 'ITEM_MODIFY' + ITEM_OPEN = 'ITEM_OPEN' + ITEM_SHARED_UPDATE = 'ITEM_SHARED_UPDATE' + ITEM_SYNC = 'ITEM_SYNC' + ITEM_UNSYNC = 'ITEM_UNSYNC' + LEGAL_HOLD_ASSIGNMENT_CREATE = 'LEGAL_HOLD_ASSIGNMENT_CREATE' + LEGAL_HOLD_ASSIGNMENT_DELETE = 'LEGAL_HOLD_ASSIGNMENT_DELETE' + LEGAL_HOLD_POLICY_CREATE = 'LEGAL_HOLD_POLICY_CREATE' + LEGAL_HOLD_POLICY_DELETE = 'LEGAL_HOLD_POLICY_DELETE' + LEGAL_HOLD_POLICY_UPDATE = 'LEGAL_HOLD_POLICY_UPDATE' + LOCK = 'LOCK' + LOGIN = 'LOGIN' + METADATA_INSTANCE_CREATE = 'METADATA_INSTANCE_CREATE' + METADATA_INSTANCE_DELETE = 'METADATA_INSTANCE_DELETE' + METADATA_INSTANCE_UPDATE = 'METADATA_INSTANCE_UPDATE' + METADATA_TEMPLATE_CREATE = 'METADATA_TEMPLATE_CREATE' + METADATA_TEMPLATE_DELETE = 'METADATA_TEMPLATE_DELETE' + METADATA_TEMPLATE_UPDATE = 'METADATA_TEMPLATE_UPDATE' + MOVE = 'MOVE' + NEW_USER = 'NEW_USER' + OAUTH2_ACCESS_TOKEN_REVOKE = 'OAUTH2_ACCESS_TOKEN_REVOKE' + PREVIEW = 'PREVIEW' + REMOVE_DEVICE_ASSOCIATION = 'REMOVE_DEVICE_ASSOCIATION' + REMOVE_LOGIN_ACTIVITY_DEVICE = 'REMOVE_LOGIN_ACTIVITY_DEVICE' + RENAME = 'RENAME' + RETENTION_POLICY_ASSIGNMENT_ADD = 'RETENTION_POLICY_ASSIGNMENT_ADD' + SHARE = 'SHARE' + SHARE_EXPIRATION = 'SHARE_EXPIRATION' + SHIELD_ALERT = 'SHIELD_ALERT' + SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED = 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' + SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION = ( + 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION' + ) + SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED = 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED' + SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION = ( + 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION' + ) + SHIELD_JUSTIFICATION_APPROVAL = 'SHIELD_JUSTIFICATION_APPROVAL' + SHIELD_SHARED_LINK_ACCESS_BLOCKED = 'SHIELD_SHARED_LINK_ACCESS_BLOCKED' + SHIELD_SHARED_LINK_STATUS_RESTRICTED_ON_CREATE = ( + 'SHIELD_SHARED_LINK_STATUS_RESTRICTED_ON_CREATE' + ) + SHIELD_SHARED_LINK_STATUS_RESTRICTED_ON_UPDATE = ( + 'SHIELD_SHARED_LINK_STATUS_RESTRICTED_ON_UPDATE' + ) + SIGN_DOCUMENT_ASSIGNED = 'SIGN_DOCUMENT_ASSIGNED' + SIGN_DOCUMENT_CANCELLED = 'SIGN_DOCUMENT_CANCELLED' + SIGN_DOCUMENT_COMPLETED = 'SIGN_DOCUMENT_COMPLETED' + SIGN_DOCUMENT_CONVERTED = 'SIGN_DOCUMENT_CONVERTED' + SIGN_DOCUMENT_CREATED = 'SIGN_DOCUMENT_CREATED' + SIGN_DOCUMENT_DECLINED = 'SIGN_DOCUMENT_DECLINED' + SIGN_DOCUMENT_EXPIRED = 'SIGN_DOCUMENT_EXPIRED' + SIGN_DOCUMENT_SIGNED = 'SIGN_DOCUMENT_SIGNED' + SIGN_DOCUMENT_VIEWED_BY_SIGNED = 'SIGN_DOCUMENT_VIEWED_BY_SIGNED' + SIGNER_DOWNLOADED = 'SIGNER_DOWNLOADED' + SIGNER_FORWARDED = 'SIGNER_FORWARDED' + STORAGE_EXPIRATION = 'STORAGE_EXPIRATION' + TASK_ASSIGNMENT_CREATE = 'TASK_ASSIGNMENT_CREATE' + TASK_ASSIGNMENT_DELETE = 'TASK_ASSIGNMENT_DELETE' + TASK_ASSIGNMENT_UPDATE = 'TASK_ASSIGNMENT_UPDATE' + TASK_CREATE = 'TASK_CREATE' + TASK_UPDATE = 'TASK_UPDATE' + TERMS_OF_SERVICE_ACCEPT = 'TERMS_OF_SERVICE_ACCEPT' + TERMS_OF_SERVICE_REJECT = 'TERMS_OF_SERVICE_REJECT' + UNDELETE = 'UNDELETE' + UNLOCK = 'UNLOCK' + UNSHARE = 'UNSHARE' + UPDATE_COLLABORATION_EXPIRATION = 'UPDATE_COLLABORATION_EXPIRATION' + UPDATE_SHARE_EXPIRATION = 'UPDATE_SHARE_EXPIRATION' + UPLOAD = 'UPLOAD' + USER_AUTHENTICATE_OAUTH2_ACCESS_TOKEN_CREATE = ( + 'USER_AUTHENTICATE_OAUTH2_ACCESS_TOKEN_CREATE' + ) + WATERMARK_LABEL_CREATE = 'WATERMARK_LABEL_CREATE' + WATERMARK_LABEL_DELETE = 'WATERMARK_LABEL_DELETE' + + class EventsManager: def __init__( self, @@ -51,7 +183,7 @@ def get_events( stream_type: Optional[GetEventsStreamTypeArg] = None, stream_position: Optional[str] = None, limit: Optional[int] = None, - event_type: Optional[str] = None, + event_type: Optional[List[GetEventsEventTypeArg]] = None, created_after: Optional[str] = None, created_before: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -114,7 +246,7 @@ def get_events( requesting the events with a `stream_type` of `admin_logs` or `adming_logs_streaming`. For any other `stream_type` this value will be ignored. - :type event_type: Optional[str], optional + :type event_type: Optional[List[GetEventsEventTypeArg]], optional :param created_after: The lower bound date and time to return events for. This can only be used when requesting the events with a `stream_type` of `admin_logs`. For any other `stream_type` this value will be ignored. diff --git a/box_sdk_gen/managers/file_classifications.py b/box_sdk_gen/managers/file_classifications.py index 438fb13..327e055 100644 --- a/box_sdk_gen/managers/file_classifications.py +++ b/box_sdk_gen/managers/file_classifications.py @@ -121,7 +121,7 @@ def get_file_metadata_enterprise_security_classification_6_vm_vochw_u_wo( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -182,7 +182,7 @@ def create_file_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -237,7 +237,7 @@ def update_file_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -285,7 +285,7 @@ def delete_file_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), diff --git a/box_sdk_gen/managers/file_metadata.py b/box_sdk_gen/managers/file_metadata.py index babfa9b..394962c 100644 --- a/box_sdk_gen/managers/file_metadata.py +++ b/box_sdk_gen/managers/file_metadata.py @@ -144,7 +144,9 @@ def get_file_metadata( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/metadata']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/metadata'] + ), FetchOptions( method='GET', headers=headers_map, @@ -191,11 +193,11 @@ def get_file_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -253,11 +255,11 @@ def create_file_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -323,11 +325,11 @@ def update_file_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -375,11 +377,11 @@ def delete_file_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/file_requests.py b/box_sdk_gen/managers/file_requests.py index 65d37ae..3dbaa19 100644 --- a/box_sdk_gen/managers/file_requests.py +++ b/box_sdk_gen/managers/file_requests.py @@ -101,7 +101,9 @@ def get_file_request_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/file_requests/', file_request_id]), + ''.join( + ['https://api.box.com/2.0/file_requests/', to_string(file_request_id)] + ), FetchOptions( method='GET', headers=headers_map, @@ -194,7 +196,9 @@ def update_file_request_by_id( {'if-match': to_string(if_match), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/file_requests/', file_request_id]), + ''.join( + ['https://api.box.com/2.0/file_requests/', to_string(file_request_id)] + ), FetchOptions( method='PUT', headers=headers_map, @@ -229,7 +233,9 @@ def delete_file_request_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/file_requests/', file_request_id]), + ''.join( + ['https://api.box.com/2.0/file_requests/', to_string(file_request_id)] + ), FetchOptions( method='DELETE', headers=headers_map, @@ -317,7 +323,11 @@ def create_file_request_copy( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/file_requests/', file_request_id, '/copy'] + [ + 'https://api.box.com/2.0/file_requests/', + to_string(file_request_id), + '/copy', + ] ), FetchOptions( method='POST', diff --git a/box_sdk_gen/managers/file_version_legal_holds.py b/box_sdk_gen/managers/file_version_legal_holds.py index 004e6c1..8f19b5e 100644 --- a/box_sdk_gen/managers/file_version_legal_holds.py +++ b/box_sdk_gen/managers/file_version_legal_holds.py @@ -59,7 +59,7 @@ def get_file_version_legal_hold_by_id( ''.join( [ 'https://api.box.com/2.0/file_version_legal_holds/', - file_version_legal_hold_id, + to_string(file_version_legal_hold_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/file_version_retentions.py b/box_sdk_gen/managers/file_version_retentions.py index 921dd05..5bf45cc 100644 --- a/box_sdk_gen/managers/file_version_retentions.py +++ b/box_sdk_gen/managers/file_version_retentions.py @@ -131,7 +131,7 @@ def get_file_version_retention_by_id( ''.join( [ 'https://api.box.com/2.0/file_version_retentions/', - file_version_retention_id, + to_string(file_version_retention_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/file_versions.py b/box_sdk_gen/managers/file_versions.py index 0eaf712..6ddeda3 100644 --- a/box_sdk_gen/managers/file_versions.py +++ b/box_sdk_gen/managers/file_versions.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -49,7 +51,7 @@ def __init__( def get_file_versions( self, file_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, offset: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -78,7 +80,7 @@ def get_file_versions( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param offset: The offset of the item at which to begin the response. @@ -100,7 +102,9 @@ def get_file_versions( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/versions']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/versions'] + ), FetchOptions( method='GET', params=query_params_map, @@ -116,7 +120,7 @@ def get_file_version_by_id( self, file_id: str, file_version_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileVersionFull: """ @@ -143,7 +147,7 @@ def get_file_version_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -155,9 +159,9 @@ def get_file_version_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/versions/', - file_version_id, + to_string(file_version_id), ] ), FetchOptions( @@ -214,9 +218,9 @@ def update_file_version_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/versions/', - file_version_id, + to_string(file_version_id), ] ), FetchOptions( @@ -273,9 +277,9 @@ def delete_file_version_by_id( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/versions/', - file_version_id, + to_string(file_version_id), ] ), FetchOptions( @@ -293,7 +297,7 @@ def promote_file_version( file_id: str, id: Optional[str] = None, type: Optional[PromoteFileVersionTypeArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileVersionFull: """ @@ -351,7 +355,7 @@ def promote_file_version( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -361,7 +365,13 @@ def promote_file_version( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/versions/current']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '/versions/current', + ] + ), FetchOptions( method='POST', params=query_params_map, diff --git a/box_sdk_gen/managers/file_watermarks.py b/box_sdk_gen/managers/file_watermarks.py index b398127..89ee04c 100644 --- a/box_sdk_gen/managers/file_watermarks.py +++ b/box_sdk_gen/managers/file_watermarks.py @@ -77,7 +77,9 @@ def get_file_watermark( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/watermark'] + ), FetchOptions( method='GET', headers=headers_map, @@ -114,7 +116,9 @@ def update_file_watermark( request_body = BaseObject(watermark=watermark) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/watermark'] + ), FetchOptions( method='PUT', headers=headers_map, @@ -147,7 +151,9 @@ def delete_file_watermark( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/files/', to_string(file_id), '/watermark'] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/files.py b/box_sdk_gen/managers/files.py index 0a4206e..98018e0 100644 --- a/box_sdk_gen/managers/files.py +++ b/box_sdk_gen/managers/files.py @@ -4,12 +4,12 @@ from enum import Enum +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize -from typing import List - from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -201,7 +201,7 @@ def __init__( def get_file_by_id( self, file_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_none_match: Optional[str] = None, boxapi: Optional[str] = None, x_rep_hints: Optional[str] = None, @@ -229,7 +229,7 @@ def get_file_by_id( applied to the file by specifying the `metadata` field as well as the scope and key of the template to retrieve, for example `?field=metadata.enterprise_12345.contractTemplate`. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_none_match: Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail @@ -274,7 +274,7 @@ def get_file_by_id( } ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id]), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id)]), FetchOptions( method='GET', params=query_params_map, @@ -298,7 +298,7 @@ def update_file_by_id( permissions: Optional[UpdateFileByIdPermissionsArg] = None, collections: Optional[List[UpdateFileByIdCollectionsArg]] = None, tags: Optional[List[str]] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_match: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileFull: @@ -357,7 +357,7 @@ def update_file_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_match: Ensures this item hasn't recently changed before making changes. Pass in the item's last observed `etag` value @@ -386,7 +386,7 @@ def update_file_by_id( {'if-match': to_string(if_match), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id]), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id)]), FetchOptions( method='PUT', params=query_params_map, @@ -441,7 +441,7 @@ def delete_file_by_id( {'if-match': to_string(if_match), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id]), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id)]), FetchOptions( method='DELETE', headers=headers_map, @@ -458,7 +458,7 @@ def copy_file( parent: CopyFileParentArg, name: Optional[str] = None, version: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileFull: """ @@ -490,7 +490,7 @@ def copy_file( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -500,7 +500,7 @@ def copy_file( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/copy']), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id), '/copy']), FetchOptions( method='POST', params=query_params_map, @@ -579,7 +579,12 @@ def get_file_thumbnail_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/files/', file_id, '/thumbnail.', extension] + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '/thumbnail.', + to_string(extension), + ] ), FetchOptions( method='GET', diff --git a/box_sdk_gen/managers/folder_classifications.py b/box_sdk_gen/managers/folder_classifications.py index a7ad11d..242295b 100644 --- a/box_sdk_gen/managers/folder_classifications.py +++ b/box_sdk_gen/managers/folder_classifications.py @@ -123,7 +123,7 @@ def get_folder_metadata_enterprise_security_classification_6_vm_vochw_u_wo( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -186,7 +186,7 @@ def create_folder_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -243,7 +243,7 @@ def update_folder_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), @@ -293,7 +293,7 @@ def delete_folder_metadata_enterprise_security_classification( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/enterprise/securityClassification-6VMVochwUWo', ] ), diff --git a/box_sdk_gen/managers/folder_locks.py b/box_sdk_gen/managers/folder_locks.py index c3611b6..4b7060b 100644 --- a/box_sdk_gen/managers/folder_locks.py +++ b/box_sdk_gen/managers/folder_locks.py @@ -178,7 +178,9 @@ def delete_folder_lock_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folder_locks/', folder_lock_id]), + ''.join( + ['https://api.box.com/2.0/folder_locks/', to_string(folder_lock_id)] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/folder_metadata.py b/box_sdk_gen/managers/folder_metadata.py index 1000260..d0925b2 100644 --- a/box_sdk_gen/managers/folder_metadata.py +++ b/box_sdk_gen/managers/folder_metadata.py @@ -149,7 +149,9 @@ def get_folder_metadata( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/metadata']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/metadata'] + ), FetchOptions( method='GET', headers=headers_map, @@ -198,11 +200,11 @@ def get_folder_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -271,11 +273,11 @@ def create_folder_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -343,11 +345,11 @@ def update_folder_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( @@ -397,11 +399,11 @@ def delete_folder_metadata_by_id( ''.join( [ 'https://api.box.com/2.0/folders/', - folder_id, + to_string(folder_id), '/metadata/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/folder_watermarks.py b/box_sdk_gen/managers/folder_watermarks.py index bc50e38..d28041d 100644 --- a/box_sdk_gen/managers/folder_watermarks.py +++ b/box_sdk_gen/managers/folder_watermarks.py @@ -81,7 +81,9 @@ def get_folder_watermark( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/watermark'] + ), FetchOptions( method='GET', headers=headers_map, @@ -120,7 +122,9 @@ def update_folder_watermark( request_body = BaseObject(watermark=watermark) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/watermark'] + ), FetchOptions( method='PUT', headers=headers_map, @@ -155,7 +159,9 @@ def delete_folder_watermark( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/watermark']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/watermark'] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/folders.py b/box_sdk_gen/managers/folders.py index 442d73a..61b5a75 100644 --- a/box_sdk_gen/managers/folders.py +++ b/box_sdk_gen/managers/folders.py @@ -4,12 +4,12 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize -from typing import List - from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -249,7 +249,7 @@ def __init__( def get_folder_by_id( self, folder_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, sort: Optional[GetFolderByIdSortArg] = None, direction: Optional[GetFolderByIdDirectionArg] = None, offset: Optional[int] = None, @@ -303,7 +303,7 @@ def get_folder_by_id( applied to the file by specifying the `metadata` field as well as the scope and key of the template to retrieve, for example `?field=metadata.enterprise_12345.contractTemplate`. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param sort: Defines the **second** attribute by which items are sorted. The folder type affects the way the items @@ -374,7 +374,7 @@ def get_folder_by_id( } ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id]), + ''.join(['https://api.box.com/2.0/folders/', to_string(folder_id)]), FetchOptions( method='GET', params=query_params_map, @@ -400,7 +400,7 @@ def update_folder_by_id( is_collaboration_restricted_to_enterprise: Optional[bool] = None, collections: Optional[List[UpdateFolderByIdCollectionsArg]] = None, can_non_owners_view_collaborators: Optional[bool] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_match: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FolderFull: @@ -470,7 +470,7 @@ def update_folder_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_match: Ensures this item hasn't recently changed before making changes. Pass in the item's last observed `etag` value @@ -501,7 +501,7 @@ def update_folder_by_id( {'if-match': to_string(if_match), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id]), + ''.join(['https://api.box.com/2.0/folders/', to_string(folder_id)]), FetchOptions( method='PUT', params=query_params_map, @@ -559,7 +559,7 @@ def delete_folder_by_id( {'if-match': to_string(if_match), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id]), + ''.join(['https://api.box.com/2.0/folders/', to_string(folder_id)]), FetchOptions( method='DELETE', params=query_params_map, @@ -574,7 +574,7 @@ def delete_folder_by_id( def get_folder_items( self, folder_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, usemarker: Optional[bool] = None, marker: Optional[str] = None, offset: Optional[int] = None, @@ -617,7 +617,7 @@ def get_folder_items( applied to the file by specifying the `metadata` field as well as the scope and key of the template to retrieve, for example `?field=metadata.enterprise_12345.contractTemplate`. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param usemarker: Specifies whether to use marker-based pagination instead of offset-based pagination. Only one pagination method can be used at a time. @@ -691,7 +691,9 @@ def get_folder_items( {'boxapi': to_string(boxapi), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/items']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/items'] + ), FetchOptions( method='GET', params=query_params_map, @@ -709,7 +711,7 @@ def create_folder( parent: CreateFolderParentArg, folder_upload_email: Optional[CreateFolderFolderUploadEmailArg] = None, sync_state: Optional[CreateFolderSyncStateArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FolderFull: """ @@ -736,7 +738,7 @@ def create_folder( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -770,7 +772,7 @@ def copy_folder( folder_id: str, parent: CopyFolderParentArg, name: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FolderFull: """ @@ -805,7 +807,7 @@ def copy_folder( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -815,7 +817,9 @@ def copy_folder( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/copy']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/copy'] + ), FetchOptions( method='POST', params=query_params_map, diff --git a/box_sdk_gen/managers/groups.py b/box_sdk_gen/managers/groups.py index 9b12f6f..1090906 100644 --- a/box_sdk_gen/managers/groups.py +++ b/box_sdk_gen/managers/groups.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -71,7 +73,7 @@ def __init__( def get_groups( self, filter_term: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, offset: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -92,7 +94,7 @@ def get_groups( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param offset: The offset of the item at which to begin the response. @@ -135,7 +137,7 @@ def create_group( description: Optional[str] = None, invitability_level: Optional[CreateGroupInvitabilityLevelArg] = None, member_viewability_level: Optional[CreateGroupMemberViewabilityLevelArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Group: """ @@ -189,7 +191,7 @@ def create_group( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -223,7 +225,7 @@ def create_group( def get_group_by_id( self, group_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> GroupFull: """ @@ -245,7 +247,7 @@ def get_group_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -254,7 +256,7 @@ def get_group_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/groups/', group_id]), + ''.join(['https://api.box.com/2.0/groups/', to_string(group_id)]), FetchOptions( method='GET', params=query_params_map, @@ -277,7 +279,7 @@ def update_group_by_id( member_viewability_level: Optional[ UpdateGroupByIdMemberViewabilityLevelArg ] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> GroupFull: """ @@ -337,7 +339,7 @@ def update_group_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -354,7 +356,7 @@ def update_group_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/groups/', group_id]), + ''.join(['https://api.box.com/2.0/groups/', to_string(group_id)]), FetchOptions( method='PUT', params=query_params_map, @@ -386,7 +388,7 @@ def delete_group_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/groups/', group_id]), + ''.join(['https://api.box.com/2.0/groups/', to_string(group_id)]), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/integration_mappings.py b/box_sdk_gen/managers/integration_mappings.py index 0ca8311..e58f91f 100644 --- a/box_sdk_gen/managers/integration_mappings.py +++ b/box_sdk_gen/managers/integration_mappings.py @@ -198,7 +198,7 @@ def update_integration_mapping_slack_by_id( ''.join( [ 'https://api.box.com/2.0/integration_mappings/slack/', - integration_mapping_id, + to_string(integration_mapping_id), ] ), FetchOptions( @@ -239,7 +239,7 @@ def delete_integration_mapping_slack_by_id( ''.join( [ 'https://api.box.com/2.0/integration_mappings/slack/', - integration_mapping_id, + to_string(integration_mapping_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/invites.py b/box_sdk_gen/managers/invites.py index 0211abd..4c4ca0d 100644 --- a/box_sdk_gen/managers/invites.py +++ b/box_sdk_gen/managers/invites.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -64,7 +66,7 @@ def create_invite( self, enterprise: CreateInviteEnterpriseArg, actionable_by: CreateInviteActionableByArg, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Invite: """ @@ -99,7 +101,7 @@ def create_invite( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -126,7 +128,7 @@ def create_invite( def get_invite_by_id( self, invite_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Invite: """ @@ -142,7 +144,7 @@ def get_invite_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -151,7 +153,7 @@ def get_invite_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/invites/', invite_id]), + ''.join(['https://api.box.com/2.0/invites/', to_string(invite_id)]), FetchOptions( method='GET', params=query_params_map, diff --git a/box_sdk_gen/managers/legal_hold_policies.py b/box_sdk_gen/managers/legal_hold_policies.py index 752876e..2257b2b 100644 --- a/box_sdk_gen/managers/legal_hold_policies.py +++ b/box_sdk_gen/managers/legal_hold_policies.py @@ -1,5 +1,7 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -43,7 +45,7 @@ def __init__( def get_legal_hold_policies( self, policy_name: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, marker: Optional[str] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -64,7 +66,7 @@ def get_legal_hold_policies( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param marker: Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. @@ -184,7 +186,10 @@ def get_legal_hold_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/legal_hold_policies/', legal_hold_policy_id] + [ + 'https://api.box.com/2.0/legal_hold_policies/', + to_string(legal_hold_policy_id), + ] ), FetchOptions( method='GET', @@ -228,7 +233,10 @@ def update_legal_hold_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/legal_hold_policies/', legal_hold_policy_id] + [ + 'https://api.box.com/2.0/legal_hold_policies/', + to_string(legal_hold_policy_id), + ] ), FetchOptions( method='PUT', @@ -266,7 +274,10 @@ def delete_legal_hold_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/legal_hold_policies/', legal_hold_policy_id] + [ + 'https://api.box.com/2.0/legal_hold_policies/', + to_string(legal_hold_policy_id), + ] ), FetchOptions( method='DELETE', diff --git a/box_sdk_gen/managers/legal_hold_policy_assignments.py b/box_sdk_gen/managers/legal_hold_policy_assignments.py index 1b1376d..92e2bf9 100644 --- a/box_sdk_gen/managers/legal_hold_policy_assignments.py +++ b/box_sdk_gen/managers/legal_hold_policy_assignments.py @@ -4,6 +4,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -85,7 +87,7 @@ def get_legal_hold_policy_assignments( assign_to_id: Optional[str] = None, marker: Optional[str] = None, limit: Optional[int] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> LegalHoldPolicyAssignments: """ @@ -112,7 +114,7 @@ def get_legal_hold_policy_assignments( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -195,7 +197,7 @@ def get_legal_hold_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/legal_hold_policy_assignments/', - legal_hold_policy_assignment_id, + to_string(legal_hold_policy_assignment_id), ] ), FetchOptions( @@ -234,7 +236,7 @@ def delete_legal_hold_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/legal_hold_policy_assignments/', - legal_hold_policy_assignment_id, + to_string(legal_hold_policy_assignment_id), ] ), FetchOptions( @@ -252,7 +254,7 @@ def get_legal_hold_policy_assignment_file_on_hold( legal_hold_policy_assignment_id: str, marker: Optional[str] = None, limit: Optional[int] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileVersionLegalHolds: """ @@ -310,7 +312,7 @@ def get_legal_hold_policy_assignment_file_on_hold( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -328,7 +330,7 @@ def get_legal_hold_policy_assignment_file_on_hold( ''.join( [ 'https://api.box.com/2.0/legal_hold_policy_assignments/', - legal_hold_policy_assignment_id, + to_string(legal_hold_policy_assignment_id), '/files_on_hold', ] ), @@ -348,7 +350,7 @@ def get_legal_hold_policy_assignment_file_version_on_hold( legal_hold_policy_assignment_id: str, marker: Optional[str] = None, limit: Optional[int] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileVersionLegalHolds: """ @@ -406,7 +408,7 @@ def get_legal_hold_policy_assignment_file_version_on_hold( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -424,7 +426,7 @@ def get_legal_hold_policy_assignment_file_version_on_hold( ''.join( [ 'https://api.box.com/2.0/legal_hold_policy_assignments/', - legal_hold_policy_assignment_id, + to_string(legal_hold_policy_assignment_id), '/file_versions_on_hold', ] ), diff --git a/box_sdk_gen/managers/list_collaborations.py b/box_sdk_gen/managers/list_collaborations.py index 5a6ce2e..d2e77b3 100644 --- a/box_sdk_gen/managers/list_collaborations.py +++ b/box_sdk_gen/managers/list_collaborations.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -43,7 +45,7 @@ def __init__( def get_file_collaborations( self, file_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, marker: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -72,7 +74,7 @@ def get_file_collaborations( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param marker: Defines the position marker at which to begin returning results. This is @@ -93,7 +95,13 @@ def get_file_collaborations( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/collaborations']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '/collaborations', + ] + ), FetchOptions( method='GET', params=query_params_map, @@ -108,7 +116,7 @@ def get_file_collaborations( def get_folder_collaborations( self, folder_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Collaborations: """ @@ -135,7 +143,7 @@ def get_folder_collaborations( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -144,7 +152,13 @@ def get_folder_collaborations( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/collaborations']), + ''.join( + [ + 'https://api.box.com/2.0/folders/', + to_string(folder_id), + '/collaborations', + ] + ), FetchOptions( method='GET', params=query_params_map, @@ -159,7 +173,7 @@ def get_folder_collaborations( def get_collaborations( self, status: GetCollaborationsStatusArg, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, offset: Optional[int] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -176,7 +190,7 @@ def get_collaborations( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param offset: The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected @@ -249,7 +263,13 @@ def get_group_collaborations( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/groups/', group_id, '/collaborations']), + ''.join( + [ + 'https://api.box.com/2.0/groups/', + to_string(group_id), + '/collaborations', + ] + ), FetchOptions( method='GET', params=query_params_map, diff --git a/box_sdk_gen/managers/memberships.py b/box_sdk_gen/managers/memberships.py index 4dbd0a7..e20609e 100644 --- a/box_sdk_gen/managers/memberships.py +++ b/box_sdk_gen/managers/memberships.py @@ -8,6 +8,8 @@ from box_sdk_gen.serialization import deserialize +from typing import List + from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -109,7 +111,9 @@ def get_user_memberships( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/memberships']), + ''.join( + ['https://api.box.com/2.0/users/', to_string(user_id), '/memberships'] + ), FetchOptions( method='GET', params=query_params_map, @@ -156,7 +160,9 @@ def get_group_memberships( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/groups/', group_id, '/memberships']), + ''.join( + ['https://api.box.com/2.0/groups/', to_string(group_id), '/memberships'] + ), FetchOptions( method='GET', params=query_params_map, @@ -174,7 +180,7 @@ def create_group_membership( group: CreateGroupMembershipGroupArg, role: Optional[CreateGroupMembershipRoleArg] = None, configurable_permissions: Optional[Dict[str, bool]] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> GroupMembership: """ @@ -205,7 +211,7 @@ def create_group_membership( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -237,7 +243,7 @@ def create_group_membership( def get_group_membership_by_id( self, group_membership_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> GroupMembership: """ @@ -259,7 +265,7 @@ def get_group_membership_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -269,7 +275,10 @@ def get_group_membership_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/group_memberships/', group_membership_id] + [ + 'https://api.box.com/2.0/group_memberships/', + to_string(group_membership_id), + ] ), FetchOptions( method='GET', @@ -287,7 +296,7 @@ def update_group_membership_by_id( group_membership_id: str, role: Optional[UpdateGroupMembershipByIdRoleArg] = None, configurable_permissions: Optional[Dict[str, bool]] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> GroupMembership: """ @@ -320,7 +329,7 @@ def update_group_membership_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -333,7 +342,10 @@ def update_group_membership_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/group_memberships/', group_membership_id] + [ + 'https://api.box.com/2.0/group_memberships/', + to_string(group_membership_id), + ] ), FetchOptions( method='PUT', @@ -372,7 +384,10 @@ def delete_group_membership_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/group_memberships/', group_membership_id] + [ + 'https://api.box.com/2.0/group_memberships/', + to_string(group_membership_id), + ] ), FetchOptions( method='DELETE', diff --git a/box_sdk_gen/managers/metadata_cascade_policies.py b/box_sdk_gen/managers/metadata_cascade_policies.py index 69d4480..d38b2a7 100644 --- a/box_sdk_gen/managers/metadata_cascade_policies.py +++ b/box_sdk_gen/managers/metadata_cascade_policies.py @@ -197,7 +197,7 @@ def get_metadata_cascade_policy_by_id( ''.join( [ 'https://api.box.com/2.0/metadata_cascade_policies/', - metadata_cascade_policy_id, + to_string(metadata_cascade_policy_id), ] ), FetchOptions( @@ -230,7 +230,7 @@ def delete_metadata_cascade_policy_by_id( ''.join( [ 'https://api.box.com/2.0/metadata_cascade_policies/', - metadata_cascade_policy_id, + to_string(metadata_cascade_policy_id), ] ), FetchOptions( @@ -281,7 +281,7 @@ def create_metadata_cascade_policy_apply( ''.join( [ 'https://api.box.com/2.0/metadata_cascade_policies/', - metadata_cascade_policy_id, + to_string(metadata_cascade_policy_id), '/apply', ] ), diff --git a/box_sdk_gen/managers/metadata_templates.py b/box_sdk_gen/managers/metadata_templates.py index 8dcb7fb..0e4edca 100644 --- a/box_sdk_gen/managers/metadata_templates.py +++ b/box_sdk_gen/managers/metadata_templates.py @@ -283,9 +283,9 @@ def get_metadata_template_schema( ''.join( [ 'https://api.box.com/2.0/metadata_templates/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), '/schema', ] ), @@ -338,9 +338,9 @@ def update_metadata_template_schema( ''.join( [ 'https://api.box.com/2.0/metadata_templates/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), '/schema', ] ), @@ -383,9 +383,9 @@ def delete_metadata_template_schema( ''.join( [ 'https://api.box.com/2.0/metadata_templates/', - scope, + to_string(scope), '/', - template_key, + to_string(template_key), '/schema', ] ), @@ -414,7 +414,9 @@ def get_metadata_template_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/metadata_templates/', template_id]), + ''.join( + ['https://api.box.com/2.0/metadata_templates/', to_string(template_id)] + ), FetchOptions( method='GET', headers=headers_map, diff --git a/box_sdk_gen/managers/recent_items.py b/box_sdk_gen/managers/recent_items.py index 5460450..cac4c22 100644 --- a/box_sdk_gen/managers/recent_items.py +++ b/box_sdk_gen/managers/recent_items.py @@ -1,5 +1,7 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -36,7 +38,7 @@ def __init__( def get_recent_items( self, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, marker: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -57,7 +59,7 @@ def get_recent_items( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param marker: Defines the position marker at which to begin returning results. This is diff --git a/box_sdk_gen/managers/retention_policies.py b/box_sdk_gen/managers/retention_policies.py index 7d2e99a..2a40bbe 100644 --- a/box_sdk_gen/managers/retention_policies.py +++ b/box_sdk_gen/managers/retention_policies.py @@ -2,12 +2,12 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize -from typing import List - from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -76,7 +76,7 @@ def get_retention_policies( policy_name: Optional[str] = None, policy_type: Optional[GetRetentionPoliciesPolicyTypeArg] = None, created_by_user_id: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, marker: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -98,7 +98,7 @@ def get_retention_policies( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param marker: Defines the position marker at which to begin returning results. This is @@ -229,7 +229,7 @@ def create_retention_policy( def get_retention_policy_by_id( self, retention_policy_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> RetentionPolicy: """ @@ -245,7 +245,7 @@ def get_retention_policy_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -255,7 +255,10 @@ def get_retention_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/retention_policies/', retention_policy_id] + [ + 'https://api.box.com/2.0/retention_policies/', + to_string(retention_policy_id), + ] ), FetchOptions( method='GET', @@ -358,7 +361,10 @@ def update_retention_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/retention_policies/', retention_policy_id] + [ + 'https://api.box.com/2.0/retention_policies/', + to_string(retention_policy_id), + ] ), FetchOptions( method='PUT', @@ -390,7 +396,10 @@ def delete_retention_policy_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/retention_policies/', retention_policy_id] + [ + 'https://api.box.com/2.0/retention_policies/', + to_string(retention_policy_id), + ] ), FetchOptions( method='DELETE', diff --git a/box_sdk_gen/managers/retention_policy_assignments.py b/box_sdk_gen/managers/retention_policy_assignments.py index f161805..81247ab 100644 --- a/box_sdk_gen/managers/retention_policy_assignments.py +++ b/box_sdk_gen/managers/retention_policy_assignments.py @@ -4,12 +4,12 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize -from typing import List - from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -100,7 +100,7 @@ def get_retention_policy_assignments( self, retention_policy_id: str, type: Optional[GetRetentionPolicyAssignmentsTypeArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, marker: Optional[str] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -123,7 +123,7 @@ def get_retention_policy_assignments( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param marker: Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. :type marker: Optional[str], optional @@ -147,7 +147,7 @@ def get_retention_policy_assignments( ''.join( [ 'https://api.box.com/2.0/retention_policies/', - retention_policy_id, + to_string(retention_policy_id), '/assignments', ] ), @@ -216,7 +216,7 @@ def create_retention_policy_assignment( def get_retention_policy_assignment_by_id( self, retention_policy_assignment_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> RetentionPolicyAssignment: """ @@ -232,7 +232,7 @@ def get_retention_policy_assignment_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -244,7 +244,7 @@ def get_retention_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/retention_policy_assignments/', - retention_policy_assignment_id, + to_string(retention_policy_assignment_id), ] ), FetchOptions( @@ -281,7 +281,7 @@ def delete_retention_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/retention_policy_assignments/', - retention_policy_assignment_id, + to_string(retention_policy_assignment_id), ] ), FetchOptions( @@ -325,7 +325,7 @@ def get_retention_policy_assignment_file_under_retention( ''.join( [ 'https://api.box.com/2.0/retention_policy_assignments/', - retention_policy_assignment_id, + to_string(retention_policy_assignment_id), '/files_under_retention', ] ), @@ -374,7 +374,7 @@ def get_retention_policy_assignment_file_version_under_retention( ''.join( [ 'https://api.box.com/2.0/retention_policy_assignments/', - retention_policy_assignment_id, + to_string(retention_policy_assignment_id), '/file_versions_under_retention', ] ), diff --git a/box_sdk_gen/managers/search.py b/box_sdk_gen/managers/search.py index 6ef9bbb..f95229b 100644 --- a/box_sdk_gen/managers/search.py +++ b/box_sdk_gen/managers/search.py @@ -12,6 +12,8 @@ from box_sdk_gen.serialization import deserialize +from typing import Union + from box_sdk_gen.base_object import BaseObject from box_sdk_gen.schemas import MetadataQueryResults @@ -84,6 +86,14 @@ class GetSearchScopeArg(str, Enum): ENTERPRISE_CONTENT = 'enterprise_content' +class GetSearchContentTypesArg(str, Enum): + NAME = 'name' + DESCRIPTION = 'description' + FILE_CONTENT = 'file_content' + COMMENTS = 'comments' + TAG = 'tag' + + class GetSearchTypeArg(str, Enum): FILE = 'file' FOLDER = 'folder' @@ -256,27 +266,27 @@ def get_search( self, query: Optional[str] = None, scope: Optional[GetSearchScopeArg] = None, - file_extensions: Optional[str] = None, - created_at_range: Optional[str] = None, - updated_at_range: Optional[str] = None, - size_range: Optional[str] = None, - owner_user_ids: Optional[str] = None, - recent_updater_user_ids: Optional[str] = None, - ancestor_folder_ids: Optional[str] = None, - content_types: Optional[str] = None, + file_extensions: Optional[List[str]] = None, + created_at_range: Optional[List[str]] = None, + updated_at_range: Optional[List[str]] = None, + size_range: Optional[List[int]] = None, + owner_user_ids: Optional[List[str]] = None, + recent_updater_user_ids: Optional[List[str]] = None, + ancestor_folder_ids: Optional[List[str]] = None, + content_types: Optional[List[GetSearchContentTypesArg]] = None, type: Optional[GetSearchTypeArg] = None, trash_content: Optional[GetSearchTrashContentArg] = None, - mdfilters: Optional[str] = None, + mdfilters: Optional[List[MetadataFilter]] = None, sort: Optional[GetSearchSortArg] = None, direction: Optional[GetSearchDirectionArg] = None, limit: Optional[int] = None, include_recent_shared_links: Optional[bool] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, offset: Optional[int] = None, - deleted_user_ids: Optional[str] = None, - deleted_at_range: Optional[str] = None, + deleted_user_ids: Optional[List[str]] = None, + deleted_at_range: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, - ) -> None: + ) -> Union[SearchResults, SearchResultsWithSharedLinks]: """ Searches for files, folders, web links, and shared files across the @@ -326,7 +336,7 @@ def get_search( :param file_extensions: Limits the search results to any files that match any of the provided file extensions. This list is a comma-separated list of file extensions without the dots. - :type file_extensions: Optional[str], optional + :type file_extensions: Optional[List[str]], optional :param created_at_range: Limits the search results to any items created within a given date range. Date ranges are defined as comma separated RFC3339 @@ -335,7 +345,7 @@ def get_search( anything created before the end date will be returned. If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the current date will be used as the end date instead. - :type created_at_range: Optional[str], optional + :type created_at_range: Optional[List[str]], optional :param updated_at_range: Limits the search results to any items updated within a given date range. Date ranges are defined as comma separated RFC3339 @@ -344,13 +354,13 @@ def get_search( anything updated before the end date will be returned. If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the current date will be used as the end date instead. - :type updated_at_range: Optional[str], optional + :type updated_at_range: Optional[List[str]], optional :param size_range: Limits the search results to any items with a size within a given file size range. This applied to files and folders. Size ranges are defined as comma separated list of a lower and upper byte size limit (inclusive). The upper and lower bound can be omitted to create open ranges. - :type size_range: Optional[str], optional + :type size_range: Optional[List[int]], optional :param owner_user_ids: Limits the search results to any items that are owned by the given list of owners, defined as a list of comma separated user IDs. @@ -361,7 +371,7 @@ def get_search( To search across an entire enterprise, we recommend using the `enterprise_content` scope parameter which can be requested with our support team. - :type owner_user_ids: Optional[str], optional + :type owner_user_ids: Optional[List[str]], optional :param recent_updater_user_ids: Limits the search results to any items that have been updated by the given list of users, defined as a list of comma separated user IDs. @@ -370,7 +380,7 @@ def get_search( results. If the user does not have access to any files owned by any of the users an empty result set will be returned. This feature only searches back to the last 10 versions of an item. - :type recent_updater_user_ids: Optional[str], optional + :type recent_updater_user_ids: Optional[List[str]], optional :param ancestor_folder_ids: Limits the search results to items within the given list of folders, defined as a comma separated lists of folder IDs. @@ -383,7 +393,7 @@ def get_search( To search across an entire enterprise, we recommend using the `enterprise_content` scope parameter which can be requested with our support team. - :type ancestor_folder_ids: Optional[str], optional + :type ancestor_folder_ids: Optional[List[str]], optional :param content_types: Limits the search results to any items that match the search query for a specific part of the file, for example the file description. Content types are defined as a comma separated lists @@ -396,7 +406,7 @@ def get_search( folder. * `tags` - Any tags that are applied to an item, as defined by its `tags` field. - :type content_types: Optional[str], optional + :type content_types: Optional[List[GetSearchContentTypesArg]], optional :param type: Limits the search results to any items of this type. This parameter only takes one value. By default the API returns items that match any of these types. @@ -419,7 +429,7 @@ def get_search( the search results by. This list can currently only contain one entry, though this might be expanded in the future. This parameter is required unless the `query` parameter is provided. - :type mdfilters: Optional[str], optional + :type mdfilters: Optional[List[MetadataFilter]], optional :param sort: Defines the order in which search results are returned. This API defaults to returning items by relevance unless this parameter is explicitly specified. @@ -453,7 +463,7 @@ def get_search( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param offset: The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected @@ -469,7 +479,7 @@ def get_search( If the user does not have access to any files owned by any of the users, an empty result set is returned. Data available from 2023-02-01 onwards. - :type deleted_user_ids: Optional[str], optional + :type deleted_user_ids: Optional[List[str]], optional :param deleted_at_range: Limits the search results to any items deleted within a given date range. Date ranges are defined as comma separated RFC3339 timestamps. @@ -481,7 +491,7 @@ def get_search( If searching in trash is not performed, then an empty result is returned. Data available from 2023-02-01 onwards. - :type deleted_at_range: Optional[str], optional + :type deleted_at_range: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -524,4 +534,6 @@ def get_search( network_session=self.network_session, ), ) - return None + return deserialize( + response.text, Union[SearchResults, SearchResultsWithSharedLinks] + ) diff --git a/box_sdk_gen/managers/shared_links_files.py b/box_sdk_gen/managers/shared_links_files.py index 7b175f8..06d3ee6 100644 --- a/box_sdk_gen/managers/shared_links_files.py +++ b/box_sdk_gen/managers/shared_links_files.py @@ -4,6 +4,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -224,7 +226,7 @@ def __init__( def get_shared_items( self, boxapi: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_none_match: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FileFull: @@ -261,7 +263,7 @@ def get_shared_items( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_none_match: Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail @@ -321,7 +323,13 @@ def get_file_get_shared_link( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '#get_shared_link']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '#get_shared_link', + ] + ), FetchOptions( method='GET', params=query_params_map, @@ -366,7 +374,13 @@ def update_file_add_shared_link( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '#add_shared_link']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '#add_shared_link', + ] + ), FetchOptions( method='PUT', params=query_params_map, @@ -411,7 +425,13 @@ def update_file_update_shared_link( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '#update_shared_link']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '#update_shared_link', + ] + ), FetchOptions( method='PUT', params=query_params_map, @@ -457,7 +477,13 @@ def update_file_remove_shared_link( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '#remove_shared_link']), + ''.join( + [ + 'https://api.box.com/2.0/files/', + to_string(file_id), + '#remove_shared_link', + ] + ), FetchOptions( method='PUT', params=query_params_map, diff --git a/box_sdk_gen/managers/shared_links_folders.py b/box_sdk_gen/managers/shared_links_folders.py index 80b78f9..7fa474c 100644 --- a/box_sdk_gen/managers/shared_links_folders.py +++ b/box_sdk_gen/managers/shared_links_folders.py @@ -4,6 +4,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -218,7 +220,7 @@ def __init__( def get_shared_item_folders( self, boxapi: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_none_match: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FolderFull: @@ -249,7 +251,7 @@ def get_shared_item_folders( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_none_match: Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail @@ -312,7 +314,11 @@ def get_folder_get_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/folders/', folder_id, '#get_shared_link'] + [ + 'https://api.box.com/2.0/folders/', + to_string(folder_id), + '#get_shared_link', + ] ), FetchOptions( method='GET', @@ -361,7 +367,11 @@ def update_folder_add_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/folders/', folder_id, '#add_shared_link'] + [ + 'https://api.box.com/2.0/folders/', + to_string(folder_id), + '#add_shared_link', + ] ), FetchOptions( method='PUT', @@ -410,7 +420,11 @@ def update_folder_update_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/folders/', folder_id, '#update_shared_link'] + [ + 'https://api.box.com/2.0/folders/', + to_string(folder_id), + '#update_shared_link', + ] ), FetchOptions( method='PUT', @@ -460,7 +474,11 @@ def update_folder_remove_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/folders/', folder_id, '#remove_shared_link'] + [ + 'https://api.box.com/2.0/folders/', + to_string(folder_id), + '#remove_shared_link', + ] ), FetchOptions( method='PUT', diff --git a/box_sdk_gen/managers/shared_links_web_links.py b/box_sdk_gen/managers/shared_links_web_links.py index 31acee7..bbfa37c 100644 --- a/box_sdk_gen/managers/shared_links_web_links.py +++ b/box_sdk_gen/managers/shared_links_web_links.py @@ -4,6 +4,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -216,7 +218,7 @@ def __init__( def get_shared_item_web_links( self, boxapi: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_none_match: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> WebLink: @@ -247,7 +249,7 @@ def get_shared_item_web_links( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_none_match: Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail @@ -303,7 +305,11 @@ def get_web_link_get_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/web_links/', web_link_id, '#get_shared_link'] + [ + 'https://api.box.com/2.0/web_links/', + to_string(web_link_id), + '#get_shared_link', + ] ), FetchOptions( method='GET', @@ -345,7 +351,11 @@ def update_web_link_add_shared_link( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/web_links/', web_link_id, '#add_shared_link'] + [ + 'https://api.box.com/2.0/web_links/', + to_string(web_link_id), + '#add_shared_link', + ] ), FetchOptions( method='PUT', @@ -389,7 +399,7 @@ def update_web_link_update_shared_link( ''.join( [ 'https://api.box.com/2.0/web_links/', - web_link_id, + to_string(web_link_id), '#update_shared_link', ] ), @@ -436,7 +446,7 @@ def update_web_link_remove_shared_link( ''.join( [ 'https://api.box.com/2.0/web_links/', - web_link_id, + to_string(web_link_id), '#remove_shared_link', ] ), diff --git a/box_sdk_gen/managers/shield_information_barrier_reports.py b/box_sdk_gen/managers/shield_information_barrier_reports.py index 4510ede..29aa850 100644 --- a/box_sdk_gen/managers/shield_information_barrier_reports.py +++ b/box_sdk_gen/managers/shield_information_barrier_reports.py @@ -135,7 +135,7 @@ def get_shield_information_barrier_report_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_reports/', - shield_information_barrier_report_id, + to_string(shield_information_barrier_report_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/shield_information_barrier_segment_members.py b/box_sdk_gen/managers/shield_information_barrier_segment_members.py index 1e6b22f..0061afc 100644 --- a/box_sdk_gen/managers/shield_information_barrier_segment_members.py +++ b/box_sdk_gen/managers/shield_information_barrier_segment_members.py @@ -104,7 +104,7 @@ def get_shield_information_barrier_segment_member_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segment_members/', - shield_information_barrier_segment_member_id, + to_string(shield_information_barrier_segment_member_id), ] ), FetchOptions( @@ -140,7 +140,7 @@ def delete_shield_information_barrier_segment_member_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segment_members/', - shield_information_barrier_segment_member_id, + to_string(shield_information_barrier_segment_member_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/shield_information_barrier_segment_restrictions.py b/box_sdk_gen/managers/shield_information_barrier_segment_restrictions.py index 87a1dd0..9628221 100644 --- a/box_sdk_gen/managers/shield_information_barrier_segment_restrictions.py +++ b/box_sdk_gen/managers/shield_information_barrier_segment_restrictions.py @@ -130,7 +130,7 @@ def get_shield_information_barrier_segment_restriction_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segment_restrictions/', - shield_information_barrier_segment_restriction_id, + to_string(shield_information_barrier_segment_restriction_id), ] ), FetchOptions( @@ -166,7 +166,7 @@ def delete_shield_information_barrier_segment_restriction_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segment_restrictions/', - shield_information_barrier_segment_restriction_id, + to_string(shield_information_barrier_segment_restriction_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/shield_information_barrier_segments.py b/box_sdk_gen/managers/shield_information_barrier_segments.py index fa70626..83d609b 100644 --- a/box_sdk_gen/managers/shield_information_barrier_segments.py +++ b/box_sdk_gen/managers/shield_information_barrier_segments.py @@ -60,7 +60,7 @@ def get_shield_information_barrier_segment_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segments/', - shield_information_barrier_segment_id, + to_string(shield_information_barrier_segment_id), ] ), FetchOptions( @@ -101,7 +101,7 @@ def update_shield_information_barrier_segment_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segments/', - shield_information_barrier_segment_id, + to_string(shield_information_barrier_segment_id), ] ), FetchOptions( @@ -139,7 +139,7 @@ def delete_shield_information_barrier_segment_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barrier_segments/', - shield_information_barrier_segment_id, + to_string(shield_information_barrier_segment_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/shield_information_barriers.py b/box_sdk_gen/managers/shield_information_barriers.py index 4527877..50b77db 100644 --- a/box_sdk_gen/managers/shield_information_barriers.py +++ b/box_sdk_gen/managers/shield_information_barriers.py @@ -81,7 +81,7 @@ def get_shield_information_barrier_by_id( ''.join( [ 'https://api.box.com/2.0/shield_information_barriers/', - shield_information_barrier_id, + to_string(shield_information_barrier_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/sign_requests.py b/box_sdk_gen/managers/sign_requests.py index fccb58b..ae616b9 100644 --- a/box_sdk_gen/managers/sign_requests.py +++ b/box_sdk_gen/managers/sign_requests.py @@ -70,7 +70,11 @@ def cancel_sign_request( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/sign_requests/', sign_request_id, '/cancel'] + [ + 'https://api.box.com/2.0/sign_requests/', + to_string(sign_request_id), + '/cancel', + ] ), FetchOptions( method='POST', @@ -100,7 +104,11 @@ def resend_sign_request( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/sign_requests/', sign_request_id, '/resend'] + [ + 'https://api.box.com/2.0/sign_requests/', + to_string(sign_request_id), + '/resend', + ] ), FetchOptions( method='POST', @@ -129,7 +137,9 @@ def get_sign_request_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/sign_requests/', sign_request_id]), + ''.join( + ['https://api.box.com/2.0/sign_requests/', to_string(sign_request_id)] + ), FetchOptions( method='GET', headers=headers_map, diff --git a/box_sdk_gen/managers/sign_templates.py b/box_sdk_gen/managers/sign_templates.py index 1ee4d81..816c212 100644 --- a/box_sdk_gen/managers/sign_templates.py +++ b/box_sdk_gen/managers/sign_templates.py @@ -87,7 +87,9 @@ def get_sign_template_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/sign_templates/', template_id]), + ''.join( + ['https://api.box.com/2.0/sign_templates/', to_string(template_id)] + ), FetchOptions( method='GET', headers=headers_map, diff --git a/box_sdk_gen/managers/skills.py b/box_sdk_gen/managers/skills.py index a173310..a22b99b 100644 --- a/box_sdk_gen/managers/skills.py +++ b/box_sdk_gen/managers/skills.py @@ -200,7 +200,7 @@ def get_file_metadata_global_box_skills_cards( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/global/boxSkillsCards', ] ), @@ -250,7 +250,7 @@ def create_file_metadata_global_box_skills_card( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/global/boxSkillsCards', ] ), @@ -294,7 +294,7 @@ def update_file_metadata_global_box_skills_card( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/global/boxSkillsCards', ] ), @@ -333,7 +333,7 @@ def delete_file_metadata_global_box_skills_card( ''.join( [ 'https://api.box.com/2.0/files/', - file_id, + to_string(file_id), '/metadata/global/boxSkillsCards', ] ), @@ -393,7 +393,9 @@ def update_skill_invocation_by_id( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/skill_invocations/', skill_id]), + ''.join( + ['https://api.box.com/2.0/skill_invocations/', to_string(skill_id)] + ), FetchOptions( method='PUT', headers=headers_map, diff --git a/box_sdk_gen/managers/storage_policies.py b/box_sdk_gen/managers/storage_policies.py index 906ae89..25afca7 100644 --- a/box_sdk_gen/managers/storage_policies.py +++ b/box_sdk_gen/managers/storage_policies.py @@ -1,5 +1,7 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -38,7 +40,7 @@ def __init__( def get_storage_policies( self, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, marker: Optional[str] = None, limit: Optional[int] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -59,7 +61,7 @@ def get_storage_policies( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param marker: Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. @@ -109,7 +111,12 @@ def get_storage_policy_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/storage_policies/', storage_policy_id]), + ''.join( + [ + 'https://api.box.com/2.0/storage_policies/', + to_string(storage_policy_id), + ] + ), FetchOptions( method='GET', headers=headers_map, diff --git a/box_sdk_gen/managers/storage_policy_assignments.py b/box_sdk_gen/managers/storage_policy_assignments.py index cf3c4bc..fb79b96 100644 --- a/box_sdk_gen/managers/storage_policy_assignments.py +++ b/box_sdk_gen/managers/storage_policy_assignments.py @@ -228,7 +228,7 @@ def get_storage_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/storage_policy_assignments/', - storage_policy_assignment_id, + to_string(storage_policy_assignment_id), ] ), FetchOptions( @@ -266,7 +266,7 @@ def update_storage_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/storage_policy_assignments/', - storage_policy_assignment_id, + to_string(storage_policy_assignment_id), ] ), FetchOptions( @@ -322,7 +322,7 @@ def delete_storage_policy_assignment_by_id( ''.join( [ 'https://api.box.com/2.0/storage_policy_assignments/', - storage_policy_assignment_id, + to_string(storage_policy_assignment_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/task_assignments.py b/box_sdk_gen/managers/task_assignments.py index 65671c9..c801586 100644 --- a/box_sdk_gen/managers/task_assignments.py +++ b/box_sdk_gen/managers/task_assignments.py @@ -100,7 +100,9 @@ def get_task_assignments( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/tasks/', task_id, '/assignments']), + ''.join( + ['https://api.box.com/2.0/tasks/', to_string(task_id), '/assignments'] + ), FetchOptions( method='GET', headers=headers_map, @@ -167,7 +169,12 @@ def get_task_assignment_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/task_assignments/', task_assignment_id]), + ''.join( + [ + 'https://api.box.com/2.0/task_assignments/', + to_string(task_assignment_id), + ] + ), FetchOptions( method='GET', headers=headers_map, @@ -209,7 +216,12 @@ def update_task_assignment_by_id( request_body = BaseObject(message=message, resolution_state=resolution_state) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/task_assignments/', task_assignment_id]), + ''.join( + [ + 'https://api.box.com/2.0/task_assignments/', + to_string(task_assignment_id), + ] + ), FetchOptions( method='PUT', headers=headers_map, @@ -239,7 +251,12 @@ def delete_task_assignment_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/task_assignments/', task_assignment_id]), + ''.join( + [ + 'https://api.box.com/2.0/task_assignments/', + to_string(task_assignment_id), + ] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/tasks.py b/box_sdk_gen/managers/tasks.py index ef32762..da618a8 100644 --- a/box_sdk_gen/managers/tasks.py +++ b/box_sdk_gen/managers/tasks.py @@ -109,7 +109,7 @@ def get_file_tasks( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/tasks']), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id), '/tasks']), FetchOptions( method='GET', headers=headers_map, @@ -195,7 +195,7 @@ def get_task_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/tasks/', task_id]), + ''.join(['https://api.box.com/2.0/tasks/', to_string(task_id)]), FetchOptions( method='GET', headers=headers_map, @@ -252,7 +252,7 @@ def update_task_by_id( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/tasks/', task_id]), + ''.join(['https://api.box.com/2.0/tasks/', to_string(task_id)]), FetchOptions( method='PUT', headers=headers_map, @@ -280,7 +280,7 @@ def delete_task_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/tasks/', task_id]), + ''.join(['https://api.box.com/2.0/tasks/', to_string(task_id)]), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/terms_of_service_user_statuses.py b/box_sdk_gen/managers/terms_of_service_user_statuses.py index 3c374cb..5a7d507 100644 --- a/box_sdk_gen/managers/terms_of_service_user_statuses.py +++ b/box_sdk_gen/managers/terms_of_service_user_statuses.py @@ -182,7 +182,7 @@ def update_term_of_service_user_status_by_id( ''.join( [ 'https://api.box.com/2.0/terms_of_service_user_statuses/', - terms_of_service_user_status_id, + to_string(terms_of_service_user_status_id), ] ), FetchOptions( diff --git a/box_sdk_gen/managers/terms_of_services.py b/box_sdk_gen/managers/terms_of_services.py index bf68395..53f1aa1 100644 --- a/box_sdk_gen/managers/terms_of_services.py +++ b/box_sdk_gen/managers/terms_of_services.py @@ -157,7 +157,10 @@ def get_term_of_service_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/terms_of_services/', terms_of_service_id] + [ + 'https://api.box.com/2.0/terms_of_services/', + to_string(terms_of_service_id), + ] ), FetchOptions( method='GET', @@ -195,7 +198,10 @@ def update_term_of_service_by_id( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/terms_of_services/', terms_of_service_id] + [ + 'https://api.box.com/2.0/terms_of_services/', + to_string(terms_of_service_id), + ] ), FetchOptions( method='PUT', diff --git a/box_sdk_gen/managers/transfer.py b/box_sdk_gen/managers/transfer.py index e70c42b..e02718f 100644 --- a/box_sdk_gen/managers/transfer.py +++ b/box_sdk_gen/managers/transfer.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -55,7 +57,7 @@ def transfer_owned_folder( self, user_id: str, owned_by: TransferOwnedFolderOwnedByArg, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, notify: Optional[bool] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> FolderFull: @@ -140,7 +142,7 @@ def transfer_owned_folder( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param notify: Determines if users should receive email notification for the action performed. :type notify: Optional[bool], optional @@ -155,7 +157,9 @@ def transfer_owned_folder( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id, '/folders/0']), + ''.join( + ['https://api.box.com/2.0/users/', to_string(user_id), '/folders/0'] + ), FetchOptions( method='PUT', params=query_params_map, diff --git a/box_sdk_gen/managers/trashed_files.py b/box_sdk_gen/managers/trashed_files.py index 5972f3c..dbb839b 100644 --- a/box_sdk_gen/managers/trashed_files.py +++ b/box_sdk_gen/managers/trashed_files.py @@ -2,6 +2,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -57,7 +59,7 @@ def restore_file_from_trash( file_id: str, name: Optional[str] = None, parent: Optional[RestoreFileFromTrashParentArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashFileRestored: """ @@ -86,7 +88,7 @@ def restore_file_from_trash( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -96,7 +98,7 @@ def restore_file_from_trash( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id]), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id)]), FetchOptions( method='POST', params=query_params_map, @@ -113,7 +115,7 @@ def restore_file_from_trash( def get_file_trash( self, file_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashFile: """ @@ -158,7 +160,7 @@ def get_file_trash( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -167,7 +169,7 @@ def get_file_trash( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/trash']), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id), '/trash']), FetchOptions( method='GET', params=query_params_map, @@ -202,7 +204,7 @@ def delete_file_trash( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/files/', file_id, '/trash']), + ''.join(['https://api.box.com/2.0/files/', to_string(file_id), '/trash']), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/trashed_folders.py b/box_sdk_gen/managers/trashed_folders.py index ed694cd..7598864 100644 --- a/box_sdk_gen/managers/trashed_folders.py +++ b/box_sdk_gen/managers/trashed_folders.py @@ -2,6 +2,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -57,7 +59,7 @@ def restore_folder_from_trash( folder_id: str, name: Optional[str] = None, parent: Optional[RestoreFolderFromTrashParentArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashFolderRestored: """ @@ -106,7 +108,7 @@ def restore_folder_from_trash( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -116,7 +118,7 @@ def restore_folder_from_trash( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id]), + ''.join(['https://api.box.com/2.0/folders/', to_string(folder_id)]), FetchOptions( method='POST', params=query_params_map, @@ -133,7 +135,7 @@ def restore_folder_from_trash( def get_folder_trash( self, folder_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashFolder: """ @@ -180,7 +182,7 @@ def get_folder_trash( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -189,7 +191,9 @@ def get_folder_trash( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/trash']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/trash'] + ), FetchOptions( method='GET', params=query_params_map, @@ -226,7 +230,9 @@ def delete_folder_trash( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/folders/', folder_id, '/trash']), + ''.join( + ['https://api.box.com/2.0/folders/', to_string(folder_id), '/trash'] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/trashed_items.py b/box_sdk_gen/managers/trashed_items.py index 888d182..9395183 100644 --- a/box_sdk_gen/managers/trashed_items.py +++ b/box_sdk_gen/managers/trashed_items.py @@ -2,6 +2,8 @@ from typing import Optional +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -49,7 +51,7 @@ def __init__( def get_folder_trash_items( self, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, limit: Optional[int] = None, offset: Optional[int] = None, usemarker: Optional[bool] = None, @@ -86,7 +88,7 @@ def get_folder_trash_items( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param limit: The maximum number of items to return per page. :type limit: Optional[int], optional :param offset: The offset of the item at which to begin the response. diff --git a/box_sdk_gen/managers/trashed_web_links.py b/box_sdk_gen/managers/trashed_web_links.py index 9c4605b..eb3197f 100644 --- a/box_sdk_gen/managers/trashed_web_links.py +++ b/box_sdk_gen/managers/trashed_web_links.py @@ -2,6 +2,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -57,7 +59,7 @@ def create_web_link_by_id( web_link_id: str, name: Optional[str] = None, parent: Optional[CreateWebLinkByIdParentArg] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashWebLinkRestored: """ @@ -81,7 +83,7 @@ def create_web_link_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -91,7 +93,7 @@ def create_web_link_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id]), + ''.join(['https://api.box.com/2.0/web_links/', to_string(web_link_id)]), FetchOptions( method='POST', params=query_params_map, @@ -108,7 +110,7 @@ def create_web_link_by_id( def get_web_link_trash( self, web_link_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> TrashWebLink: """ @@ -124,7 +126,7 @@ def get_web_link_trash( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -133,7 +135,9 @@ def get_web_link_trash( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id, '/trash']), + ''.join( + ['https://api.box.com/2.0/web_links/', to_string(web_link_id), '/trash'] + ), FetchOptions( method='GET', params=query_params_map, @@ -163,7 +167,9 @@ def delete_web_link_trash( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id, '/trash']), + ''.join( + ['https://api.box.com/2.0/web_links/', to_string(web_link_id), '/trash'] + ), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/uploads.py b/box_sdk_gen/managers/uploads.py index 85b8d1d..1e79fce 100644 --- a/box_sdk_gen/managers/uploads.py +++ b/box_sdk_gen/managers/uploads.py @@ -2,6 +2,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import serialize @@ -117,7 +119,7 @@ def upload_file_version( file: ByteStream, file_file_name: Optional[str] = None, file_content_type: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, if_match: Optional[str] = None, content_md_5: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, @@ -176,7 +178,7 @@ def upload_file_version( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param if_match: Ensures this item hasn't recently changed before making changes. Pass in the item's last observed `etag` value @@ -207,7 +209,13 @@ def upload_file_version( } ) response: FetchResponse = fetch( - ''.join(['https://upload.box.com/api/2.0/files/', file_id, '/content']), + ''.join( + [ + 'https://upload.box.com/api/2.0/files/', + to_string(file_id), + '/content', + ] + ), FetchOptions( method='POST', params=query_params_map, @@ -237,7 +245,7 @@ def upload_file( file: ByteStream, file_file_name: Optional[str] = None, file_content_type: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, content_md_5: Optional[str] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Files: @@ -287,7 +295,7 @@ def upload_file( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param content_md_5: An optional header containing the SHA1 hash of the file to ensure that the file was not corrupted in transit. :type content_md_5: Optional[str], optional diff --git a/box_sdk_gen/managers/user_collaborations.py b/box_sdk_gen/managers/user_collaborations.py index 499b78f..16ee28c 100644 --- a/box_sdk_gen/managers/user_collaborations.py +++ b/box_sdk_gen/managers/user_collaborations.py @@ -4,6 +4,8 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize @@ -126,7 +128,7 @@ def __init__( def get_collaboration_by_id( self, collaboration_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Collaboration: """ @@ -142,7 +144,7 @@ def get_collaboration_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -151,7 +153,9 @@ def get_collaboration_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/collaborations/', collaboration_id]), + ''.join( + ['https://api.box.com/2.0/collaborations/', to_string(collaboration_id)] + ), FetchOptions( method='GET', params=query_params_map, @@ -222,7 +226,9 @@ def update_collaboration_by_id( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/collaborations/', collaboration_id]), + ''.join( + ['https://api.box.com/2.0/collaborations/', to_string(collaboration_id)] + ), FetchOptions( method='PUT', headers=headers_map, @@ -252,7 +258,9 @@ def delete_collaboration_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/collaborations/', collaboration_id]), + ''.join( + ['https://api.box.com/2.0/collaborations/', to_string(collaboration_id)] + ), FetchOptions( method='DELETE', headers=headers_map, @@ -270,7 +278,7 @@ def create_collaboration( role: CreateCollaborationRoleArg, can_view_path: Optional[bool] = None, expires_at: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, notify: Optional[bool] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> Collaboration: @@ -340,7 +348,7 @@ def create_collaboration( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param notify: Determines if users should receive email notification for the action performed. :type notify: Optional[bool], optional diff --git a/box_sdk_gen/managers/users.py b/box_sdk_gen/managers/users.py index 2cdea24..6c14ee5 100644 --- a/box_sdk_gen/managers/users.py +++ b/box_sdk_gen/managers/users.py @@ -4,12 +4,12 @@ from box_sdk_gen.base_object import BaseObject +from typing import List + from typing import Dict from box_sdk_gen.serialization import deserialize -from typing import List - from box_sdk_gen.serialization import serialize from box_sdk_gen.base_object import BaseObject @@ -95,7 +95,7 @@ def get_users( filter_term: Optional[str] = None, user_type: Optional[GetUsersUserTypeArg] = None, external_app_user_id: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, offset: Optional[int] = None, limit: Optional[int] = None, usemarker: Optional[bool] = None, @@ -149,7 +149,7 @@ def get_users( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param offset: The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected @@ -219,7 +219,7 @@ def create_user( is_exempt_from_login_verification: Optional[bool] = None, status: Optional[CreateUserStatusArg] = None, external_app_user_id: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> User: """ @@ -285,7 +285,7 @@ def create_user( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -330,7 +330,7 @@ def create_user( def get_user_me( self, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> UserFull: """ @@ -361,7 +361,7 @@ def get_user_me( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -385,7 +385,7 @@ def get_user_me( def get_user_by_id( self, user_id: str, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> UserFull: """ @@ -425,7 +425,7 @@ def get_user_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -434,7 +434,7 @@ def get_user_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id]), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id)]), FetchOptions( method='GET', params=query_params_map, @@ -470,7 +470,7 @@ def update_user_by_id( space_amount: Optional[int] = None, notification_email: Optional[UpdateUserByIdNotificationEmailArg] = None, external_app_user_id: Optional[str] = None, - fields: Optional[str] = None, + fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None, ) -> UserFull: """ @@ -553,7 +553,7 @@ def update_user_by_id( the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - :type fields: Optional[str], optional + :type fields: Optional[List[str]], optional :param extra_headers: Extra headers that will be included in the HTTP request. :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ @@ -585,7 +585,7 @@ def update_user_by_id( query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id]), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id)]), FetchOptions( method='PUT', params=query_params_map, @@ -636,7 +636,7 @@ def delete_user_by_id( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/users/', user_id]), + ''.join(['https://api.box.com/2.0/users/', to_string(user_id)]), FetchOptions( method='DELETE', params=query_params_map, diff --git a/box_sdk_gen/managers/web_links.py b/box_sdk_gen/managers/web_links.py index 2ead164..7144ce4 100644 --- a/box_sdk_gen/managers/web_links.py +++ b/box_sdk_gen/managers/web_links.py @@ -185,7 +185,7 @@ def get_web_link_by_id( {'boxapi': to_string(boxapi), **extra_headers} ) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id]), + ''.join(['https://api.box.com/2.0/web_links/', to_string(web_link_id)]), FetchOptions( method='GET', headers=headers_map, @@ -234,7 +234,7 @@ def update_web_link_by_id( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id]), + ''.join(['https://api.box.com/2.0/web_links/', to_string(web_link_id)]), FetchOptions( method='PUT', headers=headers_map, @@ -262,7 +262,7 @@ def delete_web_link_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/web_links/', web_link_id]), + ''.join(['https://api.box.com/2.0/web_links/', to_string(web_link_id)]), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/webhooks.py b/box_sdk_gen/managers/webhooks.py index 58e4044..02dd09a 100644 --- a/box_sdk_gen/managers/webhooks.py +++ b/box_sdk_gen/managers/webhooks.py @@ -278,7 +278,7 @@ def get_webhook_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/webhooks/', webhook_id]), + ''.join(['https://api.box.com/2.0/webhooks/', to_string(webhook_id)]), FetchOptions( method='GET', headers=headers_map, @@ -317,7 +317,7 @@ def update_webhook_by_id( request_body = BaseObject(target=target, address=address, triggers=triggers) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/webhooks/', webhook_id]), + ''.join(['https://api.box.com/2.0/webhooks/', to_string(webhook_id)]), FetchOptions( method='PUT', headers=headers_map, @@ -345,7 +345,7 @@ def delete_webhook_by_id( extra_headers = {} headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/webhooks/', webhook_id]), + ''.join(['https://api.box.com/2.0/webhooks/', to_string(webhook_id)]), FetchOptions( method='DELETE', headers=headers_map, diff --git a/box_sdk_gen/managers/workflows.py b/box_sdk_gen/managers/workflows.py index a6e9bab..a86cf11 100644 --- a/box_sdk_gen/managers/workflows.py +++ b/box_sdk_gen/managers/workflows.py @@ -238,7 +238,9 @@ def create_workflow_start( ) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( - ''.join(['https://api.box.com/2.0/workflows/', workflow_id, '/start']), + ''.join( + ['https://api.box.com/2.0/workflows/', to_string(workflow_id), '/start'] + ), FetchOptions( method='POST', headers=headers_map, diff --git a/box_sdk_gen/managers/zip_downloads.py b/box_sdk_gen/managers/zip_downloads.py index 0cbe325..2abc624 100644 --- a/box_sdk_gen/managers/zip_downloads.py +++ b/box_sdk_gen/managers/zip_downloads.py @@ -191,7 +191,7 @@ def get_zip_download_content( ''.join( [ 'https://dl.boxcloud.com/2.0/zip_downloads/', - zip_download_id, + to_string(zip_download_id), '/content', ] ), @@ -250,7 +250,11 @@ def get_zip_download_status( headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = fetch( ''.join( - ['https://api.box.com/2.0/zip_downloads/', zip_download_id, '/status'] + [ + 'https://api.box.com/2.0/zip_downloads/', + to_string(zip_download_id), + '/status', + ] ), FetchOptions( method='GET', diff --git a/box_sdk_gen/serialization.py b/box_sdk_gen/serialization.py index 87e3c2d..2884800 100644 --- a/box_sdk_gen/serialization.py +++ b/box_sdk_gen/serialization.py @@ -1,5 +1,5 @@ import json -from typing import Union, Type +from typing import get_origin, Union, Type from .base_object import BaseObject @@ -15,5 +15,10 @@ def serialize(obj: Union[BaseObject, dict, list]): return json.dumps(obj) -def deserialize(json_str: str, type: Type[BaseObject]): - return type.from_dict(json.loads(json_str)) +def deserialize(json_str: str, type: Union[Type[BaseObject], Union[Type[BaseObject]]]): + value = json.loads(json_str) + + if get_origin(type) == Union: + type = BaseObject._deserialize_union('', value, type) + + return type.from_dict(value) diff --git a/box_sdk_gen/utils.py b/box_sdk_gen/utils.py index 407ee07..1b4b439 100644 --- a/box_sdk_gen/utils.py +++ b/box_sdk_gen/utils.py @@ -4,7 +4,9 @@ from io import BytesIO, SEEK_SET, SEEK_END, BufferedIOBase import os import uuid -from typing import Dict, Optional, Iterable, Callable, TypeVar +from typing import Dict, Optional, Iterable, Callable, TypeVar, Any +from .serialization import serialize +from .base_object import BaseObject ByteStream = BufferedIOBase Buffer = bytes @@ -93,9 +95,17 @@ def prepare_params(map: Dict[str, Optional[str]]) -> Dict[str, str]: return {k: v for k, v in map.items() if v is not None} -def to_string(value: any) -> Optional[str]: +def to_string(value: Any) -> Optional[str]: if value is None: - return value + return None + if ( + isinstance(value, BaseObject) + or isinstance(value, list) + and isinstance(value[0], BaseObject) + ): + return ''.join(serialize(value).split()) + if isinstance(value, list): + return ','.join(map(to_string, value)) return str(value) diff --git a/docs/collections.md b/docs/collections.md index 2b4f1f1..2663faa 100644 --- a/docs/collections.md +++ b/docs/collections.md @@ -23,7 +23,7 @@ client.collections.get_collections() ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - offset `Optional[int]` - The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response. @@ -58,7 +58,7 @@ client.collections.get_collection_items(collection_id=favourite_collection.id) - collection_id `str` - The ID of the collection. Example: "926489" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - offset `Optional[int]` - The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response. diff --git a/docs/comments.md b/docs/comments.md index 1e47a84..fbfff74 100644 --- a/docs/comments.md +++ b/docs/comments.md @@ -25,7 +25,7 @@ client.comments.get_file_comments(file_id=file_id) - file_id `str` - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. @@ -61,7 +61,7 @@ client.comments.get_comment_by_id(comment_id=new_comment.id) - comment_id `str` - The ID of the comment. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -93,7 +93,7 @@ client.comments.update_comment_by_id(comment_id=new_reply_comment.id, message=ne - The ID of the comment. Example: "12345" - message `Optional[str]` - The text of the comment to update -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -156,7 +156,7 @@ client.comments.create_comment(message=message, item=CreateCommentItemArg(id=new - The text of the comment, including `@[user_id:name]` somewhere in the message to mention another user, which will send them an email notification, letting them know they have been mentioned. The `user_id` is the target user's ID, where the `name` can be any custom phrase. In the Box UI this name will link to the user's profile. If you are not mentioning another user, use `message` instead. - item `CreateCommentItemArg` - The item to attach the comment to. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/events.md b/docs/events.md index 16344c0..df17333 100644 --- a/docs/events.md +++ b/docs/events.md @@ -30,7 +30,7 @@ _Currently we don't have an example for calling `get_events` in integration test - The location in the event stream to start receiving events from. _ `now` will return an empty list events and the latest stream position for initialization. _ `0` or `null` will return all events. - limit `Optional[int]` - Limits the number of events returned Note: Sometimes, the events less than the limit requested can be returned even when there may be more events remaining. This is primarily done in the case where a number of events have already been retrieved and these retrieved events are returned rather than delaying for an unknown amount of time to see if there are any more results. -- event_type `Optional[str]` +- event_type `Optional[List[GetEventsEventTypeArg]]` - A comma-separated list of events to filter by. This can only be used when requesting the events with a `stream_type` of `admin_logs` or `adming_logs_streaming`. For any other `stream_type` this value will be ignored. - created_after `Optional[str]` - The lower bound date and time to return events for. This can only be used when requesting the events with a `stream_type` of `admin_logs`. For any other `stream_type` this value will be ignored. diff --git a/docs/file_versions.md b/docs/file_versions.md index e49d4b5..4834744 100644 --- a/docs/file_versions.md +++ b/docs/file_versions.md @@ -28,7 +28,7 @@ client.file_versions.get_file_versions(file_id=file.id) - file_id `str` - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. @@ -66,7 +66,7 @@ client.file_versions.get_file_version_by_id(file_id=file.id, file_version_id=fil - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" - file_version_id `str` - The ID of the file version Example: "1234" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -185,7 +185,7 @@ client.file_versions.promote_file_version(file_id=file.id, id=file_versions.entr - The file version ID - type `Optional[PromoteFileVersionTypeArg]` - The type to promote -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/groups.md b/docs/groups.md index 9777db1..03a32d8 100644 --- a/docs/groups.md +++ b/docs/groups.md @@ -26,7 +26,7 @@ client.groups.get_groups() - filter_term `Optional[str]` - Limits the results to only groups whose `name` starts with the search term. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. @@ -72,7 +72,7 @@ client.groups.create_group(name=get_uuid()) - Specifies who can invite the group to collaborate on folders. When set to `admins_only` the enterprise admin, co-admins, and the group's admin can invite the group. When set to `admins_and_members` all the admins listed above and group members can invite the group. When set to `all_managed_users` all managed users in the enterprise can invite the group. - member_viewability_level `Optional[CreateGroupMemberViewabilityLevelArg]` - Specifies who can see the members of the group. _ `admins_only` - the enterprise admin, co-admins, group's group admin _ `admins_and_members` - all admins and group members \* `all_managed_users` - all managed users in the enterprise -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -104,7 +104,7 @@ client.groups.get_group_by_id(group_id=group.id) - group_id `str` - The ID of the group. Example: "57645" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -148,7 +148,7 @@ client.groups.update_group_by_id(group_id=group.id, name=updated_group_name) - Specifies who can invite the group to collaborate on folders. When set to `admins_only` the enterprise admin, co-admins, and the group's admin can invite the group. When set to `admins_and_members` all the admins listed above and group members can invite the group. When set to `all_managed_users` all managed users in the enterprise can invite the group. - member_viewability_level `Optional[UpdateGroupByIdMemberViewabilityLevelArg]` - Specifies who can see the members of the group. _ `admins_only` - the enterprise admin, co-admins, group's group admin _ `admins_and_members` - all admins and group members \* `all_managed_users` - all managed users in the enterprise -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/invites.md b/docs/invites.md index 8c00b72..9f19a98 100644 --- a/docs/invites.md +++ b/docs/invites.md @@ -28,7 +28,7 @@ _Currently we don't have an example for calling `create_invite` in integration t - The enterprise to invite the user to - actionable_by `CreateInviteActionableByArg` - The user to invite -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -54,7 +54,7 @@ _Currently we don't have an example for calling `get_invite_by_id` in integratio - invite_id `str` - The ID of an invite. Example: "213723" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/legal_hold_policies.md b/docs/legal_hold_policies.md index bd716df..a1bcb01 100644 --- a/docs/legal_hold_policies.md +++ b/docs/legal_hold_policies.md @@ -22,7 +22,7 @@ _Currently we don't have an example for calling `get_legal_hold_policies` in int - policy_name `Optional[str]` - Limits results to policies for which the names start with this search term. This is a case-insensitive prefix. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - marker `Optional[str]` - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. diff --git a/docs/legal_hold_policy_assignments.md b/docs/legal_hold_policy_assignments.md index d7729b8..f224ec5 100644 --- a/docs/legal_hold_policy_assignments.md +++ b/docs/legal_hold_policy_assignments.md @@ -30,7 +30,7 @@ _Currently we don't have an example for calling `get_legal_hold_policy_assignmen - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. - limit `Optional[int]` - The maximum number of items to return per page. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -153,7 +153,7 @@ _Currently we don't have an example for calling `get_legal_hold_policy_assignmen - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. - limit `Optional[int]` - The maximum number of items to return per page. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -199,7 +199,7 @@ _Currently we don't have an example for calling `get_legal_hold_policy_assignmen - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. - limit `Optional[int]` - The maximum number of items to return per page. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/list_collaborations.md b/docs/list_collaborations.md index 8d7ed96..c9755c2 100644 --- a/docs/list_collaborations.md +++ b/docs/list_collaborations.md @@ -22,7 +22,7 @@ _Currently we don't have an example for calling `get_file_collaborations` in int - file_id `str` - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. @@ -59,7 +59,7 @@ _Currently we don't have an example for calling `get_folder_collaborations` in i - folder_id `str` - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -90,7 +90,7 @@ _Currently we don't have an example for calling `get_collaborations` in integrat - status `GetCollaborationsStatusArg` - The status of the collaborations to retrieve -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - offset `Optional[int]` - The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response. diff --git a/docs/memberships.md b/docs/memberships.md index 4e8400a..1b6afc4 100644 --- a/docs/memberships.md +++ b/docs/memberships.md @@ -103,7 +103,7 @@ client.memberships.create_group_membership(user=CreateGroupMembershipUserArg(id= - The role of the user in the group. - configurable_permissions `Optional[Dict[str, bool]]` - Custom configuration for the permissions an admin if a group will receive. This option has no effect on members with a role of `member`. Setting these permissions overwrites the default access levels of an admin. Specifying a value of "null" for this object will deactivate all configurable permissions. Specifying permissions will set them accordingly, omitted permissions will be enabled by default. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -135,7 +135,7 @@ client.memberships.get_group_membership_by_id(group_membership_id=group_membersh - group_membership_id `str` - The ID of the group membership. Example: "434534" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -171,7 +171,7 @@ client.memberships.update_group_membership_by_id(group_membership_id=group_membe - The role of the user in the group. - configurable_permissions `Optional[Dict[str, bool]]` - Custom configuration for the permissions an admin if a group will receive. This option has no effect on members with a role of `member`. Setting these permissions overwrites the default access levels of an admin. Specifying a value of "null" for this object will deactivate all configurable permissions. Specifying permissions will set them accordingly, omitted permissions will be enabled by default. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/recent_items.md b/docs/recent_items.md index 1116ce2..4f1c865 100644 --- a/docs/recent_items.md +++ b/docs/recent_items.md @@ -21,7 +21,7 @@ client.recent_items.get_recent_items() ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. diff --git a/docs/retention_policies.md b/docs/retention_policies.md index cfbb372..205945f 100644 --- a/docs/retention_policies.md +++ b/docs/retention_policies.md @@ -29,7 +29,7 @@ client.retention_policies.get_retention_policies() - Filters results by the type of retention policy. - created_by_user_id `Optional[str]` - Filters results by the ID of the user who created policy. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. @@ -107,7 +107,7 @@ client.retention_policies.get_retention_policy_by_id(retention_policy_id=retenti - retention_policy_id `str` - The ID of the retention policy. Example: "982312" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/retention_policy_assignments.md b/docs/retention_policy_assignments.md index ae25640..d092bd2 100644 --- a/docs/retention_policy_assignments.md +++ b/docs/retention_policy_assignments.md @@ -25,7 +25,7 @@ _Currently we don't have an example for calling `get_retention_policy_assignment - The ID of the retention policy. Example: "982312" - type `Optional[GetRetentionPolicyAssignmentsTypeArg]` - The type of the retention policy assignment to retrieve. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - marker `Optional[str]` - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. @@ -86,7 +86,7 @@ _Currently we don't have an example for calling `get_retention_policy_assignment - retention_policy_assignment_id `str` - The ID of the retention policy assignment. Example: "1233123" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/search.md b/docs/search.md index 11e6bb1..7330a6f 100644 --- a/docs/search.md +++ b/docs/search.md @@ -91,27 +91,27 @@ _Currently we don't have an example for calling `get_search` in integration test - The string to search for. This query is matched against item names, descriptions, text content of files, and various other fields of the different item types. This parameter supports a variety of operators to further refine the results returns. _ `""` - by wrapping a query in double quotes only exact matches are returned by the API. Exact searches do not return search matches based on specific character sequences. Instead, they return matches based on phrases, that is, word sequences. For example: A search for `"Blue-Box"` may return search results including the sequence `"blue.box"`, `"Blue Box"`, and `"Blue-Box"`; any item containing the words `Blue` and `Box` consecutively, in the order specified. _ `AND` - returns items that contain both the search terms. For example, a search for `marketing AND BoxWorks` returns items that have both `marketing` and `BoxWorks` within its text in any order. It does not return a result that only has `BoxWorks` in its text. _ `OR` - returns items that contain either of the search terms. For example, a search for `marketing OR BoxWorks` returns a result that has either `marketing` or `BoxWorks` within its text. Using this operator is not necessary as we implicitly interpret multi-word queries as `OR` unless another supported boolean term is used. _ `NOT` - returns items that do not contain the search term provided. For example, a search for `marketing AND NOT BoxWorks` returns a result that has only `marketing` within its text. Results containing `BoxWorks` are omitted. We do not support lower case (that is, `and`, `or`, and `not`) or mixed case (that is, `And`, `Or`, and `Not`) operators. This field is required unless the `mdfilters` parameter is defined. - scope `Optional[GetSearchScopeArg]` - Limits the search results to either the files that the user has access to, or to files available to the entire enterprise. The scope defaults to `user_content`, which limits the search results to content that is available to the currently authenticated user. The `enterprise_content` can be requested by an admin through our support channels. Once this scope has been enabled for a user, it will allow that use to query for content across the entire enterprise and not only the content that they have access to. -- file_extensions `Optional[str]` +- file_extensions `Optional[List[str]]` - Limits the search results to any files that match any of the provided file extensions. This list is a comma-separated list of file extensions without the dots. -- created_at_range `Optional[str]` +- created_at_range `Optional[List[str]]` - Limits the search results to any items created within a given date range. Date ranges are defined as comma separated RFC3339 timestamps. If the the start date is omitted (`,2014-05-17T13:35:01-07:00`) anything created before the end date will be returned. If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the current date will be used as the end date instead. -- updated_at_range `Optional[str]` +- updated_at_range `Optional[List[str]]` - Limits the search results to any items updated within a given date range. Date ranges are defined as comma separated RFC3339 timestamps. If the start date is omitted (`,2014-05-17T13:35:01-07:00`) anything updated before the end date will be returned. If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the current date will be used as the end date instead. -- size_range `Optional[str]` +- size_range `Optional[List[int]]` - Limits the search results to any items with a size within a given file size range. This applied to files and folders. Size ranges are defined as comma separated list of a lower and upper byte size limit (inclusive). The upper and lower bound can be omitted to create open ranges. -- owner_user_ids `Optional[str]` +- owner_user_ids `Optional[List[str]]` - Limits the search results to any items that are owned by the given list of owners, defined as a list of comma separated user IDs. The items still need to be owned or shared with the currently authenticated user for them to show up in the search results. If the user does not have access to any files owned by any of the users an empty result set will be returned. To search across an entire enterprise, we recommend using the `enterprise_content` scope parameter which can be requested with our support team. -- recent_updater_user_ids `Optional[str]` +- recent_updater_user_ids `Optional[List[str]]` - Limits the search results to any items that have been updated by the given list of users, defined as a list of comma separated user IDs. The items still need to be owned or shared with the currently authenticated user for them to show up in the search results. If the user does not have access to any files owned by any of the users an empty result set will be returned. This feature only searches back to the last 10 versions of an item. -- ancestor_folder_ids `Optional[str]` +- ancestor_folder_ids `Optional[List[str]]` - Limits the search results to items within the given list of folders, defined as a comma separated lists of folder IDs. Search results will also include items within any subfolders of those ancestor folders. The folders still need to be owned or shared with the currently authenticated user. If the folder is not accessible by this user, or it does not exist, a `HTTP 404` error code will be returned instead. To search across an entire enterprise, we recommend using the `enterprise_content` scope parameter which can be requested with our support team. -- content_types `Optional[str]` +- content_types `Optional[List[GetSearchContentTypesArg]]` - Limits the search results to any items that match the search query for a specific part of the file, for example the file description. Content types are defined as a comma separated lists of Box recognized content types. The allowed content types are as follows. _ `name` - The name of the item, as defined by its `name` field. _ `description` - The description of the item, as defined by its `description` field. _ `file_content` - The actual content of the file. _ `comments` - The content of any of the comments on a file or folder. \* `tags` - Any tags that are applied to an item, as defined by its `tags` field. - type `Optional[GetSearchTypeArg]` - Limits the search results to any items of this type. This parameter only takes one value. By default the API returns items that match any of these types. _ `file` - Limits the search results to files _ `folder` - Limits the search results to folders \* `web_link` - Limits the search results to web links, also known as bookmarks - trash_content `Optional[GetSearchTrashContentArg]` - Determines if the search should look in the trash for items. By default, this API only returns search results for items not currently in the trash (`non_trashed_only`). _ `trashed_only` - Only searches for items currently in the trash _ `non_trashed_only` - Only searches for items currently not in the trash \* `all_items` - Searches for both trashed and non-trashed items. -- mdfilters `Optional[str]` +- mdfilters `Optional[List[MetadataFilter]]` - Limits the search results to any items for which the metadata matches the provided filter. This parameter contains a list of 1 metadata template to filter the search results by. This list can currently only contain one entry, though this might be expanded in the future. This parameter is required unless the `query` parameter is provided. - sort `Optional[GetSearchSortArg]` - Defines the order in which search results are returned. This API defaults to returning items by relevance unless this parameter is explicitly specified. _ `relevance` (default) returns the results sorted by relevance to the query search term. The relevance is based on the occurrence of the search term in the items name, description, content, and additional properties. _ `modified_at` returns the results ordered in descending order by date at which the item was last modified. @@ -121,20 +121,20 @@ _Currently we don't have an example for calling `get_search` in integration test - Defines the maximum number of items to return as part of a page of results. - include_recent_shared_links `Optional[bool]` - Defines whether the search results should include any items that the user recently accessed through a shared link. When this parameter has been set to true, the format of the response of this API changes to return a list of [Search Results with Shared Links](r://search_results_with_shared_links) -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - offset `Optional[int]` - The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response. -- deleted_user_ids `Optional[str]` +- deleted_user_ids `Optional[List[str]]` - Limits the search results to items that were deleted by the given list of users, defined as a list of comma separated user IDs. The `trash_content` parameter needs to be set to `trashed_only`. If searching in trash is not performed, an empty result set is returned. The items need to be owned or shared with the currently authenticated user for them to show up in the search results. If the user does not have access to any files owned by any of the users, an empty result set is returned. Data available from 2023-02-01 onwards. -- deleted_at_range `Optional[str]` +- deleted_at_range `Optional[List[str]]` - Limits the search results to any items deleted within a given date range. Date ranges are defined as comma separated RFC3339 timestamps. If the the start date is omitted (`2014-05-17T13:35:01-07:00`), anything deleted before the end date will be returned. If the end date is omitted (`2014-05-15T13:35:01-07:00`), the current date will be used as the end date instead. The `trash_content` parameter needs to be set to `trashed_only`. If searching in trash is not performed, then an empty result is returned. Data available from 2023-02-01 onwards. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. ### Returns -This function returns a value of type `None`. +This function returns a value of type `Union[SearchResults, SearchResultsWithSharedLinks]`. Returns a collection of search results. If there are no matching search results, the `entries` array will be empty. diff --git a/docs/shared_links_files.md b/docs/shared_links_files.md index 467eb0b..8a5b794 100644 --- a/docs/shared_links_files.md +++ b/docs/shared_links_files.md @@ -28,7 +28,7 @@ _Currently we don't have an example for calling `get_shared_items` in integratio ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - if_none_match `Optional[str]` - Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail with a `304 Not Modified` if the item has not changed since. diff --git a/docs/shared_links_folders.md b/docs/shared_links_folders.md index d7c37fd..19a568e 100644 --- a/docs/shared_links_folders.md +++ b/docs/shared_links_folders.md @@ -25,7 +25,7 @@ _Currently we don't have an example for calling `get_shared_item_folders` in int ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - if_none_match `Optional[str]` - Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail with a `304 Not Modified` if the item has not changed since. diff --git a/docs/shared_links_web_links.md b/docs/shared_links_web_links.md index 4a89448..67bcc69 100644 --- a/docs/shared_links_web_links.md +++ b/docs/shared_links_web_links.md @@ -25,7 +25,7 @@ _Currently we don't have an example for calling `get_shared_item_web_links` in i ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - if_none_match `Optional[str]` - Ensures an item is only returned if it has changed. Pass in the item's last observed `etag` value into this header and the endpoint will fail with a `304 Not Modified` if the item has not changed since. diff --git a/docs/storage_policies.md b/docs/storage_policies.md index 8b5835a..85b4856 100644 --- a/docs/storage_policies.md +++ b/docs/storage_policies.md @@ -18,7 +18,7 @@ _Currently we don't have an example for calling `get_storage_policies` in integr ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - marker `Optional[str]` - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. diff --git a/docs/transfer.md b/docs/transfer.md index 21d13bc..c3ab90d 100644 --- a/docs/transfer.md +++ b/docs/transfer.md @@ -51,7 +51,7 @@ _Currently we don't have an example for calling `transfer_owned_folder` in integ - The ID of the user. Example: "12345" - owned_by `TransferOwnedFolderOwnedByArg` - The user who the folder will be transferred to -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - notify `Optional[bool]` - Determines if users should receive email notification for the action performed. diff --git a/docs/trashed_files.md b/docs/trashed_files.md index 14ec8ea..7a1ecc2 100644 --- a/docs/trashed_files.md +++ b/docs/trashed_files.md @@ -30,7 +30,7 @@ client.trashed_files.restore_file_from_trash(file_id=file.id) - An optional new name for the file. - parent `Optional[RestoreFileFromTrashParentArg]` - -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -70,7 +70,7 @@ client.trashed_files.get_file_trash(file_id=file.id) - file_id `str` - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/trashed_folders.md b/docs/trashed_folders.md index d331f6e..3ef6b84 100644 --- a/docs/trashed_folders.md +++ b/docs/trashed_folders.md @@ -39,7 +39,7 @@ client.trashed_folders.restore_folder_from_trash(folder_id=folder.id) - An optional new name for the folder. - parent `Optional[RestoreFolderFromTrashParentArg]` - -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -79,7 +79,7 @@ client.trashed_folders.get_folder_trash(folder_id=folder.id) - folder_id `str` - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/trashed_items.md b/docs/trashed_items.md index bcd5d6c..241c6ea 100644 --- a/docs/trashed_items.md +++ b/docs/trashed_items.md @@ -23,7 +23,7 @@ _Currently we don't have an example for calling `get_folder_trash_items` in inte ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - limit `Optional[int]` - The maximum number of items to return per page. diff --git a/docs/trashed_web_links.md b/docs/trashed_web_links.md index 1f47763..e26eb0b 100644 --- a/docs/trashed_web_links.md +++ b/docs/trashed_web_links.md @@ -26,7 +26,7 @@ _Currently we don't have an example for calling `create_web_link_by_id` in integ - An optional new name for the web link. - parent `Optional[CreateWebLinkByIdParentArg]` - -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -52,7 +52,7 @@ _Currently we don't have an example for calling `get_web_link_trash` in integrat - web_link_id `str` - The ID of the web link. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/docs/user_collaborations.md b/docs/user_collaborations.md index 765512a..6c9cb57 100644 --- a/docs/user_collaborations.md +++ b/docs/user_collaborations.md @@ -20,7 +20,7 @@ _Currently we don't have an example for calling `get_collaboration_by_id` in int - collaboration_id `str` - The ID of the collaboration Example: "1234" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -129,7 +129,7 @@ _Currently we don't have an example for calling `create_collaboration` in integr - Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only owner or co-owners can invite collaborators with a `can_view_path` of `true`. `can_view_path` can only be used for folder collaborations. - expires_at `Optional[str]` - Set the expiration date for the collaboration. At this date, the collaboration will be automatically removed from the item. This feature will only work if the **Automatically remove invited collaborators: Allow folder owners to extend the expiry date** setting has been enabled in the **Enterprise Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not have an expiry date and a value for this field will be result in an error. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - notify `Optional[bool]` - Determines if users should receive email notification for the action performed. diff --git a/docs/users.md b/docs/users.md index 9e3da93..e449652 100644 --- a/docs/users.md +++ b/docs/users.md @@ -35,7 +35,7 @@ client.users.get_users() - Limits the results to the kind of user specified. _ `all` returns every kind of user for whom the `login` or `name` partially matches the `filter_term`. It will only return an external user if the login matches the `filter_term` completely, and in that case it will only return that user. _ `managed` returns all managed and app users for whom the `login` or `name` partially matches the `filter_term`. \* `external` returns all external users for whom the `login` matches the `filter_term` exactly. - external_app_user_id `Optional[str]` - Limits the results to app users with the given `external_app_user_id` value. When creating an app user, an `external_app_user_id` value can be set. This value can then be used in this endpoint to find any users that match that `external_app_user_id` value. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - offset `Optional[int]` - The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response. @@ -109,7 +109,7 @@ client.users.create_user(name=user_name, login=user_login, is_platform_access_on - The user's account status - external_app_user_id `Optional[str]` - An external identifier for an app user, which can be used to look up the user. This can be used to tie user IDs from external identity providers to Box users. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -146,7 +146,7 @@ client.users.get_user_me() ### Arguments -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -186,7 +186,7 @@ client.users.get_user_by_id(user_id=user.id) - user_id `str` - The ID of the user. Example: "12345" -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. @@ -265,7 +265,7 @@ client.users.update_user_by_id(user_id=user.id, name=updated_user_name) - An alternate notification email address to which email notifications are sent. When it's confirmed, this will be the email address to which notifications are sent instead of to the primary email address. Set this value to `null` to remove the notification email. - external_app_user_id `Optional[str]` - An external identifier for an app user, which can be used to look up the user. This can be used to tie user IDs from external identity providers to Box users. Note: In order to update this field, you need to request a token using the application that created the app user. -- fields `Optional[str]` +- fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. diff --git a/test/auth.py b/test/auth.py index fec307e..f64bda7 100644 --- a/test/auth.py +++ b/test/auth.py @@ -38,7 +38,7 @@ def test_ccg_auth(): current_user: UserFull = client.users.get_user_me() assert current_user.id == user_id auth.as_enterprise(enterprise_id) - new_user: UserFull = client.users.get_user_me(fields='enterprise') + new_user: UserFull = client.users.get_user_me(fields=['enterprise']) assert not new_user.enterprise == None and new_user.enterprise.id == enterprise_id assert not new_user.id == user_id @@ -55,7 +55,7 @@ def test_jwt_auth(): current_user: UserFull = client.users.get_user_me() assert current_user.id == user_id auth.as_enterprise(enterprise_id) - new_user: UserFull = client.users.get_user_me(fields='enterprise') + new_user: UserFull = client.users.get_user_me(fields=['enterprise']) assert not new_user.enterprise == None and new_user.enterprise.id == enterprise_id assert not new_user.id == user_id diff --git a/test/files.py b/test/files.py index 6694b04..c185412 100644 --- a/test/files.py +++ b/test/files.py @@ -81,7 +81,7 @@ def testGetFileFullExtraFields(): file_content: ByteStream = generate_byte_stream(1048576) uploaded_file: File = upload_file(new_file_name, file_content) file: FileFull = client.files.get_file_by_id( - file_id=uploaded_file.id, fields='is_externally_owned,has_collaborations' + file_id=uploaded_file.id, fields=['is_externally_owned', 'has_collaborations'] ) assert file.is_externally_owned == False assert file.has_collaborations == False @@ -96,7 +96,7 @@ def testCreateGetAndDeleteFile(): with pytest.raises(Exception): client.files.get_file_by_id( file_id=uploaded_file.id, - fields='name', + fields=['name'], extra_headers={'if-none-match': file.etag}, ) assert file.name == new_file_name diff --git a/test/folders.py b/test/folders.py index d2002b1..9d17f2a 100644 --- a/test/folders.py +++ b/test/folders.py @@ -39,7 +39,7 @@ def test_get_folder_info(): def test_get_folder_full_info_with_extra_fields(): root_folder: FolderFull = client.folders.get_folder_by_id( - folder_id='0', fields='has_collaborations,tags' + folder_id='0', fields=['has_collaborations', 'tags'] ) assert root_folder.id == '0' assert root_folder.has_collaborations == False diff --git a/test/groups.py b/test/groups.py index 82a7e18..e3ef456 100644 --- a/test/groups.py +++ b/test/groups.py @@ -40,7 +40,7 @@ def test_create_get_delete_group(): ) assert group.name == group_name group_by_id: GroupFull = client.groups.get_group_by_id( - group_id=group.id, fields='id,name,description,group_type' + group_id=group.id, fields=['id', 'name', 'description', 'group_type'] ) assert group_by_id.id == group.id assert group_by_id.description == group_description