11# coding: utf-8
22
33"""
4- Files
4+ Files Files
55
66 Upload and manage files. # noqa: E501
77
1717# python 2 and python 3 compatibility library
1818import six
1919
20- from hubspot .files .files . api_client import ApiClient
21- from hubspot .files .files . exceptions import ApiTypeError , ApiValueError # noqa: F401
20+ from hubspot .files .api_client import ApiClient
21+ from hubspot .files .exceptions import ApiTypeError , ApiValueError # noqa: F401
2222
2323
2424class FilesApi (object ):
@@ -43,7 +43,7 @@ def archive(self, file_id, **kwargs): # noqa: E501
4343 >>> thread = api.archive(file_id, async_req=True)
4444 >>> result = thread.get()
4545
46- :param file_id: File ID to delete (required)
46+ :param file_id: FileId to delete (required)
4747 :type file_id: str
4848 :param async_req: Whether to execute the request asynchronously.
4949 :type async_req: bool, optional
@@ -73,7 +73,7 @@ def archive_with_http_info(self, file_id, **kwargs): # noqa: E501
7373 >>> thread = api.archive_with_http_info(file_id, async_req=True)
7474 >>> result = thread.get()
7575
76- :param file_id: File ID to delete (required)
76+ :param file_id: FileId to delete (required)
7777 :type file_id: str
7878 :param async_req: Whether to execute the request asynchronously.
7979 :type async_req: bool, optional
@@ -440,7 +440,7 @@ def do_search(self, **kwargs): # noqa: E501
440440 :type name: str
441441 :param path: Search files by path.
442442 :type path: str
443- :param parent_folder_id: Search files within given folder ID .
443+ :param parent_folder_id: Search files within given folderId .
444444 :type parent_folder_id: int
445445 :param size: Query by file size.
446446 :type size: int
@@ -516,7 +516,7 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501
516516 :type name: str
517517 :param path: Search files by path.
518518 :type path: str
519- :param parent_folder_id: Search files within given folder ID .
519+ :param parent_folder_id: Search files within given folderId .
520520 :type parent_folder_id: int
521521 :param size: Query by file size.
522522 :type size: int
@@ -697,7 +697,7 @@ def get_by_id(self, file_id, **kwargs): # noqa: E501
697697 >>> thread = api.get_by_id(file_id, async_req=True)
698698 >>> result = thread.get()
699699
700- :param file_id: Id of the desired file. (required)
700+ :param file_id: ID of the desired file. (required)
701701 :type file_id: str
702702 :param properties:
703703 :type properties: list[str]
@@ -729,7 +729,7 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501
729729 >>> thread = api.get_by_id_with_http_info(file_id, async_req=True)
730730 >>> result = thread.get()
731731
732- :param file_id: Id of the desired file. (required)
732+ :param file_id: ID of the desired file. (required)
733733 :type file_id: str
734734 :param properties:
735735 :type properties: list[str]
@@ -819,6 +819,136 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501
819819 _request_auth = local_var_params .get ("_request_auth" ),
820820 )
821821
822+ def get_metadata (self , path , ** kwargs ): # noqa: E501
823+ """get_metadata # noqa: E501
824+
825+ This method makes a synchronous HTTP request by default. To make an
826+ asynchronous HTTP request, please pass async_req=True
827+
828+ >>> thread = api.get_metadata(path, async_req=True)
829+ >>> result = thread.get()
830+
831+ :param path: (required)
832+ :type path: str
833+ :param properties:
834+ :type properties: list[str]
835+ :param async_req: Whether to execute the request asynchronously.
836+ :type async_req: bool, optional
837+ :param _preload_content: if False, the urllib3.HTTPResponse object will
838+ be returned without reading/decoding response
839+ data. Default is True.
840+ :type _preload_content: bool, optional
841+ :param _request_timeout: timeout setting for this request. If one
842+ number provided, it will be total request
843+ timeout. It can also be a pair (tuple) of
844+ (connection, read) timeouts.
845+ :return: Returns the result object.
846+ If the method is called asynchronously,
847+ returns the request thread.
848+ :rtype: FileStat
849+ """
850+ kwargs ["_return_http_data_only" ] = True
851+ return self .get_metadata_with_http_info (path , ** kwargs ) # noqa: E501
852+
853+ def get_metadata_with_http_info (self , path , ** kwargs ): # noqa: E501
854+ """get_metadata # noqa: E501
855+
856+ This method makes a synchronous HTTP request by default. To make an
857+ asynchronous HTTP request, please pass async_req=True
858+
859+ >>> thread = api.get_metadata_with_http_info(path, async_req=True)
860+ >>> result = thread.get()
861+
862+ :param path: (required)
863+ :type path: str
864+ :param properties:
865+ :type properties: list[str]
866+ :param async_req: Whether to execute the request asynchronously.
867+ :type async_req: bool, optional
868+ :param _return_http_data_only: response data without head status code
869+ and headers
870+ :type _return_http_data_only: bool, optional
871+ :param _preload_content: if False, the urllib3.HTTPResponse object will
872+ be returned without reading/decoding response
873+ data. Default is True.
874+ :type _preload_content: bool, optional
875+ :param _request_timeout: timeout setting for this request. If one
876+ number provided, it will be total request
877+ timeout. It can also be a pair (tuple) of
878+ (connection, read) timeouts.
879+ :param _request_auth: set to override the auth_settings for an a single
880+ request; this effectively ignores the authentication
881+ in the spec for a single request.
882+ :type _request_auth: dict, optional
883+ :type _content_type: string, optional: force content-type for the request
884+ :return: Returns the result object.
885+ If the method is called asynchronously,
886+ returns the request thread.
887+ :rtype: tuple(FileStat, status_code(int), headers(HTTPHeaderDict))
888+ """
889+
890+ local_var_params = locals ()
891+
892+ all_params = ["path" , "properties" ]
893+ all_params .extend (["async_req" , "_return_http_data_only" , "_preload_content" , "_request_timeout" , "_request_auth" , "_content_type" , "_headers" ])
894+
895+ for key , val in six .iteritems (local_var_params ["kwargs" ]):
896+ if key not in all_params :
897+ raise ApiTypeError ("Got an unexpected keyword argument '%s'" " to method get_metadata" % key )
898+ local_var_params [key ] = val
899+ del local_var_params ["kwargs" ]
900+ # verify the required parameter 'path' is set
901+ if self .api_client .client_side_validation and local_var_params .get ("path" ) is None : # noqa: E501
902+ raise ApiValueError ("Missing the required parameter `path` when calling `get_metadata`" ) # noqa: E501
903+
904+ if self .api_client .client_side_validation and "path" in local_var_params and not re .search (r".+" , local_var_params ["path" ]): # noqa: E501
905+ raise ApiValueError ("Invalid value for parameter `path` when calling `get_metadata`, must conform to the pattern `/.+/`" ) # noqa: E501
906+ collection_formats = {}
907+
908+ path_params = {}
909+ if "path" in local_var_params :
910+ path_params ["path" ] = local_var_params ["path" ] # noqa: E501
911+
912+ query_params = []
913+ if local_var_params .get ("properties" ) is not None : # noqa: E501
914+ query_params .append (("properties" , local_var_params ["properties" ])) # noqa: E501
915+ collection_formats ["properties" ] = "multi" # noqa: E501
916+
917+ header_params = dict (local_var_params .get ("_headers" , {}))
918+
919+ form_params = []
920+ local_var_files = {}
921+
922+ body_params = None
923+ # HTTP header `Accept`
924+ header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" , "*/*" ]) # noqa: E501
925+
926+ # Authentication setting
927+ auth_settings = ["oauth2" ] # noqa: E501
928+
929+ response_types_map = {
930+ 200 : "FileStat" ,
931+ }
932+
933+ return self .api_client .call_api (
934+ "/files/v3/files/stat/{path}" ,
935+ "GET" ,
936+ path_params ,
937+ query_params ,
938+ header_params ,
939+ body = body_params ,
940+ post_params = form_params ,
941+ files = local_var_files ,
942+ response_types_map = response_types_map ,
943+ auth_settings = auth_settings ,
944+ async_req = local_var_params .get ("async_req" ),
945+ _return_http_data_only = local_var_params .get ("_return_http_data_only" ), # noqa: E501
946+ _preload_content = local_var_params .get ("_preload_content" , True ),
947+ _request_timeout = local_var_params .get ("_request_timeout" ),
948+ collection_formats = collection_formats ,
949+ _request_auth = local_var_params .get ("_request_auth" ),
950+ )
951+
822952 def get_signed_url (self , file_id , ** kwargs ): # noqa: E501
823953 """Get signed URL to access private file. # noqa: E501
824954
@@ -1100,7 +1230,7 @@ def replace(self, file_id, **kwargs): # noqa: E501
11001230 >>> thread = api.replace(file_id, async_req=True)
11011231 >>> result = thread.get()
11021232
1103- :param file_id: Id of the desired file. (required)
1233+ :param file_id: ID of the desired file. (required)
11041234 :type file_id: str
11051235 :param file: File data that will replace existing file in the file manager.
11061236 :type file: file
@@ -1136,7 +1266,7 @@ def replace_with_http_info(self, file_id, **kwargs): # noqa: E501
11361266 >>> thread = api.replace_with_http_info(file_id, async_req=True)
11371267 >>> result = thread.get()
11381268
1139- :param file_id: Id of the desired file. (required)
1269+ :param file_id: ID of the desired file. (required)
11401270 :type file_id: str
11411271 :param file: File data that will replace existing file in the file manager.
11421272 :type file: file
0 commit comments