label-studio-sdk 1.0.20__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +325 -180
- label_studio_sdk/actions/__init__.py +4 -0
- label_studio_sdk/actions/client.py +46 -10
- label_studio_sdk/actions/types/__init__.py +4 -0
- label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
- label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
- label_studio_sdk/annotations/__init__.py +2 -2
- label_studio_sdk/annotations/client.py +379 -243
- label_studio_sdk/annotations/types/__init__.py +4 -2
- label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
- label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
- label_studio_sdk/base_client.py +28 -24
- label_studio_sdk/comments/client.py +378 -140
- label_studio_sdk/converter/README.md +207 -0
- label_studio_sdk/converter/imports/coco.py +132 -23
- label_studio_sdk/core/__init__.py +4 -0
- label_studio_sdk/core/unchecked_base_model.py +305 -0
- label_studio_sdk/environment.py +1 -1
- label_studio_sdk/errors/__init__.py +10 -1
- label_studio_sdk/errors/forbidden_error.py +9 -0
- label_studio_sdk/errors/method_not_allowed_error.py +9 -0
- label_studio_sdk/export_storage/__init__.py +1 -24
- label_studio_sdk/export_storage/azure/__init__.py +0 -3
- label_studio_sdk/export_storage/azure/client.py +231 -273
- label_studio_sdk/export_storage/client.py +5 -5
- label_studio_sdk/export_storage/gcs/__init__.py +0 -3
- label_studio_sdk/export_storage/gcs/client.py +231 -273
- label_studio_sdk/export_storage/local/__init__.py +0 -3
- label_studio_sdk/export_storage/local/client.py +211 -253
- label_studio_sdk/export_storage/redis/__init__.py +0 -3
- label_studio_sdk/export_storage/redis/client.py +239 -281
- label_studio_sdk/export_storage/s3/__init__.py +0 -3
- label_studio_sdk/export_storage/s3/client.py +254 -296
- label_studio_sdk/export_storage/s3s/client.py +694 -210
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
- label_studio_sdk/files/client.py +52 -71
- label_studio_sdk/import_storage/__init__.py +1 -24
- label_studio_sdk/import_storage/azure/__init__.py +0 -3
- label_studio_sdk/import_storage/azure/client.py +249 -299
- label_studio_sdk/import_storage/client.py +5 -5
- label_studio_sdk/import_storage/gcs/__init__.py +0 -3
- label_studio_sdk/import_storage/gcs/client.py +249 -299
- label_studio_sdk/import_storage/local/__init__.py +0 -3
- label_studio_sdk/import_storage/local/client.py +211 -257
- label_studio_sdk/import_storage/redis/__init__.py +0 -3
- label_studio_sdk/import_storage/redis/client.py +239 -285
- label_studio_sdk/import_storage/s3/__init__.py +0 -3
- label_studio_sdk/import_storage/s3/client.py +274 -324
- label_studio_sdk/import_storage/s3s/client.py +728 -434
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
- label_studio_sdk/jwt_settings/client.py +56 -58
- label_studio_sdk/label_interface/control_tags.py +48 -8
- label_studio_sdk/label_interface/interface.py +261 -56
- label_studio_sdk/ml/__init__.py +2 -16
- label_studio_sdk/ml/client.py +196 -179
- label_studio_sdk/ml/types/__init__.py +2 -12
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
- label_studio_sdk/model_providers/__init__.py +3 -0
- label_studio_sdk/model_providers/client.py +280 -228
- label_studio_sdk/model_providers/types/__init__.py +5 -0
- label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
- label_studio_sdk/organizations/__init__.py +5 -0
- label_studio_sdk/organizations/client.py +331 -0
- label_studio_sdk/organizations/members/__init__.py +2 -0
- label_studio_sdk/organizations/members/client.py +290 -0
- label_studio_sdk/predictions/client.py +29 -77
- label_studio_sdk/projects/__init__.py +18 -9
- label_studio_sdk/projects/client.py +905 -414
- label_studio_sdk/projects/exports/__init__.py +2 -2
- label_studio_sdk/projects/exports/client.py +336 -396
- label_studio_sdk/projects/exports/client_ext.py +30 -30
- label_studio_sdk/projects/exports/types/__init__.py +1 -2
- label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
- label_studio_sdk/projects/pauses/client.py +114 -105
- label_studio_sdk/projects/stats/__init__.py +5 -0
- label_studio_sdk/projects/stats/client.py +175 -0
- label_studio_sdk/projects/stats/types/__init__.py +8 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
- label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
- label_studio_sdk/projects/types/__init__.py +10 -6
- label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
- label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
- label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
- label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
- label_studio_sdk/prompts/__init__.py +4 -10
- label_studio_sdk/prompts/client.py +511 -442
- label_studio_sdk/prompts/indicators/__init__.py +3 -0
- label_studio_sdk/prompts/indicators/client.py +47 -49
- label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
- label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
- label_studio_sdk/prompts/runs/client.py +113 -135
- label_studio_sdk/prompts/types/__init__.py +2 -12
- label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
- label_studio_sdk/prompts/versions/client.py +372 -312
- label_studio_sdk/tasks/__init__.py +2 -2
- label_studio_sdk/tasks/client.py +514 -213
- label_studio_sdk/tasks/types/__init__.py +1 -2
- label_studio_sdk/tokens/client.py +160 -152
- label_studio_sdk/tokens/client_ext.py +3 -3
- label_studio_sdk/types/__init__.py +258 -142
- label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
- label_studio_sdk/types/all_roles_project_list.py +197 -0
- label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
- label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
- label_studio_sdk/types/annotated_enum.py +5 -0
- label_studio_sdk/types/annotation.py +24 -10
- label_studio_sdk/types/annotation_last_action.py +3 -15
- label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
- label_studio_sdk/types/annotation_request_last_action.py +7 -0
- label_studio_sdk/types/assignment_settings.py +31 -0
- label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/assignment_settings_request.py +32 -0
- label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → associated_project.py} +9 -6
- label_studio_sdk/types/auth_method_enum.py +5 -0
- label_studio_sdk/types/azure_blob_export_storage.py +8 -12
- label_studio_sdk/types/azure_blob_import_storage.py +8 -12
- label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
- label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
- label_studio_sdk/types/blank_enum.py +5 -0
- label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
- label_studio_sdk/types/budget_reset_period_enum.py +5 -0
- label_studio_sdk/types/child_filter.py +44 -0
- label_studio_sdk/types/comment.py +39 -14
- label_studio_sdk/types/comment_request.py +32 -0
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
- label_studio_sdk/types/converted_format.py +5 -5
- label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
- label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
- label_studio_sdk/types/default_role_enum.py +5 -0
- label_studio_sdk/types/edition_enum.py +5 -0
- label_studio_sdk/types/export.py +7 -7
- label_studio_sdk/types/file_upload.py +5 -5
- label_studio_sdk/types/filter.py +9 -6
- label_studio_sdk/types/filter_group.py +3 -3
- label_studio_sdk/types/finished_enum.py +5 -0
- label_studio_sdk/types/gcs_export_storage.py +8 -12
- label_studio_sdk/types/gcs_import_storage.py +8 -12
- label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
- label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
- label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
- label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
- label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
- label_studio_sdk/types/local_files_export_storage.py +8 -12
- label_studio_sdk/types/local_files_import_storage.py +8 -12
- label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
- label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
- label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
- label_studio_sdk/types/lse_fields.py +49 -0
- label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
- label_studio_sdk/types/lse_fields_trial_role.py +8 -0
- label_studio_sdk/types/lse_key_indicator_value.py +35 -0
- label_studio_sdk/types/lse_organization.py +57 -0
- label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
- label_studio_sdk/types/lse_project_create.py +196 -0
- label_studio_sdk/types/lse_project_create_sampling.py +7 -0
- label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
- label_studio_sdk/types/lse_project_update.py +215 -0
- label_studio_sdk/types/lse_project_update_sampling.py +7 -0
- label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
- label_studio_sdk/types/lse_s3export_storage.py +134 -0
- label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
- label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
- label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
- label_studio_sdk/types/lse_task.py +117 -0
- label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
- label_studio_sdk/types/lse_task_filter_options.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
- label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
- label_studio_sdk/types/lse_user.py +49 -0
- label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
- label_studio_sdk/types/lseapi_token_create.py +21 -0
- label_studio_sdk/types/lseapi_token_list.py +21 -0
- label_studio_sdk/types/lsejwt_settings.py +32 -0
- label_studio_sdk/types/maybe_expanded_comment.py +7 -0
- label_studio_sdk/types/ml_backend.py +16 -17
- label_studio_sdk/types/mode_enum.py +5 -0
- label_studio_sdk/types/model_interface.py +44 -0
- label_studio_sdk/types/model_interface_request.py +40 -0
- label_studio_sdk/types/model_interface_serializer_get.py +45 -0
- label_studio_sdk/types/model_provider_connection.py +48 -17
- label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
- label_studio_sdk/types/model_provider_connection_request.py +71 -0
- label_studio_sdk/types/model_run.py +40 -0
- label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
- label_studio_sdk/types/null_enum.py +3 -0
- label_studio_sdk/types/onboarding_state_enum.py +7 -0
- label_studio_sdk/types/organization_billing.py +20 -0
- label_studio_sdk/types/organization_id.py +28 -0
- label_studio_sdk/types/organization_invite.py +20 -0
- label_studio_sdk/types/organization_member.py +37 -0
- label_studio_sdk/types/organization_membership.py +24 -0
- label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
- label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
- label_studio_sdk/types/pause.py +55 -14
- label_studio_sdk/types/pause_request.py +41 -0
- label_studio_sdk/types/prediction.py +7 -11
- label_studio_sdk/types/prediction_request.py +56 -0
- label_studio_sdk/types/project.py +32 -39
- label_studio_sdk/types/project_import.py +12 -13
- label_studio_sdk/types/project_label_config.py +2 -2
- label_studio_sdk/types/project_label_config_request.py +22 -0
- label_studio_sdk/types/project_sampling.py +3 -3
- label_studio_sdk/types/project_skip_queue.py +3 -1
- label_studio_sdk/types/project_subset_enum.py +5 -0
- label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
- label_studio_sdk/types/reason_enum.py +7 -0
- label_studio_sdk/types/redis_export_storage.py +8 -12
- label_studio_sdk/types/redis_import_storage.py +8 -12
- label_studio_sdk/types/refined_prompt_response.py +5 -6
- label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
- label_studio_sdk/types/review_criteria_enum.py +5 -0
- label_studio_sdk/types/review_settings.py +80 -0
- label_studio_sdk/types/review_settings_request.py +80 -0
- label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
- label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_review_criteria.py +7 -0
- label_studio_sdk/types/reviewed_enum.py +5 -0
- label_studio_sdk/types/role_based_task.py +8 -0
- label_studio_sdk/types/s3export_storage.py +8 -12
- label_studio_sdk/types/s3import_storage.py +8 -12
- label_studio_sdk/types/sampling_enum.py +7 -0
- label_studio_sdk/types/scope_enum.py +5 -0
- label_studio_sdk/types/selected_items_request.py +23 -0
- label_studio_sdk/types/serialization_option.py +2 -6
- label_studio_sdk/types/serialization_option_request.py +22 -0
- label_studio_sdk/types/serialization_options.py +17 -5
- label_studio_sdk/types/serialization_options_request.py +47 -0
- label_studio_sdk/types/skill_name_enum.py +5 -0
- label_studio_sdk/types/skip_queue_enum.py +5 -0
- label_studio_sdk/types/skipped_enum.py +5 -0
- label_studio_sdk/types/state_enum.py +5 -0
- label_studio_sdk/types/status7bf_enum.py +5 -0
- label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
- label_studio_sdk/types/third_party_model_version.py +65 -0
- label_studio_sdk/types/third_party_model_version_request.py +54 -0
- label_studio_sdk/types/token_refresh_response.py +19 -0
- label_studio_sdk/types/token_rotate_response.py +19 -0
- label_studio_sdk/types/trial_role_enum.py +16 -0
- label_studio_sdk/types/user_simple.py +8 -5
- label_studio_sdk/types/user_simple_request.py +28 -0
- label_studio_sdk/types/version_response.py +49 -0
- label_studio_sdk/types/view.py +8 -15
- label_studio_sdk/types/webhook.py +9 -13
- label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
- label_studio_sdk/types/workspace.py +14 -34
- label_studio_sdk/types/workspace_member_create.py +27 -0
- label_studio_sdk/types/workspace_member_list.py +24 -0
- label_studio_sdk/users/client.py +604 -87
- label_studio_sdk/users/types/users_get_token_response.py +4 -11
- label_studio_sdk/users/types/users_reset_token_response.py +4 -11
- label_studio_sdk/versions/__init__.py +0 -3
- label_studio_sdk/versions/client.py +14 -14
- label_studio_sdk/views/client.py +227 -141
- label_studio_sdk/views/types/views_create_request_data.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
- label_studio_sdk/views/types/views_update_request_data.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
- label_studio_sdk/webhooks/__init__.py +36 -2
- label_studio_sdk/webhooks/client.py +173 -367
- label_studio_sdk/webhooks/types/__init__.py +34 -2
- label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
- label_studio_sdk/workspaces/__init__.py +1 -2
- label_studio_sdk/workspaces/client.py +97 -117
- label_studio_sdk/workspaces/members/__init__.py +0 -3
- label_studio_sdk/workspaces/members/client.py +65 -81
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/METADATA +1 -1
- label_studio_sdk-2.0.0.dist-info/RECORD +424 -0
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/WHEEL +1 -1
- label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
- label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
- label_studio_sdk/export_storage/local/types/__init__.py +0 -6
- label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
- label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
- label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
- label_studio_sdk/import_storage/local/types/__init__.py +0 -6
- label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/ml/types/ml_create_response.py +0 -68
- label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
- label_studio_sdk/ml/types/ml_update_response.py +0 -68
- label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
- label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
- label_studio_sdk/projects/types/projects_create_response.py +0 -91
- label_studio_sdk/projects/types/projects_update_response.py +0 -96
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
- label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
- label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
- label_studio_sdk/types/annotation_completed_by.py +0 -6
- label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
- label_studio_sdk/types/base_task_updated_by.py +0 -7
- label_studio_sdk/types/comment_created_by.py +0 -5
- label_studio_sdk/types/converted_format_status.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer.py +0 -118
- label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
- label_studio_sdk/types/export_format.py +0 -25
- label_studio_sdk/types/export_snapshot_status.py +0 -5
- label_studio_sdk/types/export_status.py +0 -5
- label_studio_sdk/types/gcs_export_storage_status.py +0 -7
- label_studio_sdk/types/gcs_import_storage_status.py +0 -7
- label_studio_sdk/types/inference_run.py +0 -34
- label_studio_sdk/types/inference_run_created_by.py +0 -5
- label_studio_sdk/types/inference_run_organization.py +0 -5
- label_studio_sdk/types/inference_run_project_subset.py +0 -5
- label_studio_sdk/types/key_indicators.py +0 -6
- label_studio_sdk/types/key_indicators_item.py +0 -41
- label_studio_sdk/types/local_files_export_storage_status.py +0 -7
- label_studio_sdk/types/local_files_import_storage_status.py +0 -7
- label_studio_sdk/types/ml_backend_auth_method.py +0 -5
- label_studio_sdk/types/ml_backend_state.py +0 -5
- label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
- label_studio_sdk/types/model_provider_connection_organization.py +0 -5
- label_studio_sdk/types/model_provider_connection_provider.py +0 -7
- label_studio_sdk/types/model_provider_connection_scope.py +0 -5
- label_studio_sdk/types/pause_paused_by.py +0 -5
- label_studio_sdk/types/project_import_status.py +0 -5
- label_studio_sdk/types/prompt.py +0 -71
- label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
- label_studio_sdk/types/prompt_created_by.py +0 -5
- label_studio_sdk/types/prompt_organization.py +0 -5
- label_studio_sdk/types/prompt_version.py +0 -32
- label_studio_sdk/types/prompt_version_created_by.py +0 -5
- label_studio_sdk/types/prompt_version_organization.py +0 -5
- label_studio_sdk/types/redis_export_storage_status.py +0 -7
- label_studio_sdk/types/redis_import_storage_status.py +0 -7
- label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
- label_studio_sdk/types/s3export_storage_status.py +0 -7
- label_studio_sdk/types/s3import_storage_status.py +0 -7
- label_studio_sdk/types/s3s_export_storage.py +0 -73
- label_studio_sdk/types/s3s_import_storage_status.py +0 -7
- label_studio_sdk/types/task.py +0 -156
- label_studio_sdk/types/task_annotators_item.py +0 -5
- label_studio_sdk/types/task_comment_authors_item.py +0 -5
- label_studio_sdk/types/task_filter_options.py +0 -39
- label_studio_sdk/types/webhook_actions_item.py +0 -21
- label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
- label_studio_sdk/versions/types/__init__.py +0 -6
- label_studio_sdk/versions/types/versions_get_response.py +0 -73
- label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
- label_studio_sdk/workspaces/members/types/__init__.py +0 -6
- label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
- label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
- label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/LICENSE +0 -0
label_studio_sdk/users/client.py
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
|
-
from
|
|
7
|
-
from ..core.
|
|
6
|
+
from ..types.lse_user_api import LseUserApi
|
|
7
|
+
from ..core.unchecked_base_model import construct_type
|
|
8
8
|
from json.decoder import JSONDecodeError
|
|
9
9
|
from ..core.api_error import ApiError
|
|
10
|
+
import datetime as dt
|
|
11
|
+
from ..types.hotkeys import Hotkeys
|
|
12
|
+
from .types.users_reset_token_response import UsersResetTokenResponse
|
|
10
13
|
from .types.users_get_token_response import UsersGetTokenResponse
|
|
11
|
-
from ..types.
|
|
14
|
+
from ..types.lse_user import LseUser
|
|
12
15
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
16
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
14
17
|
|
|
@@ -20,9 +23,250 @@ class UsersClient:
|
|
|
20
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
24
|
self._client_wrapper = client_wrapper
|
|
22
25
|
|
|
26
|
+
def get_current_user(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUserApi:
|
|
27
|
+
"""
|
|
28
|
+
Get info about the currently authenticated user.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
request_options : typing.Optional[RequestOptions]
|
|
33
|
+
Request-specific configuration.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
LseUserApi
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
--------
|
|
42
|
+
from label_studio_sdk import LabelStudio
|
|
43
|
+
|
|
44
|
+
client = LabelStudio(
|
|
45
|
+
api_key="YOUR_API_KEY",
|
|
46
|
+
)
|
|
47
|
+
client.users.get_current_user()
|
|
48
|
+
"""
|
|
49
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
50
|
+
"api/current-user",
|
|
51
|
+
method="GET",
|
|
52
|
+
request_options=request_options,
|
|
53
|
+
)
|
|
54
|
+
try:
|
|
55
|
+
if 200 <= _response.status_code < 300:
|
|
56
|
+
return typing.cast(
|
|
57
|
+
LseUserApi,
|
|
58
|
+
construct_type(
|
|
59
|
+
type_=LseUserApi, # type: ignore
|
|
60
|
+
object_=_response.json(),
|
|
61
|
+
),
|
|
62
|
+
)
|
|
63
|
+
_response_json = _response.json()
|
|
64
|
+
except JSONDecodeError:
|
|
65
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
66
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
67
|
+
|
|
68
|
+
def update_current_user(
|
|
69
|
+
self,
|
|
70
|
+
*,
|
|
71
|
+
first_name: typing.Optional[str] = OMIT,
|
|
72
|
+
last_name: typing.Optional[str] = OMIT,
|
|
73
|
+
username: typing.Optional[str] = OMIT,
|
|
74
|
+
custom_hotkeys: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
75
|
+
phone: typing.Optional[str] = OMIT,
|
|
76
|
+
active_organization: typing.Optional[int] = OMIT,
|
|
77
|
+
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
78
|
+
date_joined: typing.Optional[dt.datetime] = OMIT,
|
|
79
|
+
password: typing.Optional[str] = OMIT,
|
|
80
|
+
onboarding_state: typing.Optional[str] = OMIT,
|
|
81
|
+
is_email_verified: typing.Optional[bool] = OMIT,
|
|
82
|
+
email_notification_settings: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
83
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
84
|
+
) -> LseUserApi:
|
|
85
|
+
"""
|
|
86
|
+
Update details for the currently authenticated user.
|
|
87
|
+
|
|
88
|
+
Parameters
|
|
89
|
+
----------
|
|
90
|
+
first_name : typing.Optional[str]
|
|
91
|
+
|
|
92
|
+
last_name : typing.Optional[str]
|
|
93
|
+
|
|
94
|
+
username : typing.Optional[str]
|
|
95
|
+
|
|
96
|
+
custom_hotkeys : typing.Optional[typing.Optional[typing.Any]]
|
|
97
|
+
|
|
98
|
+
phone : typing.Optional[str]
|
|
99
|
+
|
|
100
|
+
active_organization : typing.Optional[int]
|
|
101
|
+
|
|
102
|
+
allow_newsletters : typing.Optional[bool]
|
|
103
|
+
Allow sending newsletters to user
|
|
104
|
+
|
|
105
|
+
date_joined : typing.Optional[dt.datetime]
|
|
106
|
+
|
|
107
|
+
password : typing.Optional[str]
|
|
108
|
+
|
|
109
|
+
onboarding_state : typing.Optional[str]
|
|
110
|
+
|
|
111
|
+
is_email_verified : typing.Optional[bool]
|
|
112
|
+
|
|
113
|
+
email_notification_settings : typing.Optional[typing.Optional[typing.Any]]
|
|
114
|
+
|
|
115
|
+
request_options : typing.Optional[RequestOptions]
|
|
116
|
+
Request-specific configuration.
|
|
117
|
+
|
|
118
|
+
Returns
|
|
119
|
+
-------
|
|
120
|
+
LseUserApi
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
Examples
|
|
124
|
+
--------
|
|
125
|
+
from label_studio_sdk import LabelStudio
|
|
126
|
+
|
|
127
|
+
client = LabelStudio(
|
|
128
|
+
api_key="YOUR_API_KEY",
|
|
129
|
+
)
|
|
130
|
+
client.users.update_current_user()
|
|
131
|
+
"""
|
|
132
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
133
|
+
"api/current-user",
|
|
134
|
+
method="PATCH",
|
|
135
|
+
json={
|
|
136
|
+
"first_name": first_name,
|
|
137
|
+
"last_name": last_name,
|
|
138
|
+
"username": username,
|
|
139
|
+
"custom_hotkeys": custom_hotkeys,
|
|
140
|
+
"phone": phone,
|
|
141
|
+
"active_organization": active_organization,
|
|
142
|
+
"allow_newsletters": allow_newsletters,
|
|
143
|
+
"date_joined": date_joined,
|
|
144
|
+
"password": password,
|
|
145
|
+
"onboarding_state": onboarding_state,
|
|
146
|
+
"is_email_verified": is_email_verified,
|
|
147
|
+
"email_notification_settings": email_notification_settings,
|
|
148
|
+
},
|
|
149
|
+
headers={
|
|
150
|
+
"content-type": "application/json",
|
|
151
|
+
},
|
|
152
|
+
request_options=request_options,
|
|
153
|
+
omit=OMIT,
|
|
154
|
+
)
|
|
155
|
+
try:
|
|
156
|
+
if 200 <= _response.status_code < 300:
|
|
157
|
+
return typing.cast(
|
|
158
|
+
LseUserApi,
|
|
159
|
+
construct_type(
|
|
160
|
+
type_=LseUserApi, # type: ignore
|
|
161
|
+
object_=_response.json(),
|
|
162
|
+
),
|
|
163
|
+
)
|
|
164
|
+
_response_json = _response.json()
|
|
165
|
+
except JSONDecodeError:
|
|
166
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
167
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
168
|
+
|
|
169
|
+
def get_hotkeys(self, *, request_options: typing.Optional[RequestOptions] = None) -> Hotkeys:
|
|
170
|
+
"""
|
|
171
|
+
Retrieve the custom hotkeys configuration for the current user.
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
request_options : typing.Optional[RequestOptions]
|
|
176
|
+
Request-specific configuration.
|
|
177
|
+
|
|
178
|
+
Returns
|
|
179
|
+
-------
|
|
180
|
+
Hotkeys
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
Examples
|
|
184
|
+
--------
|
|
185
|
+
from label_studio_sdk import LabelStudio
|
|
186
|
+
|
|
187
|
+
client = LabelStudio(
|
|
188
|
+
api_key="YOUR_API_KEY",
|
|
189
|
+
)
|
|
190
|
+
client.users.get_hotkeys()
|
|
191
|
+
"""
|
|
192
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
193
|
+
"api/current-user/hotkeys/",
|
|
194
|
+
method="GET",
|
|
195
|
+
request_options=request_options,
|
|
196
|
+
)
|
|
197
|
+
try:
|
|
198
|
+
if 200 <= _response.status_code < 300:
|
|
199
|
+
return typing.cast(
|
|
200
|
+
Hotkeys,
|
|
201
|
+
construct_type(
|
|
202
|
+
type_=Hotkeys, # type: ignore
|
|
203
|
+
object_=_response.json(),
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
_response_json = _response.json()
|
|
207
|
+
except JSONDecodeError:
|
|
208
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
209
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
210
|
+
|
|
211
|
+
def update_hotkeys(
|
|
212
|
+
self,
|
|
213
|
+
*,
|
|
214
|
+
custom_hotkeys: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
215
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
216
|
+
) -> Hotkeys:
|
|
217
|
+
"""
|
|
218
|
+
Update the custom hotkeys configuration for the current user.
|
|
219
|
+
|
|
220
|
+
Parameters
|
|
221
|
+
----------
|
|
222
|
+
custom_hotkeys : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
223
|
+
|
|
224
|
+
request_options : typing.Optional[RequestOptions]
|
|
225
|
+
Request-specific configuration.
|
|
226
|
+
|
|
227
|
+
Returns
|
|
228
|
+
-------
|
|
229
|
+
Hotkeys
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
Examples
|
|
233
|
+
--------
|
|
234
|
+
from label_studio_sdk import LabelStudio
|
|
235
|
+
|
|
236
|
+
client = LabelStudio(
|
|
237
|
+
api_key="YOUR_API_KEY",
|
|
238
|
+
)
|
|
239
|
+
client.users.update_hotkeys()
|
|
240
|
+
"""
|
|
241
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
242
|
+
"api/current-user/hotkeys/",
|
|
243
|
+
method="PATCH",
|
|
244
|
+
json={
|
|
245
|
+
"custom_hotkeys": custom_hotkeys,
|
|
246
|
+
},
|
|
247
|
+
headers={
|
|
248
|
+
"content-type": "application/json",
|
|
249
|
+
},
|
|
250
|
+
request_options=request_options,
|
|
251
|
+
omit=OMIT,
|
|
252
|
+
)
|
|
253
|
+
try:
|
|
254
|
+
if 200 <= _response.status_code < 300:
|
|
255
|
+
return typing.cast(
|
|
256
|
+
Hotkeys,
|
|
257
|
+
construct_type(
|
|
258
|
+
type_=Hotkeys, # type: ignore
|
|
259
|
+
object_=_response.json(),
|
|
260
|
+
),
|
|
261
|
+
)
|
|
262
|
+
_response_json = _response.json()
|
|
263
|
+
except JSONDecodeError:
|
|
264
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
265
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
266
|
+
|
|
23
267
|
def reset_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> UsersResetTokenResponse:
|
|
24
268
|
"""
|
|
25
|
-
Reset
|
|
269
|
+
Reset the user token for the current user.
|
|
26
270
|
|
|
27
271
|
Parameters
|
|
28
272
|
----------
|
|
@@ -52,7 +296,7 @@ class UsersClient:
|
|
|
52
296
|
if 200 <= _response.status_code < 300:
|
|
53
297
|
return typing.cast(
|
|
54
298
|
UsersResetTokenResponse,
|
|
55
|
-
|
|
299
|
+
construct_type(
|
|
56
300
|
type_=UsersResetTokenResponse, # type: ignore
|
|
57
301
|
object_=_response.json(),
|
|
58
302
|
),
|
|
@@ -64,7 +308,7 @@ class UsersClient:
|
|
|
64
308
|
|
|
65
309
|
def get_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> UsersGetTokenResponse:
|
|
66
310
|
"""
|
|
67
|
-
Get a
|
|
311
|
+
Get a user token to authenticate to the API as the current user.
|
|
68
312
|
|
|
69
313
|
Parameters
|
|
70
314
|
----------
|
|
@@ -94,7 +338,7 @@ class UsersClient:
|
|
|
94
338
|
if 200 <= _response.status_code < 300:
|
|
95
339
|
return typing.cast(
|
|
96
340
|
UsersGetTokenResponse,
|
|
97
|
-
|
|
341
|
+
construct_type(
|
|
98
342
|
type_=UsersGetTokenResponse, # type: ignore
|
|
99
343
|
object_=_response.json(),
|
|
100
344
|
),
|
|
@@ -104,9 +348,9 @@ class UsersClient:
|
|
|
104
348
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
105
349
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
106
350
|
|
|
107
|
-
def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) ->
|
|
351
|
+
def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
|
|
108
352
|
"""
|
|
109
|
-
|
|
353
|
+
Retrieve details of the account that you are using to access the API.
|
|
110
354
|
|
|
111
355
|
Parameters
|
|
112
356
|
----------
|
|
@@ -115,7 +359,7 @@ class UsersClient:
|
|
|
115
359
|
|
|
116
360
|
Returns
|
|
117
361
|
-------
|
|
118
|
-
|
|
362
|
+
LseUser
|
|
119
363
|
|
|
120
364
|
|
|
121
365
|
Examples
|
|
@@ -135,9 +379,9 @@ class UsersClient:
|
|
|
135
379
|
try:
|
|
136
380
|
if 200 <= _response.status_code < 300:
|
|
137
381
|
return typing.cast(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
type_=
|
|
382
|
+
LseUser,
|
|
383
|
+
construct_type(
|
|
384
|
+
type_=LseUser, # type: ignore
|
|
141
385
|
object_=_response.json(),
|
|
142
386
|
),
|
|
143
387
|
)
|
|
@@ -146,19 +390,23 @@ class UsersClient:
|
|
|
146
390
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
147
391
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
148
392
|
|
|
149
|
-
def list(
|
|
393
|
+
def list(
|
|
394
|
+
self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
395
|
+
) -> typing.List[LseUserApi]:
|
|
150
396
|
"""
|
|
151
|
-
|
|
152
|
-
List all users in your Label Studio organization.
|
|
397
|
+
List the users that exist on the Label Studio server.
|
|
153
398
|
|
|
154
399
|
Parameters
|
|
155
400
|
----------
|
|
401
|
+
ordering : typing.Optional[str]
|
|
402
|
+
Which field to use when ordering the results.
|
|
403
|
+
|
|
156
404
|
request_options : typing.Optional[RequestOptions]
|
|
157
405
|
Request-specific configuration.
|
|
158
406
|
|
|
159
407
|
Returns
|
|
160
408
|
-------
|
|
161
|
-
typing.List[
|
|
409
|
+
typing.List[LseUserApi]
|
|
162
410
|
|
|
163
411
|
|
|
164
412
|
Examples
|
|
@@ -173,14 +421,17 @@ class UsersClient:
|
|
|
173
421
|
_response = self._client_wrapper.httpx_client.request(
|
|
174
422
|
"api/users/",
|
|
175
423
|
method="GET",
|
|
424
|
+
params={
|
|
425
|
+
"ordering": ordering,
|
|
426
|
+
},
|
|
176
427
|
request_options=request_options,
|
|
177
428
|
)
|
|
178
429
|
try:
|
|
179
430
|
if 200 <= _response.status_code < 300:
|
|
180
431
|
return typing.cast(
|
|
181
|
-
typing.List[
|
|
182
|
-
|
|
183
|
-
type_=typing.List[
|
|
432
|
+
typing.List[LseUserApi],
|
|
433
|
+
construct_type(
|
|
434
|
+
type_=typing.List[LseUserApi], # type: ignore
|
|
184
435
|
object_=_response.json(),
|
|
185
436
|
),
|
|
186
437
|
)
|
|
@@ -202,9 +453,8 @@ class UsersClient:
|
|
|
202
453
|
phone: typing.Optional[str] = OMIT,
|
|
203
454
|
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
204
455
|
request_options: typing.Optional[RequestOptions] = None,
|
|
205
|
-
) ->
|
|
456
|
+
) -> LseUser:
|
|
206
457
|
"""
|
|
207
|
-
|
|
208
458
|
Create a user in Label Studio.
|
|
209
459
|
|
|
210
460
|
Parameters
|
|
@@ -241,7 +491,7 @@ class UsersClient:
|
|
|
241
491
|
|
|
242
492
|
Returns
|
|
243
493
|
-------
|
|
244
|
-
|
|
494
|
+
LseUser
|
|
245
495
|
|
|
246
496
|
|
|
247
497
|
Examples
|
|
@@ -276,9 +526,9 @@ class UsersClient:
|
|
|
276
526
|
try:
|
|
277
527
|
if 200 <= _response.status_code < 300:
|
|
278
528
|
return typing.cast(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
type_=
|
|
529
|
+
LseUser,
|
|
530
|
+
construct_type(
|
|
531
|
+
type_=LseUser, # type: ignore
|
|
282
532
|
object_=_response.json(),
|
|
283
533
|
),
|
|
284
534
|
)
|
|
@@ -287,11 +537,9 @@ class UsersClient:
|
|
|
287
537
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
288
538
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
289
539
|
|
|
290
|
-
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) ->
|
|
540
|
+
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
|
|
291
541
|
"""
|
|
292
|
-
|
|
293
|
-
Get info about a specific Label Studio user.
|
|
294
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
542
|
+
Get info about a specific Label Studio user, based on the user ID.
|
|
295
543
|
|
|
296
544
|
Parameters
|
|
297
545
|
----------
|
|
@@ -303,7 +551,7 @@ class UsersClient:
|
|
|
303
551
|
|
|
304
552
|
Returns
|
|
305
553
|
-------
|
|
306
|
-
|
|
554
|
+
LseUser
|
|
307
555
|
|
|
308
556
|
|
|
309
557
|
Examples
|
|
@@ -325,9 +573,9 @@ class UsersClient:
|
|
|
325
573
|
try:
|
|
326
574
|
if 200 <= _response.status_code < 300:
|
|
327
575
|
return typing.cast(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
type_=
|
|
576
|
+
LseUser,
|
|
577
|
+
construct_type(
|
|
578
|
+
type_=LseUser, # type: ignore
|
|
331
579
|
object_=_response.json(),
|
|
332
580
|
),
|
|
333
581
|
)
|
|
@@ -338,10 +586,7 @@ class UsersClient:
|
|
|
338
586
|
|
|
339
587
|
def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
340
588
|
"""
|
|
341
|
-
|
|
342
|
-
Delete a specific Label Studio user.
|
|
343
|
-
|
|
344
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
589
|
+
Delete a specific Label Studio user. Only available in community edition.
|
|
345
590
|
|
|
346
591
|
<Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>
|
|
347
592
|
|
|
@@ -395,12 +640,11 @@ class UsersClient:
|
|
|
395
640
|
phone: typing.Optional[str] = OMIT,
|
|
396
641
|
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
397
642
|
request_options: typing.Optional[RequestOptions] = None,
|
|
398
|
-
) ->
|
|
643
|
+
) -> LseUser:
|
|
399
644
|
"""
|
|
400
645
|
|
|
401
|
-
|
|
646
|
+
Update details for a specific user, such as their name or contact information, in Label Studio.
|
|
402
647
|
|
|
403
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
404
648
|
|
|
405
649
|
Parameters
|
|
406
650
|
----------
|
|
@@ -439,7 +683,7 @@ class UsersClient:
|
|
|
439
683
|
|
|
440
684
|
Returns
|
|
441
685
|
-------
|
|
442
|
-
|
|
686
|
+
LseUser
|
|
443
687
|
|
|
444
688
|
|
|
445
689
|
Examples
|
|
@@ -476,9 +720,9 @@ class UsersClient:
|
|
|
476
720
|
try:
|
|
477
721
|
if 200 <= _response.status_code < 300:
|
|
478
722
|
return typing.cast(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
type_=
|
|
723
|
+
LseUser,
|
|
724
|
+
construct_type(
|
|
725
|
+
type_=LseUser, # type: ignore
|
|
482
726
|
object_=_response.json(),
|
|
483
727
|
),
|
|
484
728
|
)
|
|
@@ -492,9 +736,282 @@ class AsyncUsersClient:
|
|
|
492
736
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
493
737
|
self._client_wrapper = client_wrapper
|
|
494
738
|
|
|
739
|
+
async def get_current_user(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUserApi:
|
|
740
|
+
"""
|
|
741
|
+
Get info about the currently authenticated user.
|
|
742
|
+
|
|
743
|
+
Parameters
|
|
744
|
+
----------
|
|
745
|
+
request_options : typing.Optional[RequestOptions]
|
|
746
|
+
Request-specific configuration.
|
|
747
|
+
|
|
748
|
+
Returns
|
|
749
|
+
-------
|
|
750
|
+
LseUserApi
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
Examples
|
|
754
|
+
--------
|
|
755
|
+
import asyncio
|
|
756
|
+
|
|
757
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
758
|
+
|
|
759
|
+
client = AsyncLabelStudio(
|
|
760
|
+
api_key="YOUR_API_KEY",
|
|
761
|
+
)
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
async def main() -> None:
|
|
765
|
+
await client.users.get_current_user()
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
asyncio.run(main())
|
|
769
|
+
"""
|
|
770
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
771
|
+
"api/current-user",
|
|
772
|
+
method="GET",
|
|
773
|
+
request_options=request_options,
|
|
774
|
+
)
|
|
775
|
+
try:
|
|
776
|
+
if 200 <= _response.status_code < 300:
|
|
777
|
+
return typing.cast(
|
|
778
|
+
LseUserApi,
|
|
779
|
+
construct_type(
|
|
780
|
+
type_=LseUserApi, # type: ignore
|
|
781
|
+
object_=_response.json(),
|
|
782
|
+
),
|
|
783
|
+
)
|
|
784
|
+
_response_json = _response.json()
|
|
785
|
+
except JSONDecodeError:
|
|
786
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
787
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
788
|
+
|
|
789
|
+
async def update_current_user(
|
|
790
|
+
self,
|
|
791
|
+
*,
|
|
792
|
+
first_name: typing.Optional[str] = OMIT,
|
|
793
|
+
last_name: typing.Optional[str] = OMIT,
|
|
794
|
+
username: typing.Optional[str] = OMIT,
|
|
795
|
+
custom_hotkeys: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
796
|
+
phone: typing.Optional[str] = OMIT,
|
|
797
|
+
active_organization: typing.Optional[int] = OMIT,
|
|
798
|
+
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
799
|
+
date_joined: typing.Optional[dt.datetime] = OMIT,
|
|
800
|
+
password: typing.Optional[str] = OMIT,
|
|
801
|
+
onboarding_state: typing.Optional[str] = OMIT,
|
|
802
|
+
is_email_verified: typing.Optional[bool] = OMIT,
|
|
803
|
+
email_notification_settings: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
804
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
805
|
+
) -> LseUserApi:
|
|
806
|
+
"""
|
|
807
|
+
Update details for the currently authenticated user.
|
|
808
|
+
|
|
809
|
+
Parameters
|
|
810
|
+
----------
|
|
811
|
+
first_name : typing.Optional[str]
|
|
812
|
+
|
|
813
|
+
last_name : typing.Optional[str]
|
|
814
|
+
|
|
815
|
+
username : typing.Optional[str]
|
|
816
|
+
|
|
817
|
+
custom_hotkeys : typing.Optional[typing.Optional[typing.Any]]
|
|
818
|
+
|
|
819
|
+
phone : typing.Optional[str]
|
|
820
|
+
|
|
821
|
+
active_organization : typing.Optional[int]
|
|
822
|
+
|
|
823
|
+
allow_newsletters : typing.Optional[bool]
|
|
824
|
+
Allow sending newsletters to user
|
|
825
|
+
|
|
826
|
+
date_joined : typing.Optional[dt.datetime]
|
|
827
|
+
|
|
828
|
+
password : typing.Optional[str]
|
|
829
|
+
|
|
830
|
+
onboarding_state : typing.Optional[str]
|
|
831
|
+
|
|
832
|
+
is_email_verified : typing.Optional[bool]
|
|
833
|
+
|
|
834
|
+
email_notification_settings : typing.Optional[typing.Optional[typing.Any]]
|
|
835
|
+
|
|
836
|
+
request_options : typing.Optional[RequestOptions]
|
|
837
|
+
Request-specific configuration.
|
|
838
|
+
|
|
839
|
+
Returns
|
|
840
|
+
-------
|
|
841
|
+
LseUserApi
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
Examples
|
|
845
|
+
--------
|
|
846
|
+
import asyncio
|
|
847
|
+
|
|
848
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
849
|
+
|
|
850
|
+
client = AsyncLabelStudio(
|
|
851
|
+
api_key="YOUR_API_KEY",
|
|
852
|
+
)
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
async def main() -> None:
|
|
856
|
+
await client.users.update_current_user()
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
asyncio.run(main())
|
|
860
|
+
"""
|
|
861
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
862
|
+
"api/current-user",
|
|
863
|
+
method="PATCH",
|
|
864
|
+
json={
|
|
865
|
+
"first_name": first_name,
|
|
866
|
+
"last_name": last_name,
|
|
867
|
+
"username": username,
|
|
868
|
+
"custom_hotkeys": custom_hotkeys,
|
|
869
|
+
"phone": phone,
|
|
870
|
+
"active_organization": active_organization,
|
|
871
|
+
"allow_newsletters": allow_newsletters,
|
|
872
|
+
"date_joined": date_joined,
|
|
873
|
+
"password": password,
|
|
874
|
+
"onboarding_state": onboarding_state,
|
|
875
|
+
"is_email_verified": is_email_verified,
|
|
876
|
+
"email_notification_settings": email_notification_settings,
|
|
877
|
+
},
|
|
878
|
+
headers={
|
|
879
|
+
"content-type": "application/json",
|
|
880
|
+
},
|
|
881
|
+
request_options=request_options,
|
|
882
|
+
omit=OMIT,
|
|
883
|
+
)
|
|
884
|
+
try:
|
|
885
|
+
if 200 <= _response.status_code < 300:
|
|
886
|
+
return typing.cast(
|
|
887
|
+
LseUserApi,
|
|
888
|
+
construct_type(
|
|
889
|
+
type_=LseUserApi, # type: ignore
|
|
890
|
+
object_=_response.json(),
|
|
891
|
+
),
|
|
892
|
+
)
|
|
893
|
+
_response_json = _response.json()
|
|
894
|
+
except JSONDecodeError:
|
|
895
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
896
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
897
|
+
|
|
898
|
+
async def get_hotkeys(self, *, request_options: typing.Optional[RequestOptions] = None) -> Hotkeys:
|
|
899
|
+
"""
|
|
900
|
+
Retrieve the custom hotkeys configuration for the current user.
|
|
901
|
+
|
|
902
|
+
Parameters
|
|
903
|
+
----------
|
|
904
|
+
request_options : typing.Optional[RequestOptions]
|
|
905
|
+
Request-specific configuration.
|
|
906
|
+
|
|
907
|
+
Returns
|
|
908
|
+
-------
|
|
909
|
+
Hotkeys
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
Examples
|
|
913
|
+
--------
|
|
914
|
+
import asyncio
|
|
915
|
+
|
|
916
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
917
|
+
|
|
918
|
+
client = AsyncLabelStudio(
|
|
919
|
+
api_key="YOUR_API_KEY",
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
async def main() -> None:
|
|
924
|
+
await client.users.get_hotkeys()
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
asyncio.run(main())
|
|
928
|
+
"""
|
|
929
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
930
|
+
"api/current-user/hotkeys/",
|
|
931
|
+
method="GET",
|
|
932
|
+
request_options=request_options,
|
|
933
|
+
)
|
|
934
|
+
try:
|
|
935
|
+
if 200 <= _response.status_code < 300:
|
|
936
|
+
return typing.cast(
|
|
937
|
+
Hotkeys,
|
|
938
|
+
construct_type(
|
|
939
|
+
type_=Hotkeys, # type: ignore
|
|
940
|
+
object_=_response.json(),
|
|
941
|
+
),
|
|
942
|
+
)
|
|
943
|
+
_response_json = _response.json()
|
|
944
|
+
except JSONDecodeError:
|
|
945
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
946
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
947
|
+
|
|
948
|
+
async def update_hotkeys(
|
|
949
|
+
self,
|
|
950
|
+
*,
|
|
951
|
+
custom_hotkeys: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
952
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
953
|
+
) -> Hotkeys:
|
|
954
|
+
"""
|
|
955
|
+
Update the custom hotkeys configuration for the current user.
|
|
956
|
+
|
|
957
|
+
Parameters
|
|
958
|
+
----------
|
|
959
|
+
custom_hotkeys : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
960
|
+
|
|
961
|
+
request_options : typing.Optional[RequestOptions]
|
|
962
|
+
Request-specific configuration.
|
|
963
|
+
|
|
964
|
+
Returns
|
|
965
|
+
-------
|
|
966
|
+
Hotkeys
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
Examples
|
|
970
|
+
--------
|
|
971
|
+
import asyncio
|
|
972
|
+
|
|
973
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
974
|
+
|
|
975
|
+
client = AsyncLabelStudio(
|
|
976
|
+
api_key="YOUR_API_KEY",
|
|
977
|
+
)
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
async def main() -> None:
|
|
981
|
+
await client.users.update_hotkeys()
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
asyncio.run(main())
|
|
985
|
+
"""
|
|
986
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
987
|
+
"api/current-user/hotkeys/",
|
|
988
|
+
method="PATCH",
|
|
989
|
+
json={
|
|
990
|
+
"custom_hotkeys": custom_hotkeys,
|
|
991
|
+
},
|
|
992
|
+
headers={
|
|
993
|
+
"content-type": "application/json",
|
|
994
|
+
},
|
|
995
|
+
request_options=request_options,
|
|
996
|
+
omit=OMIT,
|
|
997
|
+
)
|
|
998
|
+
try:
|
|
999
|
+
if 200 <= _response.status_code < 300:
|
|
1000
|
+
return typing.cast(
|
|
1001
|
+
Hotkeys,
|
|
1002
|
+
construct_type(
|
|
1003
|
+
type_=Hotkeys, # type: ignore
|
|
1004
|
+
object_=_response.json(),
|
|
1005
|
+
),
|
|
1006
|
+
)
|
|
1007
|
+
_response_json = _response.json()
|
|
1008
|
+
except JSONDecodeError:
|
|
1009
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1010
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1011
|
+
|
|
495
1012
|
async def reset_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> UsersResetTokenResponse:
|
|
496
1013
|
"""
|
|
497
|
-
Reset
|
|
1014
|
+
Reset the user token for the current user.
|
|
498
1015
|
|
|
499
1016
|
Parameters
|
|
500
1017
|
----------
|
|
@@ -532,7 +1049,7 @@ class AsyncUsersClient:
|
|
|
532
1049
|
if 200 <= _response.status_code < 300:
|
|
533
1050
|
return typing.cast(
|
|
534
1051
|
UsersResetTokenResponse,
|
|
535
|
-
|
|
1052
|
+
construct_type(
|
|
536
1053
|
type_=UsersResetTokenResponse, # type: ignore
|
|
537
1054
|
object_=_response.json(),
|
|
538
1055
|
),
|
|
@@ -544,7 +1061,7 @@ class AsyncUsersClient:
|
|
|
544
1061
|
|
|
545
1062
|
async def get_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> UsersGetTokenResponse:
|
|
546
1063
|
"""
|
|
547
|
-
Get a
|
|
1064
|
+
Get a user token to authenticate to the API as the current user.
|
|
548
1065
|
|
|
549
1066
|
Parameters
|
|
550
1067
|
----------
|
|
@@ -582,7 +1099,7 @@ class AsyncUsersClient:
|
|
|
582
1099
|
if 200 <= _response.status_code < 300:
|
|
583
1100
|
return typing.cast(
|
|
584
1101
|
UsersGetTokenResponse,
|
|
585
|
-
|
|
1102
|
+
construct_type(
|
|
586
1103
|
type_=UsersGetTokenResponse, # type: ignore
|
|
587
1104
|
object_=_response.json(),
|
|
588
1105
|
),
|
|
@@ -592,9 +1109,9 @@ class AsyncUsersClient:
|
|
|
592
1109
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
593
1110
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
594
1111
|
|
|
595
|
-
async def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) ->
|
|
1112
|
+
async def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
|
|
596
1113
|
"""
|
|
597
|
-
|
|
1114
|
+
Retrieve details of the account that you are using to access the API.
|
|
598
1115
|
|
|
599
1116
|
Parameters
|
|
600
1117
|
----------
|
|
@@ -603,7 +1120,7 @@ class AsyncUsersClient:
|
|
|
603
1120
|
|
|
604
1121
|
Returns
|
|
605
1122
|
-------
|
|
606
|
-
|
|
1123
|
+
LseUser
|
|
607
1124
|
|
|
608
1125
|
|
|
609
1126
|
Examples
|
|
@@ -631,9 +1148,9 @@ class AsyncUsersClient:
|
|
|
631
1148
|
try:
|
|
632
1149
|
if 200 <= _response.status_code < 300:
|
|
633
1150
|
return typing.cast(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
type_=
|
|
1151
|
+
LseUser,
|
|
1152
|
+
construct_type(
|
|
1153
|
+
type_=LseUser, # type: ignore
|
|
637
1154
|
object_=_response.json(),
|
|
638
1155
|
),
|
|
639
1156
|
)
|
|
@@ -642,19 +1159,23 @@ class AsyncUsersClient:
|
|
|
642
1159
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
643
1160
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
644
1161
|
|
|
645
|
-
async def list(
|
|
1162
|
+
async def list(
|
|
1163
|
+
self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
1164
|
+
) -> typing.List[LseUserApi]:
|
|
646
1165
|
"""
|
|
647
|
-
|
|
648
|
-
List all users in your Label Studio organization.
|
|
1166
|
+
List the users that exist on the Label Studio server.
|
|
649
1167
|
|
|
650
1168
|
Parameters
|
|
651
1169
|
----------
|
|
1170
|
+
ordering : typing.Optional[str]
|
|
1171
|
+
Which field to use when ordering the results.
|
|
1172
|
+
|
|
652
1173
|
request_options : typing.Optional[RequestOptions]
|
|
653
1174
|
Request-specific configuration.
|
|
654
1175
|
|
|
655
1176
|
Returns
|
|
656
1177
|
-------
|
|
657
|
-
typing.List[
|
|
1178
|
+
typing.List[LseUserApi]
|
|
658
1179
|
|
|
659
1180
|
|
|
660
1181
|
Examples
|
|
@@ -677,14 +1198,17 @@ class AsyncUsersClient:
|
|
|
677
1198
|
_response = await self._client_wrapper.httpx_client.request(
|
|
678
1199
|
"api/users/",
|
|
679
1200
|
method="GET",
|
|
1201
|
+
params={
|
|
1202
|
+
"ordering": ordering,
|
|
1203
|
+
},
|
|
680
1204
|
request_options=request_options,
|
|
681
1205
|
)
|
|
682
1206
|
try:
|
|
683
1207
|
if 200 <= _response.status_code < 300:
|
|
684
1208
|
return typing.cast(
|
|
685
|
-
typing.List[
|
|
686
|
-
|
|
687
|
-
type_=typing.List[
|
|
1209
|
+
typing.List[LseUserApi],
|
|
1210
|
+
construct_type(
|
|
1211
|
+
type_=typing.List[LseUserApi], # type: ignore
|
|
688
1212
|
object_=_response.json(),
|
|
689
1213
|
),
|
|
690
1214
|
)
|
|
@@ -706,9 +1230,8 @@ class AsyncUsersClient:
|
|
|
706
1230
|
phone: typing.Optional[str] = OMIT,
|
|
707
1231
|
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
708
1232
|
request_options: typing.Optional[RequestOptions] = None,
|
|
709
|
-
) ->
|
|
1233
|
+
) -> LseUser:
|
|
710
1234
|
"""
|
|
711
|
-
|
|
712
1235
|
Create a user in Label Studio.
|
|
713
1236
|
|
|
714
1237
|
Parameters
|
|
@@ -745,7 +1268,7 @@ class AsyncUsersClient:
|
|
|
745
1268
|
|
|
746
1269
|
Returns
|
|
747
1270
|
-------
|
|
748
|
-
|
|
1271
|
+
LseUser
|
|
749
1272
|
|
|
750
1273
|
|
|
751
1274
|
Examples
|
|
@@ -788,9 +1311,9 @@ class AsyncUsersClient:
|
|
|
788
1311
|
try:
|
|
789
1312
|
if 200 <= _response.status_code < 300:
|
|
790
1313
|
return typing.cast(
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
type_=
|
|
1314
|
+
LseUser,
|
|
1315
|
+
construct_type(
|
|
1316
|
+
type_=LseUser, # type: ignore
|
|
794
1317
|
object_=_response.json(),
|
|
795
1318
|
),
|
|
796
1319
|
)
|
|
@@ -799,11 +1322,9 @@ class AsyncUsersClient:
|
|
|
799
1322
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
800
1323
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
801
1324
|
|
|
802
|
-
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) ->
|
|
1325
|
+
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
|
|
803
1326
|
"""
|
|
804
|
-
|
|
805
|
-
Get info about a specific Label Studio user.
|
|
806
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
1327
|
+
Get info about a specific Label Studio user, based on the user ID.
|
|
807
1328
|
|
|
808
1329
|
Parameters
|
|
809
1330
|
----------
|
|
@@ -815,7 +1336,7 @@ class AsyncUsersClient:
|
|
|
815
1336
|
|
|
816
1337
|
Returns
|
|
817
1338
|
-------
|
|
818
|
-
|
|
1339
|
+
LseUser
|
|
819
1340
|
|
|
820
1341
|
|
|
821
1342
|
Examples
|
|
@@ -845,9 +1366,9 @@ class AsyncUsersClient:
|
|
|
845
1366
|
try:
|
|
846
1367
|
if 200 <= _response.status_code < 300:
|
|
847
1368
|
return typing.cast(
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
type_=
|
|
1369
|
+
LseUser,
|
|
1370
|
+
construct_type(
|
|
1371
|
+
type_=LseUser, # type: ignore
|
|
851
1372
|
object_=_response.json(),
|
|
852
1373
|
),
|
|
853
1374
|
)
|
|
@@ -858,10 +1379,7 @@ class AsyncUsersClient:
|
|
|
858
1379
|
|
|
859
1380
|
async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
860
1381
|
"""
|
|
861
|
-
|
|
862
|
-
Delete a specific Label Studio user.
|
|
863
|
-
|
|
864
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
1382
|
+
Delete a specific Label Studio user. Only available in community edition.
|
|
865
1383
|
|
|
866
1384
|
<Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>
|
|
867
1385
|
|
|
@@ -923,12 +1441,11 @@ class AsyncUsersClient:
|
|
|
923
1441
|
phone: typing.Optional[str] = OMIT,
|
|
924
1442
|
allow_newsletters: typing.Optional[bool] = OMIT,
|
|
925
1443
|
request_options: typing.Optional[RequestOptions] = None,
|
|
926
|
-
) ->
|
|
1444
|
+
) -> LseUser:
|
|
927
1445
|
"""
|
|
928
1446
|
|
|
929
|
-
|
|
1447
|
+
Update details for a specific user, such as their name or contact information, in Label Studio.
|
|
930
1448
|
|
|
931
|
-
You will need to provide their user ID. You can find a list of all user IDs using [List users](list).
|
|
932
1449
|
|
|
933
1450
|
Parameters
|
|
934
1451
|
----------
|
|
@@ -967,7 +1484,7 @@ class AsyncUsersClient:
|
|
|
967
1484
|
|
|
968
1485
|
Returns
|
|
969
1486
|
-------
|
|
970
|
-
|
|
1487
|
+
LseUser
|
|
971
1488
|
|
|
972
1489
|
|
|
973
1490
|
Examples
|
|
@@ -1012,9 +1529,9 @@ class AsyncUsersClient:
|
|
|
1012
1529
|
try:
|
|
1013
1530
|
if 200 <= _response.status_code < 300:
|
|
1014
1531
|
return typing.cast(
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
type_=
|
|
1532
|
+
LseUser,
|
|
1533
|
+
construct_type(
|
|
1534
|
+
type_=LseUser, # type: ignore
|
|
1018
1535
|
object_=_response.json(),
|
|
1019
1536
|
),
|
|
1020
1537
|
)
|