@@ -2825,6 +2825,80 @@ def copy_project(self, project_id: str) -> None:
28252825 endpoint = "projects/copy"
28262826 return self .api .post_request (endpoint , payload = payload )
28272827
2828+ def update_aws_s3_storage (
2829+ self ,
2830+ project : str ,
2831+ bucket_name : str ,
2832+ bucket_region : str ,
2833+ prefix : str = None
2834+ ) -> str :
2835+ """
2836+ Insert or update AWS S3 storage settings.
2837+
2838+ project is a slug of the project (Required).
2839+ bucket_name is a bucket name of the aws s3 (Required).
2840+ bucket_region is a bucket region of the aws s3 (Required).
2841+ prefix is a folder name in the aws s3 bucket. (Optional).
2842+ If sample_dir is specified as a prefix in the case of a hierarchical structure like the bucket below,
2843+ only the data under the sample_dir directory will be linked.
2844+ If not specified, everything under the bucket will be linked.
2845+
2846+ [tree structure]
2847+ fastlabel
2848+ ├── sample1.jpg
2849+ └── sample_dir
2850+ └── sample2.jpg
2851+
2852+ """
2853+ endpoint = "storages/aws-s3/" + project
2854+ payload = {
2855+ "bucketName" : bucket_name ,
2856+ "bucketRegion" : bucket_region ,
2857+ }
2858+ if prefix :
2859+ payload ["prefix" ] = prefix
2860+ return self .api .put_request (endpoint , payload = payload )
2861+
2862+ def create_task_from_aws_s3 (
2863+ self ,
2864+ project : str ,
2865+ status : str = "registered" ,
2866+ tags : list [str ] = [],
2867+ priority : int = 0 ,
2868+ ) -> dict :
2869+ """
2870+ Insert or update AWS S3 storage settings.
2871+
2872+ project is a slug of the project (Required).
2873+ status can be 'registered', 'completed', 'skipped',
2874+ 'reviewed', 'sent_back', 'approved', 'declined' (default: registered) (Optional).
2875+ tags is a list of tag (default: []) (Optional).
2876+ priority is the priority of the task (default: none) (Optional).
2877+ Set one of the numbers corresponding to:
2878+ none = 0,
2879+ low = 10,
2880+ medium = 20,
2881+ high = 30,
2882+ """
2883+ endpoint = "tasks/aws-s3"
2884+ payload = {
2885+ "project" : project ,
2886+ "status" : status ,
2887+ "tags" : tags ,
2888+ "priority" : priority ,
2889+ }
2890+ return self .api .post_request (endpoint , payload = payload )
2891+
2892+ def get_aws_s3_import_status_by_project (
2893+ self ,
2894+ project : str ,
2895+ ) -> dict :
2896+ """
2897+ Returns a import status of create task from AWS S3.
2898+ """
2899+ endpoint = "tasks/import/status/aws-s3/" + project
2900+ return self .api .get_request (endpoint )
2901+
28282902 @staticmethod
28292903 def __fill_assign_users (payload : dict , ** kwargs ):
28302904 if "assignee" in kwargs :
0 commit comments