diff --git a/hubspot/files/__init__.py b/hubspot/files/__init__.py index e32feaa2..edca4e60 100644 --- a/hubspot/files/__init__.py +++ b/hubspot/files/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -43,6 +43,7 @@ from hubspot.files.models.folder_action_response import FolderActionResponse from hubspot.files.models.folder_input import FolderInput from hubspot.files.models.folder_update_input import FolderUpdateInput +from hubspot.files.models.folder_update_input_with_id import FolderUpdateInputWithId from hubspot.files.models.folder_update_task_locator import FolderUpdateTaskLocator from hubspot.files.models.import_from_url_input import ImportFromUrlInput from hubspot.files.models.import_from_url_task_locator import ImportFromUrlTaskLocator diff --git a/hubspot/files/api/files_api.py b/hubspot/files/api/files_api.py index 0b477279..32296a88 100644 --- a/hubspot/files/api/files_api.py +++ b/hubspot/files/api/files_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -34,9 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, file_id, **kwargs): # noqa: E501 - """Delete file # noqa: E501 + """Delete file by ID # noqa: E501 - Delete file by ID # noqa: E501 + Delete a file by ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -64,9 +64,9 @@ def archive(self, file_id, **kwargs): # noqa: E501 return self.archive_with_http_info(file_id, **kwargs) # noqa: E501 def archive_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Delete file # noqa: E501 + """Delete file by ID # noqa: E501 - Delete file by ID # noqa: E501 + Delete a file by ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -156,18 +156,18 @@ def archive_with_http_info(self, file_id, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def archive_gdpr(self, file_id, **kwargs): # noqa: E501 - """GDPR delete # noqa: E501 + def check_import(self, task_id, **kwargs): # noqa: E501 + """Check import status # noqa: E501 - GDRP delete file # noqa: E501 + Check the status of requested import. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive_gdpr(file_id, async_req=True) + >>> thread = api.check_import(task_id, async_req=True) >>> result = thread.get() - :param file_id: ID of file to GDPR delete (required) - :type file_id: str + :param task_id: Import by URL task ID (required) + :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -181,23 +181,23 @@ def archive_gdpr(self, file_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: FileActionResponse """ kwargs["_return_http_data_only"] = True - return self.archive_gdpr_with_http_info(file_id, **kwargs) # noqa: E501 + return self.check_import_with_http_info(task_id, **kwargs) # noqa: E501 - def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 - """GDPR delete # noqa: E501 + def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 + """Check import status # noqa: E501 - GDRP delete file # noqa: E501 + Check the status of requested import. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive_gdpr_with_http_info(file_id, async_req=True) + >>> thread = api.check_import_with_http_info(task_id, async_req=True) >>> result = thread.get() - :param file_id: ID of file to GDPR delete (required) - :type file_id: str + :param task_id: Import by URL task ID (required) + :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -219,30 +219,28 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(FileActionResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["file_id"] + all_params = ["task_id"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method archive_gdpr" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method check_import" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'file_id' is set - if self.api_client.client_side_validation and local_var_params.get("file_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `file_id` when calling `archive_gdpr`") # noqa: E501 + # verify the required parameter 'task_id' is set + if self.api_client.client_side_validation and local_var_params.get("task_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `task_id` when calling `check_import`") # noqa: E501 - if self.api_client.client_side_validation and "file_id" in local_var_params and not re.search(r"\d+", local_var_params["file_id"]): # noqa: E501 - raise ApiValueError("Invalid value for parameter `file_id` when calling `archive_gdpr`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} - if "file_id" in local_var_params: - path_params["fileId"] = local_var_params["file_id"] # noqa: E501 + if "task_id" in local_var_params: + path_params["taskId"] = local_var_params["task_id"] # noqa: E501 query_params = [] @@ -253,16 +251,18 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 200: "FileActionResponse", + } return self.api_client.call_api( - "/files/v3/files/{fileId}/gdpr-delete", - "DELETE", + "/files/v3/files/import-from-url/async/tasks/{taskId}/status", + "GET", path_params, query_params, header_params, @@ -279,18 +279,18 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def check_import(self, task_id, **kwargs): # noqa: E501 - """Check import status. # noqa: E501 + def delete(self, file_id, **kwargs): # noqa: E501 + """GDPR-delete file # noqa: E501 - Check the status of requested import. # noqa: E501 + Delete a file in accordance with GDPR regulations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_import(task_id, async_req=True) + >>> thread = api.delete(file_id, async_req=True) >>> result = thread.get() - :param task_id: Import by URL task ID (required) - :type task_id: str + :param file_id: ID of file to GDPR delete (required) + :type file_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -304,23 +304,23 @@ def check_import(self, task_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: FileActionResponse + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.check_import_with_http_info(task_id, **kwargs) # noqa: E501 + return self.delete_with_http_info(file_id, **kwargs) # noqa: E501 - def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Check import status. # noqa: E501 + def delete_with_http_info(self, file_id, **kwargs): # noqa: E501 + """GDPR-delete file # noqa: E501 - Check the status of requested import. # noqa: E501 + Delete a file in accordance with GDPR regulations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_import_with_http_info(task_id, async_req=True) + >>> thread = api.delete_with_http_info(file_id, async_req=True) >>> result = thread.get() - :param task_id: Import by URL task ID (required) - :type task_id: str + :param file_id: ID of file to GDPR delete (required) + :type file_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -342,28 +342,30 @@ def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(FileActionResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["task_id"] + all_params = ["file_id"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method check_import" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method delete" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'task_id' is set - if self.api_client.client_side_validation and local_var_params.get("task_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `task_id` when calling `check_import`") # noqa: E501 + # verify the required parameter 'file_id' is set + if self.api_client.client_side_validation and local_var_params.get("file_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `file_id` when calling `delete`") # noqa: E501 + if self.api_client.client_side_validation and "file_id" in local_var_params and not re.search(r"\d+", local_var_params["file_id"]): # noqa: E501 + raise ApiValueError("Invalid value for parameter `file_id` when calling `delete`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} - if "task_id" in local_var_params: - path_params["taskId"] = local_var_params["task_id"] # noqa: E501 + if "file_id" in local_var_params: + path_params["fileId"] = local_var_params["file_id"] # noqa: E501 query_params = [] @@ -374,18 +376,16 @@ def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = { - 200: "FileActionResponse", - } + response_types_map = {} return self.api_client.call_api( - "/files/v3/files/import-from-url/async/tasks/{taskId}/status", - "GET", + "/files/v3/files/{fileId}/gdpr-delete", + "DELETE", path_params, query_params, header_params, @@ -412,54 +412,78 @@ def do_search(self, **kwargs): # noqa: E501 >>> thread = api.do_search(async_req=True) >>> result = thread.get() - :param properties: Desired file properties in the return object. + :param properties: A list of file properties to return. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Number of items to return. Maximum limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort files by a given field. :type sort: list[str] - :param id: Search files by given ID. - :type id: str + :param ids: Search by a list of file IDs. + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int :param created_at: Search files by time of creation. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search files by less than or equal to time of creation. Can be used with `createdAtGte` to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search files by greater than or equal to time of creation. Can be used with `createdAtLte` to create a range. :type created_at_gte: datetime :param updated_at: Search files by time of latest updated. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search files by less than or equal to time of latest update. Can be used with `updatedAtGte` to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search files by greater than or equal to time of latest update. Can be used with `updatedAtLte` to create a range. :type updated_at_gte: datetime :param name: Search for files containing the given name. :type name: str :param path: Search files by path. :type path: str - :param parent_folder_id: Search files within given folderId. - :type parent_folder_id: int - :param size: Query by file size. + :param parent_folder_ids: Search files within given `folderId`. + :type parent_folder_ids: list[int] + :param size: Search files by exact file size in bytes. :type size: int + :param size_lte: Search files by less than or equal to file size. Can be used with `sizeGte` to create a range. + :type size_lte: int + :param size_gte: Search files by greater than or equal to file size. Can be used with `sizeLte` to create a range. + :type size_gte: int :param height: Search files by height of image or video. :type height: int + :param height_lte: Search files by less than or equal to height of image or video. Can be used with `heightGte` to create a range. + :type height_lte: int + :param height_gte: Search files by greater than or equal to height of image or video. Can be used with `heightLte` to create a range. + :type height_gte: int :param width: Search files by width of image or video. :type width: int - :param encoding: Search files with specified encoding. + :param width_lte: Search files by less than or equal to width of image or video. Can be used with `widthGte` to create a range. + :type width_lte: int + :param width_gte: Search files by greater than or equal to width of image or video. Can be used with `widthLte` to create a range. + :type width_gte: int + :param encoding: Search files by specified encoding. :type encoding: str :param type: Filter by provided file type. :type type: str :param extension: Search files by given extension. :type extension: str - :param url: Search for given URL + :param url: Search by file URL. :type url: str - :param is_usable_in_content: If true shows files that have been marked to be used in new content. It false shows files that should not be used in new content. + :param is_usable_in_content: If `true`, shows files that have been marked to be used in new content. If `false`, shows files that should not be used in new content. :type is_usable_in_content: bool - :param allows_anonymous_access: If 'true' will show private files; if 'false' will show public files + :param allows_anonymous_access: Search files by access. If `true`, will show only public files. If `false`, will show only private files. :type allows_anonymous_access: bool + :param file_md5: Search files by a specific md5 hash. + :type file_md5: str + :param expires_at: Search files by exact expires time. Time must be epoch time in milliseconds. + :type expires_at: datetime + :param expires_at_lte: Search files by less than or equal to expires time. Can be used with `expiresAtGte` to create a range. + :type expires_at_lte: datetime + :param expires_at_gte: Search files by greater than or equal to expires time. Can be used with `expiresAtLte` to create a range. + :type expires_at_gte: datetime :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -488,54 +512,78 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 >>> thread = api.do_search_with_http_info(async_req=True) >>> result = thread.get() - :param properties: Desired file properties in the return object. + :param properties: A list of file properties to return. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Number of items to return. Maximum limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort files by a given field. :type sort: list[str] - :param id: Search files by given ID. - :type id: str + :param ids: Search by a list of file IDs. + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int :param created_at: Search files by time of creation. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search files by less than or equal to time of creation. Can be used with `createdAtGte` to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search files by greater than or equal to time of creation. Can be used with `createdAtLte` to create a range. :type created_at_gte: datetime :param updated_at: Search files by time of latest updated. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search files by less than or equal to time of latest update. Can be used with `updatedAtGte` to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search files by greater than or equal to time of latest update. Can be used with `updatedAtLte` to create a range. :type updated_at_gte: datetime :param name: Search for files containing the given name. :type name: str :param path: Search files by path. :type path: str - :param parent_folder_id: Search files within given folderId. - :type parent_folder_id: int - :param size: Query by file size. + :param parent_folder_ids: Search files within given `folderId`. + :type parent_folder_ids: list[int] + :param size: Search files by exact file size in bytes. :type size: int + :param size_lte: Search files by less than or equal to file size. Can be used with `sizeGte` to create a range. + :type size_lte: int + :param size_gte: Search files by greater than or equal to file size. Can be used with `sizeLte` to create a range. + :type size_gte: int :param height: Search files by height of image or video. :type height: int + :param height_lte: Search files by less than or equal to height of image or video. Can be used with `heightGte` to create a range. + :type height_lte: int + :param height_gte: Search files by greater than or equal to height of image or video. Can be used with `heightLte` to create a range. + :type height_gte: int :param width: Search files by width of image or video. :type width: int - :param encoding: Search files with specified encoding. + :param width_lte: Search files by less than or equal to width of image or video. Can be used with `widthGte` to create a range. + :type width_lte: int + :param width_gte: Search files by greater than or equal to width of image or video. Can be used with `widthLte` to create a range. + :type width_gte: int + :param encoding: Search files by specified encoding. :type encoding: str :param type: Filter by provided file type. :type type: str :param extension: Search files by given extension. :type extension: str - :param url: Search for given URL + :param url: Search by file URL. :type url: str - :param is_usable_in_content: If true shows files that have been marked to be used in new content. It false shows files that should not be used in new content. + :param is_usable_in_content: If `true`, shows files that have been marked to be used in new content. If `false`, shows files that should not be used in new content. :type is_usable_in_content: bool - :param allows_anonymous_access: If 'true' will show private files; if 'false' will show public files + :param allows_anonymous_access: Search files by access. If `true`, will show only public files. If `false`, will show only private files. :type allows_anonymous_access: bool + :param file_md5: Search files by a specific md5 hash. + :type file_md5: str + :param expires_at: Search files by exact expires time. Time must be epoch time in milliseconds. + :type expires_at: datetime + :param expires_at_lte: Search files by less than or equal to expires time. Can be used with `expiresAtGte` to create a range. + :type expires_at_lte: datetime + :param expires_at_gte: Search files by greater than or equal to expires time. Can be used with `expiresAtLte` to create a range. + :type expires_at_gte: datetime :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -568,7 +616,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "before", "limit", "sort", - "id", + "ids", + "id_lte", + "id_gte", "created_at", "created_at_lte", "created_at_gte", @@ -577,16 +627,26 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "updated_at_gte", "name", "path", - "parent_folder_id", + "parent_folder_ids", "size", + "size_lte", + "size_gte", "height", + "height_lte", + "height_gte", "width", + "width_lte", + "width_gte", "encoding", "type", "extension", "url", "is_usable_in_content", "allows_anonymous_access", + "file_md5", + "expires_at", + "expires_at_lte", + "expires_at_gte", ] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) @@ -613,8 +673,13 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 if local_var_params.get("sort") is not None: # noqa: E501 query_params.append(("sort", local_var_params["sort"])) # noqa: E501 collection_formats["sort"] = "multi" # noqa: E501 - if local_var_params.get("id") is not None: # noqa: E501 - query_params.append(("id", local_var_params["id"])) # noqa: E501 + if local_var_params.get("ids") is not None: # noqa: E501 + query_params.append(("ids", local_var_params["ids"])) # noqa: E501 + collection_formats["ids"] = "multi" # noqa: E501 + if local_var_params.get("id_lte") is not None: # noqa: E501 + query_params.append(("idLte", local_var_params["id_lte"])) # noqa: E501 + if local_var_params.get("id_gte") is not None: # noqa: E501 + query_params.append(("idGte", local_var_params["id_gte"])) # noqa: E501 if local_var_params.get("created_at") is not None: # noqa: E501 query_params.append(("createdAt", local_var_params["created_at"])) # noqa: E501 if local_var_params.get("created_at_lte") is not None: # noqa: E501 @@ -631,14 +696,27 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("name", local_var_params["name"])) # noqa: E501 if local_var_params.get("path") is not None: # noqa: E501 query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("parent_folder_id") is not None: # noqa: E501 - query_params.append(("parentFolderId", local_var_params["parent_folder_id"])) # noqa: E501 + if local_var_params.get("parent_folder_ids") is not None: # noqa: E501 + query_params.append(("parentFolderIds", local_var_params["parent_folder_ids"])) # noqa: E501 + collection_formats["parentFolderIds"] = "multi" # noqa: E501 if local_var_params.get("size") is not None: # noqa: E501 query_params.append(("size", local_var_params["size"])) # noqa: E501 + if local_var_params.get("size_lte") is not None: # noqa: E501 + query_params.append(("sizeLte", local_var_params["size_lte"])) # noqa: E501 + if local_var_params.get("size_gte") is not None: # noqa: E501 + query_params.append(("sizeGte", local_var_params["size_gte"])) # noqa: E501 if local_var_params.get("height") is not None: # noqa: E501 query_params.append(("height", local_var_params["height"])) # noqa: E501 + if local_var_params.get("height_lte") is not None: # noqa: E501 + query_params.append(("heightLte", local_var_params["height_lte"])) # noqa: E501 + if local_var_params.get("height_gte") is not None: # noqa: E501 + query_params.append(("heightGte", local_var_params["height_gte"])) # noqa: E501 if local_var_params.get("width") is not None: # noqa: E501 query_params.append(("width", local_var_params["width"])) # noqa: E501 + if local_var_params.get("width_lte") is not None: # noqa: E501 + query_params.append(("widthLte", local_var_params["width_lte"])) # noqa: E501 + if local_var_params.get("width_gte") is not None: # noqa: E501 + query_params.append(("widthGte", local_var_params["width_gte"])) # noqa: E501 if local_var_params.get("encoding") is not None: # noqa: E501 query_params.append(("encoding", local_var_params["encoding"])) # noqa: E501 if local_var_params.get("type") is not None: # noqa: E501 @@ -651,6 +729,14 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("isUsableInContent", local_var_params["is_usable_in_content"])) # noqa: E501 if local_var_params.get("allows_anonymous_access") is not None: # noqa: E501 query_params.append(("allowsAnonymousAccess", local_var_params["allows_anonymous_access"])) # noqa: E501 + if local_var_params.get("file_md5") is not None: # noqa: E501 + query_params.append(("fileMd5", local_var_params["file_md5"])) # noqa: E501 + if local_var_params.get("expires_at") is not None: # noqa: E501 + query_params.append(("expiresAt", local_var_params["expires_at"])) # noqa: E501 + if local_var_params.get("expires_at_lte") is not None: # noqa: E501 + query_params.append(("expiresAtLte", local_var_params["expires_at_lte"])) # noqa: E501 + if local_var_params.get("expires_at_gte") is not None: # noqa: E501 + query_params.append(("expiresAtGte", local_var_params["expires_at_gte"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -688,9 +774,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 ) def get_by_id(self, file_id, **kwargs): # noqa: E501 - """Get file. # noqa: E501 + """Retrieve file by ID # noqa: E501 - Get file by ID. # noqa: E501 + Retrieve a file by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -699,7 +785,7 @@ def get_by_id(self, file_id, **kwargs): # noqa: E501 :param file_id: ID of the desired file. (required) :type file_id: str - :param properties: + :param properties: null :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -720,9 +806,9 @@ def get_by_id(self, file_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(file_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Get file. # noqa: E501 + """Retrieve file by ID # noqa: E501 - Get file by ID. # noqa: E501 + Retrieve a file by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -731,7 +817,7 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 :param file_id: ID of the desired file. (required) :type file_id: str - :param properties: + :param properties: null :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -820,17 +906,18 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def get_metadata(self, path, **kwargs): # noqa: E501 - """get_metadata # noqa: E501 + """Retrieve file by path # noqa: E501 + Retrieve a file by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_metadata(path, async_req=True) >>> result = thread.get() - :param path: (required) + :param path: The path of the file. (required) :type path: str - :param properties: + :param properties: Properties to return in the response. :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -851,17 +938,18 @@ def get_metadata(self, path, **kwargs): # noqa: E501 return self.get_metadata_with_http_info(path, **kwargs) # noqa: E501 def get_metadata_with_http_info(self, path, **kwargs): # noqa: E501 - """get_metadata # noqa: E501 + """Retrieve file by path # noqa: E501 + Retrieve a file by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_metadata_with_http_info(path, async_req=True) >>> result = thread.get() - :param path: (required) + :param path: The path of the file. (required) :type path: str - :param properties: + :param properties: Properties to return in the response. :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -950,7 +1038,7 @@ def get_metadata_with_http_info(self, path, **kwargs): # noqa: E501 ) def get_signed_url(self, file_id, **kwargs): # noqa: E501 - """Get signed URL to access private file. # noqa: E501 + """Get signed URL to access private file # noqa: E501 Generates signed URL that allows temporary access to a private file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -986,7 +1074,7 @@ def get_signed_url(self, file_id, **kwargs): # noqa: E501 return self.get_signed_url_with_http_info(file_id, **kwargs) # noqa: E501 def get_signed_url_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Get signed URL to access private file. # noqa: E501 + """Get signed URL to access private file # noqa: E501 Generates signed URL that allows temporary access to a private file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1093,7 +1181,7 @@ def get_signed_url_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def import_from_url(self, import_from_url_input, **kwargs): # noqa: E501 - """Import a file from a URL into the file manager. # noqa: E501 + """Import file from URL # noqa: E501 Asynchronously imports the file at the given URL into the file manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1123,7 +1211,7 @@ def import_from_url(self, import_from_url_input, **kwargs): # noqa: E501 return self.import_from_url_with_http_info(import_from_url_input, **kwargs) # noqa: E501 def import_from_url_with_http_info(self, import_from_url_input, **kwargs): # noqa: E501 - """Import a file from a URL into the file manager. # noqa: E501 + """Import file from URL # noqa: E501 Asynchronously imports the file at the given URL into the file manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1221,7 +1309,7 @@ def import_from_url_with_http_info(self, import_from_url_input, **kwargs): # no ) def replace(self, file_id, **kwargs): # noqa: E501 - """Replace file. # noqa: E501 + """Replace file # noqa: E501 Replace existing file data with new file data. Can be used to change image content without having to upload a new file and update all references. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1236,7 +1324,7 @@ def replace(self, file_id, **kwargs): # noqa: E501 :type file: file :param charset_hunch: Character set of given file data. :type charset_hunch: str - :param options: JSON String representing FileReplaceOptions + :param options: JSON string representing FileReplaceOptions. Includes options to set the access and expiresAt properties, which will automatically update when the file is replaced. :type options: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1257,7 +1345,7 @@ def replace(self, file_id, **kwargs): # noqa: E501 return self.replace_with_http_info(file_id, **kwargs) # noqa: E501 def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Replace file. # noqa: E501 + """Replace file # noqa: E501 Replace existing file data with new file data. Can be used to change image content without having to upload a new file and update all references. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1272,7 +1360,7 @@ def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 :type file: file :param charset_hunch: Character set of given file data. :type charset_hunch: str - :param options: JSON String representing FileReplaceOptions + :param options: JSON string representing FileReplaceOptions. Includes options to set the access and expiresAt properties, which will automatically update when the file is replaced. :type options: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1369,7 +1457,7 @@ def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 - """update file properties # noqa: E501 + """Update file properties # noqa: E501 Update properties of file by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1380,7 +1468,7 @@ def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 :param file_id: ID of file to update (required) :type file_id: str - :param file_update_input: Options to update. (required) + :param file_update_input: (required) :type file_update_input: FileUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1401,7 +1489,7 @@ def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 return self.update_properties_with_http_info(file_id, file_update_input, **kwargs) # noqa: E501 def update_properties_with_http_info(self, file_id, file_update_input, **kwargs): # noqa: E501 - """update file properties # noqa: E501 + """Update file properties # noqa: E501 Update properties of file by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1412,7 +1500,7 @@ def update_properties_with_http_info(self, file_id, file_update_input, **kwargs) :param file_id: ID of file to update (required) :type file_id: str - :param file_update_input: Options to update. (required) + :param file_update_input: (required) :type file_update_input: FileUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/files/api/folders_api.py b/hubspot/files/api/folders_api.py index 5d9e6994..320d9fe7 100644 --- a/hubspot/files/api/folders_api.py +++ b/hubspot/files/api/folders_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -34,7 +34,7 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, folder_id, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by ID # noqa: E501 Delete folder by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -64,7 +64,7 @@ def archive(self, folder_id, **kwargs): # noqa: E501 return self.archive_with_http_info(folder_id, **kwargs) # noqa: E501 def archive_with_http_info(self, folder_id, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by ID # noqa: E501 Delete folder by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -157,9 +157,9 @@ def archive_with_http_info(self, folder_id, **kwargs): # noqa: E501 ) def archive_by_path(self, folder_path, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by path # noqa: E501 - Delete folder by path. # noqa: E501 + Delete a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -187,9 +187,9 @@ def archive_by_path(self, folder_path, **kwargs): # noqa: E501 return self.archive_by_path_with_http_info(folder_path, **kwargs) # noqa: E501 def archive_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by path # noqa: E501 - Delete folder by path. # noqa: E501 + Delete a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -280,7 +280,7 @@ def archive_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 ) def check_update_status(self, task_id, **kwargs): # noqa: E501 - """Check folder update status. # noqa: E501 + """Check folder update status # noqa: E501 Check status of folder update. Folder updates happen asynchronously. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -289,7 +289,7 @@ def check_update_status(self, task_id, **kwargs): # noqa: E501 >>> thread = api.check_update_status(task_id, async_req=True) >>> result = thread.get() - :param task_id: TaskId of folder update (required) + :param task_id: The ID of the folder update task. (required) :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -310,7 +310,7 @@ def check_update_status(self, task_id, **kwargs): # noqa: E501 return self.check_update_status_with_http_info(task_id, **kwargs) # noqa: E501 def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Check folder update status. # noqa: E501 + """Check folder update status # noqa: E501 Check status of folder update. Folder updates happen asynchronously. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -319,7 +319,7 @@ def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 >>> thread = api.check_update_status_with_http_info(task_id, async_req=True) >>> result = thread.get() - :param task_id: TaskId of folder update (required) + :param task_id: The ID of the folder update task. (required) :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -403,7 +403,7 @@ def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 ) def create(self, folder_input, **kwargs): # noqa: E501 - """Create folder. # noqa: E501 + """Create folder # noqa: E501 Creates a folder. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -433,7 +433,7 @@ def create(self, folder_input, **kwargs): # noqa: E501 return self.create_with_http_info(folder_input, **kwargs) # noqa: E501 def create_with_http_info(self, folder_input, **kwargs): # noqa: E501 - """Create folder. # noqa: E501 + """Create folder # noqa: E501 Creates a folder. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -542,34 +542,38 @@ def do_search(self, **kwargs): # noqa: E501 :param properties: Properties that should be included in the returned folders. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Limit of results to return. Max limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort results by given property. For example -name sorts by name field descending, name sorts by name field ascending. :type sort: list[str] - :param id: Search folder by given ID. - :type id: str - :param created_at: Search for folders with the given creation timestamp. + :param ids: + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int + :param created_at: Search folders by exact time of creation. Time must be epoch time in milliseconds. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search folders by less than or equal to time of creation. Can be used with createdAtGte to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search folders by greater than or equal to time of creation. Can be used with createdAtLte to create a range. :type created_at_gte: datetime - :param updated_at: Search for folder at given update timestamp. + :param updated_at: Search folders by exact time of latest updated. Time must be epoch time in milliseconds. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search folders by less than or equal to time of latest update. Can be used with updatedAtGte to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search folders by greater than or equal to time of latest update. Can be used with updatedAtLte to create a range. :type updated_at_gte: datetime :param name: Search for folders containing the specified name. :type name: str - :param path: Search for folders by path. + :param path: Search folders by path. :type path: str - :param parent_folder_id: Search for folders with the given parent folderId. - :type parent_folder_id: int + :param parent_folder_ids: Search folders with the given parent folderId. + :type parent_folder_ids: list[int] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -600,34 +604,38 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 :param properties: Properties that should be included in the returned folders. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Limit of results to return. Max limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort results by given property. For example -name sorts by name field descending, name sorts by name field ascending. :type sort: list[str] - :param id: Search folder by given ID. - :type id: str - :param created_at: Search for folders with the given creation timestamp. + :param ids: + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int + :param created_at: Search folders by exact time of creation. Time must be epoch time in milliseconds. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search folders by less than or equal to time of creation. Can be used with createdAtGte to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search folders by greater than or equal to time of creation. Can be used with createdAtLte to create a range. :type created_at_gte: datetime - :param updated_at: Search for folder at given update timestamp. + :param updated_at: Search folders by exact time of latest updated. Time must be epoch time in milliseconds. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search folders by less than or equal to time of latest update. Can be used with updatedAtGte to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search folders by greater than or equal to time of latest update. Can be used with updatedAtLte to create a range. :type updated_at_gte: datetime :param name: Search for folders containing the specified name. :type name: str - :param path: Search for folders by path. + :param path: Search folders by path. :type path: str - :param parent_folder_id: Search for folders with the given parent folderId. - :type parent_folder_id: int + :param parent_folder_ids: Search folders with the given parent folderId. + :type parent_folder_ids: list[int] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -660,7 +668,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "before", "limit", "sort", - "id", + "ids", + "id_lte", + "id_gte", "created_at", "created_at_lte", "created_at_gte", @@ -669,7 +679,7 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "updated_at_gte", "name", "path", - "parent_folder_id", + "parent_folder_ids", ] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) @@ -696,8 +706,13 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 if local_var_params.get("sort") is not None: # noqa: E501 query_params.append(("sort", local_var_params["sort"])) # noqa: E501 collection_formats["sort"] = "multi" # noqa: E501 - if local_var_params.get("id") is not None: # noqa: E501 - query_params.append(("id", local_var_params["id"])) # noqa: E501 + if local_var_params.get("ids") is not None: # noqa: E501 + query_params.append(("ids", local_var_params["ids"])) # noqa: E501 + collection_formats["ids"] = "multi" # noqa: E501 + if local_var_params.get("id_lte") is not None: # noqa: E501 + query_params.append(("idLte", local_var_params["id_lte"])) # noqa: E501 + if local_var_params.get("id_gte") is not None: # noqa: E501 + query_params.append(("idGte", local_var_params["id_gte"])) # noqa: E501 if local_var_params.get("created_at") is not None: # noqa: E501 query_params.append(("createdAt", local_var_params["created_at"])) # noqa: E501 if local_var_params.get("created_at_lte") is not None: # noqa: E501 @@ -714,8 +729,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("name", local_var_params["name"])) # noqa: E501 if local_var_params.get("path") is not None: # noqa: E501 query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("parent_folder_id") is not None: # noqa: E501 - query_params.append(("parentFolderId", local_var_params["parent_folder_id"])) # noqa: E501 + if local_var_params.get("parent_folder_ids") is not None: # noqa: E501 + query_params.append(("parentFolderIds", local_var_params["parent_folder_ids"])) # noqa: E501 + collection_formats["parentFolderIds"] = "multi" # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -753,9 +769,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 ) def get_by_id(self, folder_id, **kwargs): # noqa: E501 - """Get folder # noqa: E501 + """Retrieve folder by ID # noqa: E501 - Get folder by ID # noqa: E501 + Retrieve a folder by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -785,9 +801,9 @@ def get_by_id(self, folder_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(folder_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, folder_id, **kwargs): # noqa: E501 - """Get folder # noqa: E501 + """Retrieve folder by ID # noqa: E501 - Get folder by ID # noqa: E501 + Retrieve a folder by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -885,9 +901,9 @@ def get_by_id_with_http_info(self, folder_id, **kwargs): # noqa: E501 ) def get_by_path(self, folder_path, **kwargs): # noqa: E501 - """Get folder. # noqa: E501 + """Retrieve folder by path # noqa: E501 - Get folder by path. # noqa: E501 + Retrieve a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -917,9 +933,9 @@ def get_by_path(self, folder_path, **kwargs): # noqa: E501 return self.get_by_path_with_http_info(folder_path, **kwargs) # noqa: E501 def get_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 - """Get folder. # noqa: E501 + """Retrieve folder by path # noqa: E501 - Get folder by path. # noqa: E501 + Retrieve a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1016,17 +1032,19 @@ def get_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def update_properties(self, folder_update_input, **kwargs): # noqa: E501 - """Update folder properties # noqa: E501 + def update_properties(self, folder_id, folder_update_input, **kwargs): # noqa: E501 + """Update folder properties by folder ID # noqa: E501 - Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + Update a folder's properties, identified by folder ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_properties(folder_update_input, async_req=True) + >>> thread = api.update_properties(folder_id, folder_update_input, async_req=True) >>> result = thread.get() - :param folder_update_input: Properties to change in the folder (required) + :param folder_id: ID of folder to update (required) + :type folder_id: str + :param folder_update_input: (required) :type folder_update_input: FolderUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1041,22 +1059,24 @@ def update_properties(self, folder_update_input, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: FolderUpdateTaskLocator + :rtype: Folder """ kwargs["_return_http_data_only"] = True - return self.update_properties_with_http_info(folder_update_input, **kwargs) # noqa: E501 + return self.update_properties_with_http_info(folder_id, folder_update_input, **kwargs) # noqa: E501 - def update_properties_with_http_info(self, folder_update_input, **kwargs): # noqa: E501 - """Update folder properties # noqa: E501 + def update_properties_with_http_info(self, folder_id, folder_update_input, **kwargs): # noqa: E501 + """Update folder properties by folder ID # noqa: E501 - Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + Update a folder's properties, identified by folder ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_properties_with_http_info(folder_update_input, async_req=True) + >>> thread = api.update_properties_with_http_info(folder_id, folder_update_input, async_req=True) >>> result = thread.get() - :param folder_update_input: Properties to change in the folder (required) + :param folder_id: ID of folder to update (required) + :type folder_id: str + :param folder_update_input: (required) :type folder_update_input: FolderUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1079,12 +1099,12 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(FolderUpdateTaskLocator, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(Folder, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["folder_update_input"] + all_params = ["folder_id", "folder_update_input"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): @@ -1092,13 +1112,20 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method update_properties" % key) local_var_params[key] = val del local_var_params["kwargs"] + # verify the required parameter 'folder_id' is set + if self.api_client.client_side_validation and local_var_params.get("folder_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `folder_id` when calling `update_properties`") # noqa: E501 # verify the required parameter 'folder_update_input' is set if self.api_client.client_side_validation and local_var_params.get("folder_update_input") is None: # noqa: E501 raise ApiValueError("Missing the required parameter `folder_update_input` when calling `update_properties`") # noqa: E501 + if self.api_client.client_side_validation and "folder_id" in local_var_params and not re.search(r"\d+", local_var_params["folder_id"]): # noqa: E501 + raise ApiValueError("Invalid value for parameter `folder_id` when calling `update_properties`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} + if "folder_id" in local_var_params: + path_params["folderId"] = local_var_params["folder_id"] # noqa: E501 query_params = [] @@ -1113,6 +1140,134 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "PATCH", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "Folder", + } + + return self.api_client.call_api( + "/files/v3/folders/{folderId}", + "PATCH", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def update_properties_recursively(self, folder_update_input_with_id, **kwargs): # noqa: E501 + """Update folder properties # noqa: E501 + + Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_properties_recursively(folder_update_input_with_id, async_req=True) + >>> result = thread.get() + + :param folder_update_input_with_id: (required) + :type folder_update_input_with_id: FolderUpdateInputWithId + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: FolderUpdateTaskLocator + """ + kwargs["_return_http_data_only"] = True + return self.update_properties_recursively_with_http_info(folder_update_input_with_id, **kwargs) # noqa: E501 + + def update_properties_recursively_with_http_info(self, folder_update_input_with_id, **kwargs): # noqa: E501 + """Update folder properties # noqa: E501 + + Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_properties_recursively_with_http_info(folder_update_input_with_id, async_req=True) + >>> result = thread.get() + + :param folder_update_input_with_id: (required) + :type folder_update_input_with_id: FolderUpdateInputWithId + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(FolderUpdateTaskLocator, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["folder_update_input_with_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method update_properties_recursively" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'folder_update_input_with_id' is set + if self.api_client.client_side_validation and local_var_params.get("folder_update_input_with_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `folder_update_input_with_id` when calling `update_properties_recursively`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "folder_update_input_with_id" in local_var_params: + body_params = local_var_params["folder_update_input_with_id"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + # HTTP header `Content-Type` content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 if content_types_list: diff --git a/hubspot/files/api_client.py b/hubspot/files/api_client.py index f1c50a73..1be493c8 100644 --- a/hubspot/files/api_client.py +++ b/hubspot/files/api_client.py @@ -1,6 +1,6 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/configuration.py b/hubspot/files/configuration.py index ddb9e5c4..5242c1a3 100644 --- a/hubspot/files/configuration.py +++ b/hubspot/files/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/exceptions.py b/hubspot/files/exceptions.py index 01c9f916..2a9ca5a1 100644 --- a/hubspot/files/exceptions.py +++ b/hubspot/files/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/__init__.py b/hubspot/files/models/__init__.py index c90bdbcb..f2f46aaa 100644 --- a/hubspot/files/models/__init__.py +++ b/hubspot/files/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -26,6 +26,7 @@ from hubspot.files.models.folder_action_response import FolderActionResponse from hubspot.files.models.folder_input import FolderInput from hubspot.files.models.folder_update_input import FolderUpdateInput +from hubspot.files.models.folder_update_input_with_id import FolderUpdateInputWithId from hubspot.files.models.folder_update_task_locator import FolderUpdateTaskLocator from hubspot.files.models.import_from_url_input import ImportFromUrlInput from hubspot.files.models.import_from_url_task_locator import ImportFromUrlTaskLocator diff --git a/hubspot/files/models/collection_response_file.py b/hubspot/files/models/collection_response_file.py index 18adaaf1..26e1f072 100644 --- a/hubspot/files/models/collection_response_file.py +++ b/hubspot/files/models/collection_response_file.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/collection_response_folder.py b/hubspot/files/models/collection_response_folder.py index 3242ef00..04af80d7 100644 --- a/hubspot/files/models/collection_response_folder.py +++ b/hubspot/files/models/collection_response_folder.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/error.py b/hubspot/files/models/error.py index 691cec95..fe734699 100644 --- a/hubspot/files/models/error.py +++ b/hubspot/files/models/error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/error_detail.py b/hubspot/files/models/error_detail.py index 0c387436..5562884f 100644 --- a/hubspot/files/models/error_detail.py +++ b/hubspot/files/models/error_detail.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file.py b/hubspot/files/models/file.py index 4b067ff6..1179ab54 100644 --- a/hubspot/files/models/file.py +++ b/hubspot/files/models/file.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -39,6 +39,8 @@ class File(object): "extension": "str", "access": "str", "parent_folder_id": "str", + "source_group": "str", + "file_md5": "str", "encoding": "str", "type": "str", "is_usable_in_content": "bool", @@ -46,8 +48,8 @@ class File(object): "expires_at": "int", "created_at": "datetime", "archived_at": "datetime", - "archived": "bool", "path": "str", + "archived": "bool", "size": "int", "name": "str", "width": "int", @@ -61,6 +63,8 @@ class File(object): "extension": "extension", "access": "access", "parent_folder_id": "parentFolderId", + "source_group": "sourceGroup", + "file_md5": "fileMd5", "encoding": "encoding", "type": "type", "is_usable_in_content": "isUsableInContent", @@ -68,8 +72,8 @@ class File(object): "expires_at": "expiresAt", "created_at": "createdAt", "archived_at": "archivedAt", - "archived": "archived", "path": "path", + "archived": "archived", "size": "size", "name": "name", "width": "width", @@ -84,6 +88,8 @@ def __init__( extension=None, access=None, parent_folder_id=None, + source_group=None, + file_md5=None, encoding=None, type=None, is_usable_in_content=None, @@ -91,8 +97,8 @@ def __init__( expires_at=None, created_at=None, archived_at=None, - archived=None, path=None, + archived=None, size=None, name=None, width=None, @@ -110,6 +116,8 @@ def __init__( self._extension = None self._access = None self._parent_folder_id = None + self._source_group = None + self._file_md5 = None self._encoding = None self._type = None self._is_usable_in_content = None @@ -117,8 +125,8 @@ def __init__( self._expires_at = None self._created_at = None self._archived_at = None - self._archived = None self._path = None + self._archived = None self._size = None self._name = None self._width = None @@ -133,6 +141,10 @@ def __init__( self.access = access if parent_folder_id is not None: self.parent_folder_id = parent_folder_id + if source_group is not None: + self.source_group = source_group + if file_md5 is not None: + self.file_md5 = file_md5 if encoding is not None: self.encoding = encoding if type is not None: @@ -146,9 +158,9 @@ def __init__( self.created_at = created_at if archived_at is not None: self.archived_at = archived_at - self.archived = archived if path is not None: self.path = path + self.archived = archived if size is not None: self.size = size if name is not None: @@ -207,7 +219,7 @@ def access(self, access): """ if self.local_vars_configuration.client_side_validation and access is None: # noqa: E501 raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501 - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -236,6 +248,48 @@ def parent_folder_id(self, parent_folder_id): self._parent_folder_id = parent_folder_id + @property + def source_group(self): + """Gets the source_group of this File. # noqa: E501 + + + :return: The source_group of this File. # noqa: E501 + :rtype: str + """ + return self._source_group + + @source_group.setter + def source_group(self, source_group): + """Sets the source_group of this File. + + + :param source_group: The source_group of this File. # noqa: E501 + :type source_group: str + """ + + self._source_group = source_group + + @property + def file_md5(self): + """Gets the file_md5 of this File. # noqa: E501 + + + :return: The file_md5 of this File. # noqa: E501 + :rtype: str + """ + return self._file_md5 + + @file_md5.setter + def file_md5(self, file_md5): + """Sets the file_md5 of this File. + + + :param file_md5: The file_md5 of this File. # noqa: E501 + :type file_md5: str + """ + + self._file_md5 = file_md5 + @property def encoding(self): """Gets the encoding of this File. # noqa: E501 @@ -397,6 +451,29 @@ def archived_at(self, archived_at): self._archived_at = archived_at + @property + def path(self): + """Gets the path of this File. # noqa: E501 + + Path of the file in the file manager. # noqa: E501 + + :return: The path of this File. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this File. + + Path of the file in the file manager. # noqa: E501 + + :param path: The path of this File. # noqa: E501 + :type path: str + """ + + self._path = path + @property def archived(self): """Gets the archived of this File. # noqa: E501 @@ -422,29 +499,6 @@ def archived(self, archived): self._archived = archived - @property - def path(self): - """Gets the path of this File. # noqa: E501 - - Path of the file in the file manager. # noqa: E501 - - :return: The path of this File. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this File. - - Path of the file in the file manager. # noqa: E501 - - :param path: The path of this File. # noqa: E501 - :type path: str - """ - - self._path = path - @property def size(self): """Gets the size of this File. # noqa: E501 diff --git a/hubspot/files/models/file_action_response.py b/hubspot/files/models/file_action_response.py index 97b51446..b1e87430 100644 --- a/hubspot/files/models/file_action_response.py +++ b/hubspot/files/models/file_action_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file_stat.py b/hubspot/files/models/file_stat.py index 70b49fb3..e88dc685 100644 --- a/hubspot/files/models/file_stat.py +++ b/hubspot/files/models/file_stat.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file_update_input.py b/hubspot/files/models/file_update_input.py index ec4a6382..f52b4aec 100644 --- a/hubspot/files/models/file_update_input.py +++ b/hubspot/files/models/file_update_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,18 +35,21 @@ class FileUpdateInput(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"access": "str", "parent_folder_id": "str", "name": "str", "parent_folder_path": "str", "is_usable_in_content": "bool", "expires_at": "int"} + openapi_types = {"access": "str", "parent_folder_id": "str", "name": "str", "parent_folder_path": "str", "clear_expires": "bool", "is_usable_in_content": "bool", "expires_at": "datetime"} attribute_map = { "access": "access", "parent_folder_id": "parentFolderId", "name": "name", "parent_folder_path": "parentFolderPath", + "clear_expires": "clearExpires", "is_usable_in_content": "isUsableInContent", "expires_at": "expiresAt", } - def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_path=None, is_usable_in_content=None, expires_at=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, access=None, parent_folder_id=None, name=None, parent_folder_path=None, clear_expires=None, is_usable_in_content=None, expires_at=None, local_vars_configuration=None + ): # noqa: E501 """FileUpdateInput - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -56,6 +59,7 @@ def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_ self._parent_folder_id = None self._name = None self._parent_folder_path = None + self._clear_expires = None self._is_usable_in_content = None self._expires_at = None self.discriminator = None @@ -68,6 +72,8 @@ def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_ self.name = name if parent_folder_path is not None: self.parent_folder_path = parent_folder_path + if clear_expires is not None: + self.clear_expires = clear_expires if is_usable_in_content is not None: self.is_usable_in_content = is_usable_in_content if expires_at is not None: @@ -93,7 +99,7 @@ def access(self, access): :param access: The access of this FileUpdateInput. # noqa: E501 :type access: str """ - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -168,6 +174,27 @@ def parent_folder_path(self, parent_folder_path): self._parent_folder_path = parent_folder_path + @property + def clear_expires(self): + """Gets the clear_expires of this FileUpdateInput. # noqa: E501 + + + :return: The clear_expires of this FileUpdateInput. # noqa: E501 + :rtype: bool + """ + return self._clear_expires + + @clear_expires.setter + def clear_expires(self, clear_expires): + """Sets the clear_expires of this FileUpdateInput. + + + :param clear_expires: The clear_expires of this FileUpdateInput. # noqa: E501 + :type clear_expires: bool + """ + + self._clear_expires = clear_expires + @property def is_usable_in_content(self): """Gets the is_usable_in_content of this FileUpdateInput. # noqa: E501 @@ -197,7 +224,7 @@ def expires_at(self): :return: The expires_at of this FileUpdateInput. # noqa: E501 - :rtype: int + :rtype: datetime """ return self._expires_at @@ -207,7 +234,7 @@ def expires_at(self, expires_at): :param expires_at: The expires_at of this FileUpdateInput. # noqa: E501 - :type expires_at: int + :type expires_at: datetime """ self._expires_at = expires_at diff --git a/hubspot/files/models/folder.py b/hubspot/files/models/folder.py index a27e5040..308ec89d 100644 --- a/hubspot/files/models/folder.py +++ b/hubspot/files/models/folder.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,20 +35,20 @@ class Folder(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"created_at": "datetime", "archived_at": "datetime", "archived": "bool", "path": "str", "parent_folder_id": "str", "name": "str", "id": "str", "updated_at": "datetime"} + openapi_types = {"created_at": "datetime", "archived_at": "datetime", "path": "str", "archived": "bool", "parent_folder_id": "str", "name": "str", "id": "str", "updated_at": "datetime"} attribute_map = { "created_at": "createdAt", "archived_at": "archivedAt", - "archived": "archived", "path": "path", + "archived": "archived", "parent_folder_id": "parentFolderId", "name": "name", "id": "id", "updated_at": "updatedAt", } - def __init__(self, created_at=None, archived_at=None, archived=None, path=None, parent_folder_id=None, name=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, created_at=None, archived_at=None, path=None, archived=None, parent_folder_id=None, name=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 """Folder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -56,8 +56,8 @@ def __init__(self, created_at=None, archived_at=None, archived=None, path=None, self._created_at = None self._archived_at = None - self._archived = None self._path = None + self._archived = None self._parent_folder_id = None self._name = None self._id = None @@ -67,9 +67,9 @@ def __init__(self, created_at=None, archived_at=None, archived=None, path=None, self.created_at = created_at if archived_at is not None: self.archived_at = archived_at - self.archived = archived if path is not None: self.path = path + self.archived = archived if parent_folder_id is not None: self.parent_folder_id = parent_folder_id if name is not None: @@ -125,6 +125,29 @@ def archived_at(self, archived_at): self._archived_at = archived_at + @property + def path(self): + """Gets the path of this Folder. # noqa: E501 + + Path of the folder in the file manager. # noqa: E501 + + :return: The path of this Folder. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this Folder. + + Path of the folder in the file manager. # noqa: E501 + + :param path: The path of this Folder. # noqa: E501 + :type path: str + """ + + self._path = path + @property def archived(self): """Gets the archived of this Folder. # noqa: E501 @@ -150,29 +173,6 @@ def archived(self, archived): self._archived = archived - @property - def path(self): - """Gets the path of this Folder. # noqa: E501 - - Path of the folder in the file manager. # noqa: E501 - - :return: The path of this Folder. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Folder. - - Path of the folder in the file manager. # noqa: E501 - - :param path: The path of this Folder. # noqa: E501 - :type path: str - """ - - self._path = path - @property def parent_folder_id(self): """Gets the parent_folder_id of this Folder. # noqa: E501 diff --git a/hubspot/files/models/folder_action_response.py b/hubspot/files/models/folder_action_response.py index 55b8f5ff..a53787b6 100644 --- a/hubspot/files/models/folder_action_response.py +++ b/hubspot/files/models/folder_action_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/folder_input.py b/hubspot/files/models/folder_input.py index 6bf2601a..7d8f9707 100644 --- a/hubspot/files/models/folder_input.py +++ b/hubspot/files/models/folder_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/folder_update_input.py b/hubspot/files/models/folder_update_input.py index a4b2068a..9c7c70c5 100644 --- a/hubspot/files/models/folder_update_input.py +++ b/hubspot/files/models/folder_update_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,11 +35,11 @@ class FolderUpdateInput(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"parent_folder_id": "int", "name": "str", "id": "str"} + openapi_types = {"parent_folder_id": "int", "name": "str"} - attribute_map = {"parent_folder_id": "parentFolderId", "name": "name", "id": "id"} + attribute_map = {"parent_folder_id": "parentFolderId", "name": "name"} - def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, parent_folder_id=None, name=None, local_vars_configuration=None): # noqa: E501 """FolderUpdateInput - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -47,14 +47,12 @@ def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configu self._parent_folder_id = None self._name = None - self._id = None self.discriminator = None if parent_folder_id is not None: self.parent_folder_id = parent_folder_id if name is not None: self.name = name - self.id = id @property def parent_folder_id(self): @@ -102,31 +100,6 @@ def name(self, name): self._name = name - @property - def id(self): - """Gets the id of this FolderUpdateInput. # noqa: E501 - - ID of the folder to change. # noqa: E501 - - :return: The id of this FolderUpdateInput. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this FolderUpdateInput. - - ID of the folder to change. # noqa: E501 - - :param id: The id of this FolderUpdateInput. # noqa: E501 - :type id: str - """ - if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/files/models/folder_update_input_with_id.py b/hubspot/files/models/folder_update_input_with_id.py new file mode 100644 index 00000000..b7244fd8 --- /dev/null +++ b/hubspot/files/models/folder_update_input_with_id.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Files + + Upload and manage files. # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.files.configuration import Configuration + + +class FolderUpdateInputWithId(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"parent_folder_id": "int", "name": "str", "id": "str"} + + attribute_map = {"parent_folder_id": "parentFolderId", "name": "name", "id": "id"} + + def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 + """FolderUpdateInputWithId - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._parent_folder_id = None + self._name = None + self._id = None + self.discriminator = None + + if parent_folder_id is not None: + self.parent_folder_id = parent_folder_id + if name is not None: + self.name = name + self.id = id + + @property + def parent_folder_id(self): + """Gets the parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + :rtype: int + """ + return self._parent_folder_id + + @parent_folder_id.setter + def parent_folder_id(self, parent_folder_id): + """Sets the parent_folder_id of this FolderUpdateInputWithId. + + + :param parent_folder_id: The parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + :type parent_folder_id: int + """ + + self._parent_folder_id = parent_folder_id + + @property + def name(self): + """Gets the name of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The name of this FolderUpdateInputWithId. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FolderUpdateInputWithId. + + + :param name: The name of this FolderUpdateInputWithId. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def id(self): + """Gets the id of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The id of this FolderUpdateInputWithId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FolderUpdateInputWithId. + + + :param id: The id of this FolderUpdateInputWithId. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FolderUpdateInputWithId): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FolderUpdateInputWithId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/files/models/folder_update_task_locator.py b/hubspot/files/models/folder_update_task_locator.py index f25f9e50..82923b2b 100644 --- a/hubspot/files/models/folder_update_task_locator.py +++ b/hubspot/files/models/folder_update_task_locator.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/import_from_url_input.py b/hubspot/files/models/import_from_url_input.py index b7a6a835..49279340 100644 --- a/hubspot/files/models/import_from_url_input.py +++ b/hubspot/files/models/import_from_url_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -43,6 +43,7 @@ class ImportFromUrlInput(object): "duplicate_validation_strategy": "str", "ttl": "str", "overwrite": "bool", + "expires_at": "datetime", "url": "str", "folder_id": "str", } @@ -55,6 +56,7 @@ class ImportFromUrlInput(object): "duplicate_validation_strategy": "duplicateValidationStrategy", "ttl": "ttl", "overwrite": "overwrite", + "expires_at": "expiresAt", "url": "url", "folder_id": "folderId", } @@ -68,6 +70,7 @@ def __init__( duplicate_validation_strategy=None, ttl=None, overwrite=None, + expires_at=None, url=None, folder_id=None, local_vars_configuration=None, @@ -84,6 +87,7 @@ def __init__( self._duplicate_validation_strategy = None self._ttl = None self._overwrite = None + self._expires_at = None self._url = None self._folder_id = None self.discriminator = None @@ -101,6 +105,8 @@ def __init__( self.ttl = ttl if overwrite is not None: self.overwrite = overwrite + if expires_at is not None: + self.expires_at = expires_at self.url = url if folder_id is not None: self.folder_id = folder_id @@ -150,7 +156,7 @@ def access(self, access): """ if self.local_vars_configuration.client_side_validation and access is None: # noqa: E501 raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501 - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -277,6 +283,27 @@ def overwrite(self, overwrite): self._overwrite = overwrite + @property + def expires_at(self): + """Gets the expires_at of this ImportFromUrlInput. # noqa: E501 + + + :return: The expires_at of this ImportFromUrlInput. # noqa: E501 + :rtype: datetime + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this ImportFromUrlInput. + + + :param expires_at: The expires_at of this ImportFromUrlInput. # noqa: E501 + :type expires_at: datetime + """ + + self._expires_at = expires_at + @property def url(self): """Gets the url of this ImportFromUrlInput. # noqa: E501 diff --git a/hubspot/files/models/import_from_url_task_locator.py b/hubspot/files/models/import_from_url_task_locator.py index e82d1b96..3b1f345f 100644 --- a/hubspot/files/models/import_from_url_task_locator.py +++ b/hubspot/files/models/import_from_url_task_locator.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/next_page.py b/hubspot/files/models/next_page.py index aaaebb5f..3e774e2a 100644 --- a/hubspot/files/models/next_page.py +++ b/hubspot/files/models/next_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/paging.py b/hubspot/files/models/paging.py index 60cb97d1..f9a2f26c 100644 --- a/hubspot/files/models/paging.py +++ b/hubspot/files/models/paging.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/previous_page.py b/hubspot/files/models/previous_page.py index a5295312..a8f922a4 100644 --- a/hubspot/files/models/previous_page.py +++ b/hubspot/files/models/previous_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/signed_url.py b/hubspot/files/models/signed_url.py index 208162a5..44413ffb 100644 --- a/hubspot/files/models/signed_url.py +++ b/hubspot/files/models/signed_url.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,11 +35,11 @@ class SignedUrl(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"extension": "str", "size": "int", "name": "str", "width": "int", "type": "str", "expires_at": "datetime", "url": "str", "height": "int"} + openapi_types = {"extension": "str", "size": "int", "name": "str", "width": "int", "type": "str", "url": "str", "expires_at": "datetime", "height": "int"} - attribute_map = {"extension": "extension", "size": "size", "name": "name", "width": "width", "type": "type", "expires_at": "expiresAt", "url": "url", "height": "height"} + attribute_map = {"extension": "extension", "size": "size", "name": "name", "width": "width", "type": "type", "url": "url", "expires_at": "expiresAt", "height": "height"} - def __init__(self, extension=None, size=None, name=None, width=None, type=None, expires_at=None, url=None, height=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, extension=None, size=None, name=None, width=None, type=None, url=None, expires_at=None, height=None, local_vars_configuration=None): # noqa: E501 """SignedUrl - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -50,8 +50,8 @@ def __init__(self, extension=None, size=None, name=None, width=None, type=None, self._name = None self._width = None self._type = None - self._expires_at = None self._url = None + self._expires_at = None self._height = None self.discriminator = None @@ -61,8 +61,8 @@ def __init__(self, extension=None, size=None, name=None, width=None, type=None, if width is not None: self.width = width self.type = type - self.expires_at = expires_at self.url = url + self.expires_at = expires_at if height is not None: self.height = height @@ -189,31 +189,6 @@ def type(self, type): self._type = type - @property - def expires_at(self): - """Gets the expires_at of this SignedUrl. # noqa: E501 - - Timestamp of when the URL will no longer grant access to the file. # noqa: E501 - - :return: The expires_at of this SignedUrl. # noqa: E501 - :rtype: datetime - """ - return self._expires_at - - @expires_at.setter - def expires_at(self, expires_at): - """Sets the expires_at of this SignedUrl. - - Timestamp of when the URL will no longer grant access to the file. # noqa: E501 - - :param expires_at: The expires_at of this SignedUrl. # noqa: E501 - :type expires_at: datetime - """ - if self.local_vars_configuration.client_side_validation and expires_at is None: # noqa: E501 - raise ValueError("Invalid value for `expires_at`, must not be `None`") # noqa: E501 - - self._expires_at = expires_at - @property def url(self): """Gets the url of this SignedUrl. # noqa: E501 @@ -239,6 +214,31 @@ def url(self, url): self._url = url + @property + def expires_at(self): + """Gets the expires_at of this SignedUrl. # noqa: E501 + + Timestamp of when the URL will no longer grant access to the file. # noqa: E501 + + :return: The expires_at of this SignedUrl. # noqa: E501 + :rtype: datetime + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this SignedUrl. + + Timestamp of when the URL will no longer grant access to the file. # noqa: E501 + + :param expires_at: The expires_at of this SignedUrl. # noqa: E501 + :type expires_at: datetime + """ + if self.local_vars_configuration.client_side_validation and expires_at is None: # noqa: E501 + raise ValueError("Invalid value for `expires_at`, must not be `None`") # noqa: E501 + + self._expires_at = expires_at + @property def height(self): """Gets the height of this SignedUrl. # noqa: E501 diff --git a/hubspot/files/models/standard_error.py b/hubspot/files/models/standard_error.py index ed74bdf4..3a610d12 100644 --- a/hubspot/files/models/standard_error.py +++ b/hubspot/files/models/standard_error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/rest.py b/hubspot/files/rest.py index 9cb72f2f..f15bfddd 100644 --- a/hubspot/files/rest.py +++ b/hubspot/files/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501