@@ -1809,10 +1809,9 @@ def upload_project_file(
18091809 content_type : str | None = None ,
18101810 filename : str | None = None ,
18111811 file_id : str | None = None ,
1812+ activity_id : str | None = None ,
18121813 chunk_size : int | None = None ,
18131814 progress : TransferProgress | None = None ,
1814- # TODO remove when 'activity_id' is handled
1815- ** kwargs
18161815 ) -> requests .Response :
18171816 """Upload project file from a filepath.
18181817
@@ -1827,6 +1826,7 @@ def upload_project_file(
18271826 filename (str | None): Server filename, filename from filepath
18281827 is used if not passed.
18291828 file_id (str | None): File id.
1829+ activity_id (str | None): To which activity is file related.
18301830 chunk_size (int | None): Size of chunks that are received
18311831 in single loop.
18321832 progress (TransferProgress | None): Object that gives ability
@@ -1844,16 +1844,13 @@ def upload_project_file(
18441844 if not content_type :
18451845 content_type = "application/octet-stream"
18461846
1847- if "activity_id" in kwargs :
1848- self .log .warning (
1849- "DEV WARNING: Uploading file does not support to specify"
1850- " 'activity_id'."
1851- )
1852-
18531847 headers = {}
18541848 if file_id :
18551849 headers ["x-file-id" ] = file_id
18561850
1851+ if activity_id :
1852+ headers ["x-activity-id" ] = activity_id
1853+
18571854 return self .upload_file (
18581855 f"api/projects/{ project_name } /files" ,
18591856 filepath ,
@@ -1873,10 +1870,9 @@ def upload_project_file_from_stream(
18731870 * ,
18741871 content_type : str | None = None ,
18751872 file_id : str | None = None ,
1873+ activity_id : str | None = None ,
18761874 chunk_size : int | None = None ,
18771875 progress : TransferProgress | None = None ,
1878- # TODO remove when 'activity_id' handling is removed
1879- ** kwargs
18801876 ) -> requests .Response :
18811877 """Upload project file from a filepath.
18821878
@@ -1890,6 +1886,7 @@ def upload_project_file_from_stream(
18901886 filename (str): Name of file on server.
18911887 content_type (str | None): MIME type of file.
18921888 file_id (str | None): File id.
1889+ activity_id (str | None): To which activity is file related.
18931890 chunk_size (int | None): Size of chunks that are received
18941891 in single loop.
18951892 progress (TransferProgress | None): Object that gives ability
@@ -1905,16 +1902,13 @@ def upload_project_file_from_stream(
19051902 if not content_type :
19061903 content_type = "application/octet-stream"
19071904
1908- if "activity_id" in kwargs :
1909- self .log .warning (
1910- "DEV WARNING: Uploading file does not support to specify"
1911- " 'activity_id'."
1912- )
1913-
19141905 headers = {}
19151906 if file_id :
19161907 headers ["x-file-id" ] = file_id
19171908
1909+ if activity_id :
1910+ headers ["x-activity-id" ] = activity_id
1911+
19181912 return self .upload_file_from_stream (
19191913 f"api/projects/{ project_name } /files" ,
19201914 stream ,
0 commit comments