Skip to content

Commit d10ffa8

Browse files
Codegen: Webhooks, Files
1 parent d9b23de commit d10ffa8

Some content is hidden

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

56 files changed

+2453
-2542
lines changed

hubspot/files/__init__.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# coding: utf-8
2+
3+
# flake8: noqa
4+
5+
"""
6+
Files Files
7+
8+
Upload and manage files. # noqa: E501
9+
10+
The version of the OpenAPI document: v3
11+
Generated by: https://openapi-generator.tech
12+
"""
13+
14+
15+
from __future__ import absolute_import
16+
17+
__version__ = "1.0.0"
18+
19+
# import apis into sdk package
20+
from hubspot.files.api.files_api import FilesApi
21+
from hubspot.files.api.folders_api import FoldersApi
22+
23+
# import ApiClient
24+
from hubspot.files.api_client import ApiClient
25+
from hubspot.files.configuration import Configuration
26+
from hubspot.files.exceptions import OpenApiException
27+
from hubspot.files.exceptions import ApiTypeError
28+
from hubspot.files.exceptions import ApiValueError
29+
from hubspot.files.exceptions import ApiKeyError
30+
from hubspot.files.exceptions import ApiAttributeError
31+
from hubspot.files.exceptions import ApiException
32+
33+
# import models into sdk package
34+
from hubspot.files.models.collection_response_file import CollectionResponseFile
35+
from hubspot.files.models.collection_response_folder import CollectionResponseFolder
36+
from hubspot.files.models.error import Error
37+
from hubspot.files.models.error_detail import ErrorDetail
38+
from hubspot.files.models.file import File
39+
from hubspot.files.models.file_action_response import FileActionResponse
40+
from hubspot.files.models.file_stat import FileStat
41+
from hubspot.files.models.file_update_input import FileUpdateInput
42+
from hubspot.files.models.folder import Folder
43+
from hubspot.files.models.folder_action_response import FolderActionResponse
44+
from hubspot.files.models.folder_input import FolderInput
45+
from hubspot.files.models.folder_update_input import FolderUpdateInput
46+
from hubspot.files.models.folder_update_task_locator import FolderUpdateTaskLocator
47+
from hubspot.files.models.import_from_url_input import ImportFromUrlInput
48+
from hubspot.files.models.import_from_url_task_locator import ImportFromUrlTaskLocator
49+
from hubspot.files.models.next_page import NextPage
50+
from hubspot.files.models.paging import Paging
51+
from hubspot.files.models.previous_page import PreviousPage
52+
from hubspot.files.models.signed_url import SignedUrl
53+
from hubspot.files.models.standard_error import StandardError

hubspot/files/api/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import absolute_import
2+
3+
# flake8: noqa
4+
5+
# import apis into api package
6+
from hubspot.files.api.files_api import FilesApi
7+
from hubspot.files.api.folders_api import FoldersApi
Lines changed: 141 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
Files
4+
Files Files
55
66
Upload and manage files. # noqa: E501
77
@@ -17,8 +17,8 @@
1717
# python 2 and python 3 compatibility library
1818
import 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

2424
class 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
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
Files
4+
Files Files
55
66
Upload and manage files. # noqa: E501
77
@@ -17,8 +17,8 @@
1717
# python 2 and python 3 compatibility library
1818
import 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

2424
class FoldersApi(object):
@@ -289,7 +289,7 @@ def check_update_status(self, task_id, **kwargs): # noqa: E501
289289
>>> thread = api.check_update_status(task_id, async_req=True)
290290
>>> result = thread.get()
291291
292-
:param task_id: Task ID of folder update (required)
292+
:param task_id: TaskId of folder update (required)
293293
:type task_id: str
294294
:param async_req: Whether to execute the request asynchronously.
295295
:type async_req: bool, optional
@@ -319,7 +319,7 @@ def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501
319319
>>> thread = api.check_update_status_with_http_info(task_id, async_req=True)
320320
>>> result = thread.get()
321321
322-
:param task_id: Task ID of folder update (required)
322+
:param task_id: TaskId of folder update (required)
323323
:type task_id: str
324324
:param async_req: Whether to execute the request asynchronously.
325325
:type async_req: bool, optional
@@ -568,7 +568,7 @@ def do_search(self, **kwargs): # noqa: E501
568568
:type name: str
569569
:param path: Search for folders by path.
570570
:type path: str
571-
:param parent_folder_id: Search for folders with the given parent folder ID.
571+
:param parent_folder_id: Search for folders with the given parent folderId.
572572
:type parent_folder_id: int
573573
:param async_req: Whether to execute the request asynchronously.
574574
:type async_req: bool, optional
@@ -626,7 +626,7 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501
626626
:type name: str
627627
:param path: Search for folders by path.
628628
:type path: str
629-
:param parent_folder_id: Search for folders with the given parent folder ID.
629+
:param parent_folder_id: Search for folders with the given parent folderId.
630630
:type parent_folder_id: int
631631
:param async_req: Whether to execute the request asynchronously.
632632
:type async_req: bool, optional
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22
"""
3-
Files
3+
Files Files
44
55
Upload and manage files. # noqa: E501
66
@@ -24,10 +24,10 @@
2424
import six
2525
from six.moves.urllib.parse import quote
2626

27-
from hubspot.files.files.configuration import Configuration
28-
import hubspot.files.files.models
29-
from hubspot.files.files import rest
30-
from hubspot.files.files.exceptions import ApiValueError, ApiException
27+
from hubspot.files.configuration import Configuration
28+
import hubspot.files.models
29+
from hubspot.files import rest
30+
from hubspot.files.exceptions import ApiValueError, ApiException
3131

3232

3333
class ApiClient(object):
@@ -301,7 +301,7 @@ def __deserialize(self, data, klass):
301301
if klass in self.NATIVE_TYPES_MAPPING:
302302
klass = self.NATIVE_TYPES_MAPPING[klass]
303303
else:
304-
klass = getattr(hubspot.files.files.models, klass)
304+
klass = getattr(hubspot.files.models, klass)
305305

306306
if klass in self.PRIMITIVE_TYPES:
307307
return self.__deserialize_primitive(data, klass)

0 commit comments

Comments
 (0)