From 52549f8d5728a9041ba294feed63b1926e0e003b Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 00:56:19 +0000 Subject: [PATCH 1/2] SDK regeneration --- .mock/definition/__package__.yml | 355 +++---- .mock/definition/billing.yml | 244 ----- .mock/definition/organizations.yml | 236 +++++ .mock/definition/organizations/members.yml | 168 ---- .mock/definition/projectTemplates.yml | 2 +- .mock/definition/projects.yml | 132 ++- .mock/definition/prompts.yml | 128 +-- .mock/openapi/openapi.yaml | 869 +++++------------- reference.md | 286 ------ src/label_studio_sdk/__init__.py | 20 - src/label_studio_sdk/base_client.py | 4 - src/label_studio_sdk/billing/__init__.py | 2 - src/label_studio_sdk/billing/client.py | 112 --- .../organizations/members/client.py | 350 +------ src/label_studio_sdk/projects/client.py | 12 - src/label_studio_sdk/types/__init__.py | 18 - .../types/all_roles_project_list.py | 183 ++-- src/label_studio_sdk/types/billing_checks.py | 39 - src/label_studio_sdk/types/billing_flags.py | 44 - .../types/billing_info_response.py | 22 - src/label_studio_sdk/types/count_limit.py | 22 - .../types/lse_organization_member_list.py | 32 - .../lse_user_organization_member_list.py | 48 - ...nated_lse_organization_member_list_list.py | 23 - .../types/prompts_status_enum.py | 16 - src/label_studio_sdk/types/role9e7enum.py | 5 - tests/organizations/test_members.py | 149 --- tests/test_billing.py | 114 --- tests/test_prompts.py | 236 ++--- 29 files changed, 941 insertions(+), 2930 deletions(-) delete mode 100644 .mock/definition/billing.yml delete mode 100644 src/label_studio_sdk/billing/__init__.py delete mode 100644 src/label_studio_sdk/billing/client.py delete mode 100644 src/label_studio_sdk/types/billing_checks.py delete mode 100644 src/label_studio_sdk/types/billing_flags.py delete mode 100644 src/label_studio_sdk/types/billing_info_response.py delete mode 100644 src/label_studio_sdk/types/count_limit.py delete mode 100644 src/label_studio_sdk/types/lse_organization_member_list.py delete mode 100644 src/label_studio_sdk/types/lse_user_organization_member_list.py delete mode 100644 src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py delete mode 100644 src/label_studio_sdk/types/prompts_status_enum.py delete mode 100644 src/label_studio_sdk/types/role9e7enum.py delete mode 100644 tests/test_billing.py diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 92646c18f..e4b7f6501 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -166,18 +166,18 @@ types: recordsFiltered: integer source: openapi: openapi/openapi.yaml - AllRolesProjectListSampling: + AllRolesProjectListSkipQueue: discriminated: false union: - - SamplingEnum + - SkipQueueEnum - NullEnum source: openapi: openapi/openapi.yaml inline: true - AllRolesProjectListSkipQueue: + AllRolesProjectListSampling: discriminated: false union: - - SkipQueueEnum + - SamplingEnum - NullEnum source: openapi: openapi/openapi.yaml @@ -187,64 +187,100 @@ types: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: - control_weights: optional - start_training_on_annotation_update: - type: boolean - docs: Start model training after any annotations are submitted or updated - id: integer - ground_truth_number: - type: integer - docs: Honeypot annotation number in project - config_has_control_tags: - type: boolean - docs: Flag to detect is project ready for labeling + reveal_preannotations_interactively: + type: optional + docs: Reveal pre-annotations interactively + organization: optional annotation_limit_percent: type: optional validation: pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + color: + type: optional + validation: + maxLength: 16 + show_ground_truth_first: optional + overlap_cohort_percentage: + type: optional + validation: + min: -2147483648 + max: 2147483647 + custom_script: optional + reviewer_queue_total: string + members_count: string + custom_task_lock_ttl: + type: optional + docs: TTL in seconds for task reservations, on new and existing tasks + validation: + min: 1 + max: 86400 + annotator_evaluation_minimum_tasks: + type: optional + default: 10 + validation: + min: 0 + members: string + finished_task_number: integer + pinned_at: + type: optional + docs: Pinned date and time duplication_done: type: optional default: false - finished_task_number: integer - members: string - total_annotations_number: string - members_count: integer - enable_empty_annotation: - type: optional - docs: Allow annotators to submit empty annotations + num_tasks_with_annotations: string config_suitable_for_bulk_annotation: type: boolean docs: Flag to detect is project ready for bulk annotation - task_number: - type: integer - docs: Total task number in project - workspace_title: string - total_predictions_number: integer - is_published: - type: optional - docs: Whether or not the project is published to annotators - is_draft: + created_at: datetime + pause_on_failed_annotator_evaluation: type: optional - docs: Whether or not the project is in the middle of being created - description: + default: false + reviewed_number: string + label_config: type: optional - docs: Project description - rejected: string - custom_script: optional - workspace: string - show_ground_truth_first: optional - expert_instruction: + docs: Label config in XML format. See more about it in documentation + skip_queue: optional + skipped_annotations_number: string + annotator_evaluation_minimum_score: type: optional - docs: Labeling instructions in HTML format + default: '95.00' + validation: + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + title: + type: optional + docs: Project name. Must be between 3 and 50 characters long. + validation: + minLength: 3 + maxLength: 50 + useful_annotation_number: string + total_annotations_number: string allow_stream: string - reviewer_queue_total: string - created_at: datetime - annotator_evaluation_minimum_tasks: + sampling: optional + annotation_limit_count: type: optional - default: 10 validation: - min: 0 - review_total_tasks: string + min: 1 + control_weights: optional + ground_truth_number: + type: integer + docs: Honeypot annotation number in project + expert_instruction: + type: optional + docs: Labeling instructions in HTML format + parsed_label_config: unknown + ready: string + comment_classification_config: optional + description_short: string + config_has_control_tags: + type: boolean + docs: Flag to detect is project ready for labeling + model_version: + type: optional + docs: Machine learning model version + is_published: + type: optional + docs: Whether or not the project is published to annotators + rejected: string min_annotations_to_start_training: type: optional docs: >- @@ -253,12 +289,26 @@ types: validation: min: -2147483648 max: 2147483647 - label_config: + description: type: optional - docs: Label config in XML format. See more about it in documentation - created_by: - type: optional - docs: Project owner + docs: Project description + queue_left: string + total_predictions_number: integer + duplication_status: optional + show_collab_predictions: + type: optional + docs: If set, the annotator can view model predictions + show_annotation_history: + type: optional + docs: Show annotation history to annotator + id: integer + assignment_settings: AssignmentSettings + workspace_title: string + has_blueprints: string + workspace: string + show_instruction: + type: optional + docs: Show instructions to the annotator before they start maximum_annotations: type: optional docs: >- @@ -268,88 +318,38 @@ types: validation: min: -2147483648 max: 2147483647 - evaluate_predictions_automatically: - type: optional - docs: Retrieve and display predictions when loading a task - annotator_evaluation_minimum_score: - type: optional - default: '95.00' - validation: - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - model_version: - type: optional - docs: Machine learning model version - useful_annotation_number: string - has_blueprints: string - pause_on_failed_annotator_evaluation: + require_comment_on_skip: type: optional default: false - show_instruction: - type: optional - docs: Show instructions to the annotator before they start - queue_left: string - custom_task_lock_ttl: - type: optional - docs: TTL in seconds for task reservations, on new and existing tasks - validation: - min: 1 - max: 86400 - pinned_at: - type: optional - docs: Pinned date and time - ready: string - description_short: string + review_total_tasks: string + created_by: + type: optional + docs: Project owner + queue_done: string + task_number: + type: integer + docs: Total task number in project + blueprints: list show_overlap_first: optional - reveal_preannotations_interactively: + queue_total: string + evaluate_predictions_automatically: type: optional - docs: Reveal pre-annotations interactively - comment_classification_config: optional + docs: Retrieve and display predictions when loading a task + prompts: string + review_settings: ReviewSettings show_skip_button: type: optional docs: Show a skip button in interface and allow annotators to skip the task data_types: unknown - organization: optional - show_collab_predictions: - type: optional - docs: If set, the annotator can view model predictions - reviewed_number: string - prompts: string - overlap_cohort_percentage: - type: optional - validation: - min: -2147483648 - max: 2147483647 - duplication_status: optional - skipped_annotations_number: string - blueprints: list - sampling: optional - color: - type: optional - validation: - maxLength: 16 - title: - type: optional - docs: Project name. Must be between 3 and 50 characters long. - validation: - minLength: 3 - maxLength: 50 - skip_queue: optional - review_settings: ReviewSettings - num_tasks_with_annotations: string - assignment_settings: AssignmentSettings - require_comment_on_skip: + enable_empty_annotation: type: optional - default: false - annotation_limit_count: - type: optional - validation: - min: 1 - queue_done: string - show_annotation_history: + docs: Allow annotators to submit empty annotations + is_draft: type: optional - docs: Show annotation history to annotator - queue_total: string - parsed_label_config: unknown + docs: Whether or not the project is in the middle of being created + start_training_on_annotation_update: + type: boolean + docs: Start model training after any annotations are submitted or updated source: openapi: openapi/openapi.yaml AnnotatedEnum: @@ -1363,73 +1363,6 @@ types: results: list source: openapi: openapi/openapi.yaml - BillingChecks: - properties: - users: CountLimit - projects: CountLimit - results: CountLimit - trial_days: integer - organization_is_active: boolean - license_issued: - type: optional - validation: - format: date - license_warning: - type: optional - validation: - format: date - is_license_warning: boolean - license_expires: - type: optional - validation: - format: date - is_license_expired: boolean - prompts_enabled: boolean - prompts_status: PromptsStatusEnum - prompts_warning: optional - is_prompts_warning: boolean - prompts_expire: optional - is_prompts_expire: boolean - prompts_api_keys_enabled: boolean - import_storages: CountLimit - export_storages: CountLimit - source: - openapi: openapi/openapi.yaml - BillingFlags: - properties: - activated_at: optional - cloud_instance: boolean - allow_activity_log: boolean - allow_invite_project_experts: boolean - allow_sso: boolean - white_label_id: optional - allow_data_credentials: boolean - allow_organization_webhooks: boolean - disable_members_page: boolean - secure_mode: boolean - manual_workspace_management: boolean - manual_role_management: boolean - hide_storage_settings_for_manager: boolean - disable_project_imports: boolean - automax_token_exists: boolean - automax_enabled: boolean - storage_persistence: boolean - allow_ai: boolean - early_adopter: boolean - allow_ask_ai: boolean - allow_invite_people: boolean - allow_storage_proxy: boolean - embed_enabled: boolean - embed_domains: optional>> - embed_settings: optional> - source: - openapi: openapi/openapi.yaml - BillingInfoResponse: - properties: - billing_checks: BillingChecks - billing_flags: BillingFlags - source: - openapi: openapi/openapi.yaml BlankEnum: literal<""> Blueprint: properties: @@ -1640,14 +1573,6 @@ types: docs: Traceback report in case of errors source: openapi: openapi/openapi.yaml - CountLimit: - properties: - count: integer - limit: integer - reached: boolean - total: optional - source: - openapi: openapi/openapi.yaml CustomScriptsEditableByEnum: enum: - AD @@ -3465,7 +3390,7 @@ types: data_types: unknown reviewer_queue_total: string queue_left: string - members_count: integer + members_count: string custom_task_lock_ttl: type: optional docs: TTL in seconds for task reservations, on new and existing tasks @@ -5953,38 +5878,6 @@ types: organization: optional source: openapi: openapi/openapi.yaml - PromptsStatusEnum: - enum: - - Enabled - - value: Cloud license per organization disabled - name: CloudLicensePerOrganizationDisabled - - value: On-premise global license disabled - name: OnPremiseGlobalLicenseDisabled - - Expired - - value: Adala not connected - name: AdalaNotConnected - - value: Disabled for this organization [FF] - name: DisabledForThisOrganizationFf - - unknown - docs: >- - * `Enabled` - Enabled - - * `Cloud license per organization disabled` - Cloud license per - organization disabled - - * `On-premise global license disabled` - On-premise global license - disabled - - * `Expired` - Expired - - * `Adala not connected` - Adala not connected - - * `Disabled for this organization [FF]` - Disabled for this organization - [FF] - - * `unknown` - unknown - source: - openapi: openapi/openapi.yaml ProviderEnum: enum: - OpenAI diff --git a/.mock/definition/billing.yml b/.mock/definition/billing.yml deleted file mode 100644 index 8f39d6a46..000000000 --- a/.mock/definition/billing.yml +++ /dev/null @@ -1,244 +0,0 @@ -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - info: - path: /api/billing/info - method: GET - auth: true - docs: Retrieve billing checks and feature flags for the active organization. - source: - openapi: openapi/openapi.yaml - display-name: Get billing info - response: - docs: Billing information for the active organization - type: root.BillingInfoResponse - examples: - - name: real-sample - response: - body: - billing_checks: - users: - count: 110 - limit: 1000 - reached: false - total: 221 - projects: - count: 2044 - limit: 1000000 - reached: false - total: 1 - results: - count: 42949 - limit: 1000000000 - reached: false - total: 1 - trial_days: 0 - organization_is_active: true - license_issued: '2000-01-01' - license_warning: '2030-01-01' - is_license_warning: false - license_expires: '2030-01-02' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: prompts_warning - is_prompts_warning: false - prompts_expire: prompts_expire - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - total: 1 - export_storages: - count: 0 - limit: 0 - reached: false - total: 1 - billing_flags: - activated_at: '2024-01-15T09:30:00Z' - cloud_instance: true - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: true - white_label_id: white_label_id - allow_data_credentials: false - allow_organization_webhooks: false - disable_members_page: false - secure_mode: false - manual_workspace_management: true - manual_role_management: true - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: true - automax_enabled: true - storage_persistence: true - allow_ai: true - early_adopter: true - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: true - embed_domains: - - domain: http://localhost:3000 - - domain: https://purple-zoos-flash.loca.lt - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: .... - - name: cloud - response: - body: - billing_checks: - users: - count: 5 - limit: 10 - reached: false - total: 6 - projects: - count: 3 - limit: 50 - reached: false - total: 1 - results: - count: 100 - limit: 1000 - reached: false - total: 1 - trial_days: 14 - organization_is_active: true - license_issued: '2023-01-01' - license_warning: '2024-12-01' - is_license_warning: false - license_expires: '2025-01-01' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: prompts_warning - is_prompts_warning: false - prompts_expire: '2024-12-31' - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - total: 1 - export_storages: - count: 0 - limit: 0 - reached: false - total: 1 - billing_flags: - activated_at: '2023-01-01T00:00:00Z' - cloud_instance: true - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: false - white_label_id: white_label_id - allow_data_credentials: true - allow_organization_webhooks: true - disable_members_page: false - secure_mode: false - manual_workspace_management: false - manual_role_management: false - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: false - automax_enabled: true - storage_persistence: true - allow_ai: true - early_adopter: false - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: false - embed_domains: - - domain: http://localhost:3000 - - domain: https://example.com - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: .... - - name: enterprise - response: - body: - billing_checks: - users: - count: 20 - limit: 100 - reached: false - total: 22 - projects: - count: 15 - limit: 200 - reached: false - total: 1 - results: - count: 25000 - limit: 100000 - reached: false - total: 1 - trial_days: 0 - organization_is_active: true - license_issued: '2023-01-01' - license_warning: '2024-12-01' - is_license_warning: false - license_expires: '2025-01-01' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: prompts_warning - is_prompts_warning: false - prompts_expire: prompts_expire - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - total: 1 - export_storages: - count: 0 - limit: 0 - reached: false - total: 1 - billing_flags: - activated_at: '2024-01-15T09:30:00Z' - cloud_instance: false - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: true - white_label_id: wl-1 - allow_data_credentials: true - allow_organization_webhooks: true - disable_members_page: false - secure_mode: false - manual_workspace_management: false - manual_role_management: false - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: true - automax_enabled: true - storage_persistence: true - allow_ai: false - early_adopter: true - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: false - embed_domains: - - domain: http://localhost:3000 - - domain: https://example.com - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: .... - audiences: - - public - source: - openapi: openapi/openapi.yaml diff --git a/.mock/definition/organizations.yml b/.mock/definition/organizations.yml index 80d05e163..9b27c1d91 100644 --- a/.mock/definition/organizations.yml +++ b/.mock/definition/organizations.yml @@ -157,6 +157,242 @@ service: custom_scripts_enabled: custom_scripts_enabled custom_scripts_editable_by: AD email_notification_settings: email_notification_settings + api_organizations_memberships_list: + path: /api/organizations/{id}/memberships + method: GET + auth: true + docs: Retrieve a list of all users and roles in a specific organization. + source: + openapi: openapi/openapi.yaml + path-parameters: + id: + type: integer + docs: A unique integer value identifying this organization. + display-name: Get organization members/roles + request: + name: ApiOrganizationsMembershipsListRequest + query-parameters: + exclude_project_id: + type: optional + docs: >- + Project ID to exclude users who are already associated with this + project (direct members, workspace members, or implicit + admin/owner access). + exclude_workspace_id: + type: optional + docs: >- + Workspace ID to exclude users who are already associated with this + workspace (direct workspace members or implicit admin/owner + access). + ordering: + type: optional + docs: Which field to use when ordering the results. + page: + type: optional + docs: A page number within the paginated result set. + page_size: + type: optional + docs: Number of results to return per page. + search: + type: optional + docs: A search term. + response: + docs: '' + type: root.PaginatedLseOrganizationMemberListList + examples: + - path-parameters: + id: 1 + response: + body: + count: 123 + next: http://api.example.org/accounts/?page=4 + previous: http://api.example.org/accounts/?page=2 + results: + - id: 1 + organization: 1 + user: + id: 1 + username: username + last_activity: '2024-01-15T09:30:00Z' + avatar: avatar + initials: initials + lse_fields: + invite_expired: invite_expired + invite_expired_at: invite_expired_at + email_notification_settings: email_notification_settings + pause: pause + created_projects: created_projects + contributed_to_projects: contributed_to_projects + role: role + api_organizations_memberships_create: + path: /api/organizations/{id}/memberships + method: POST + auth: true + docs: |2- + + Assign a role to a user in an organization. To do so, make the following cURL request: + + ```bash + curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \ + -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships' --data '[{{"user_id": Int, "role": "NO|DI|OW|AD|MA|AN|RE" }}]' + ``` + + Enumerate a role with one of the following abbreviations: + + | Role | Full Role Name | + | --- | --- | + | NO | Not Activated | + | DI | Deactivated | + | OW | Owner | + | AD | Administrator | + | MA | Manager | + | AN | Annotator | + | RE | Reviewer | + + For example, to set a user with an ID of 9 as an annotator, make the following cURL request: + ```bash + curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \ + -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships' --data '[{{"user_id": 9, "role": "AN" }}]' + ``` + + source: + openapi: openapi/openapi.yaml + path-parameters: + id: + type: integer + docs: A unique integer value identifying this organization. + display-name: Create organization member/role + request: + name: OrganizationMemberCreateUpdateRequest + body: + properties: + user_id: integer + role: root.Role9E7Enum + content-type: application/json + response: + docs: '' + type: root.LseOrganizationMemberList + examples: + - path-parameters: + id: 1 + request: + user_id: 1 + role: OW + response: + body: + id: 1 + organization: 1 + user: + id: 1 + first_name: first_name + last_name: last_name + username: username + email: email + last_activity: '2024-01-15T09:30:00Z' + custom_hotkeys: + key: value + avatar: avatar + initials: initials + phone: phone + active_organization: 1 + allow_newsletters: true + date_joined: '2024-01-15T09:30:00Z' + lse_fields: + invite_expired: invite_expired + invite_expired_at: invite_expired_at + invited_at: '2024-01-15T09:30:00Z' + invite_activated: true + trial_company: trial_company + trial_role: annotator + trial_models_in_production: trial_models_in_production + trial_experience_labeling: trial_experience_labeling + trial_license_enterprise: true + social_auth_finished: true + invited_by: 1 + onboarding_state: not_started + email_notification_settings: email_notification_settings + pause: pause + created_projects: created_projects + contributed_to_projects: contributed_to_projects + role: role + api_organizations_memberships_partial_update: + path: /api/organizations/{id}/memberships + method: PATCH + auth: true + docs: |2- + + Update organization membership or role for a specific user ID. + + **User Rotation Best Practices for API Usage** + + To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: + + * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. + + * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. + + * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. + + * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. + + source: + openapi: openapi/openapi.yaml + path-parameters: + id: + type: integer + docs: A unique integer value identifying this organization. + display-name: Update organization member/role + request: + name: PatchedOrganizationMemberCreateUpdateRequest + body: + properties: + user_id: optional + role: optional + content-type: application/json + response: + docs: '' + type: root.LseOrganizationMemberList + examples: + - path-parameters: + id: 1 + request: {} + response: + body: + id: 1 + organization: 1 + user: + id: 1 + first_name: first_name + last_name: last_name + username: username + email: email + last_activity: '2024-01-15T09:30:00Z' + custom_hotkeys: + key: value + avatar: avatar + initials: initials + phone: phone + active_organization: 1 + allow_newsletters: true + date_joined: '2024-01-15T09:30:00Z' + lse_fields: + invite_expired: invite_expired + invite_expired_at: invite_expired_at + invited_at: '2024-01-15T09:30:00Z' + invite_activated: true + trial_company: trial_company + trial_role: annotator + trial_models_in_production: trial_models_in_production + trial_experience_labeling: trial_experience_labeling + trial_license_enterprise: true + social_auth_finished: true + invited_by: 1 + onboarding_state: not_started + email_notification_settings: email_notification_settings + pause: pause + created_projects: created_projects + contributed_to_projects: contributed_to_projects + role: role api_organizations_set_default_role_partial_update: path: /api/organizations/{id}/set-default-role method: PATCH diff --git a/.mock/definition/organizations/members.yml b/.mock/definition/organizations/members.yml index 3bfec0a23..ba50350df 100644 --- a/.mock/definition/organizations/members.yml +++ b/.mock/definition/organizations/members.yml @@ -4,174 +4,6 @@ service: auth: false base-path: '' endpoints: - list: - path: /api/organizations/{id}/memberships - method: GET - auth: true - docs: Retrieve a list of all users and roles in a specific organization. - source: - openapi: openapi/openapi.yaml - path-parameters: - id: - type: integer - docs: A unique integer value identifying this organization. - display-name: Get organization members/roles - request: - name: MembersListRequest - query-parameters: - exclude_project_id: - type: optional - docs: >- - Project ID to exclude users who are already associated with this - project (direct members, workspace members, or implicit - admin/owner access). - exclude_workspace_id: - type: optional - docs: >- - Workspace ID to exclude users who are already associated with this - workspace (direct workspace members or implicit admin/owner - access). - ordering: - type: optional - docs: Which field to use when ordering the results. - page: - type: optional - docs: A page number within the paginated result set. - page_size: - type: optional - docs: Number of results to return per page. - search: - type: optional - docs: A search term. - response: - docs: '' - type: root.PaginatedLseOrganizationMemberListList - examples: - - path-parameters: - id: 1 - response: - body: - count: 123 - next: http://api.example.org/accounts/?page=4 - previous: http://api.example.org/accounts/?page=2 - results: - - id: 1 - organization: 1 - user: - id: 1 - username: username - last_activity: '2024-01-15T09:30:00Z' - avatar: avatar - initials: initials - lse_fields: - invite_expired: invite_expired - invite_expired_at: invite_expired_at - email_notification_settings: email_notification_settings - pause: pause - created_projects: created_projects - contributed_to_projects: contributed_to_projects - role: role - audiences: - - public - update: - path: /api/organizations/{id}/memberships - method: PATCH - auth: true - docs: >+ - Update organization membership or role for a specific user ID. - - - **User Rotation Best Practices for API Usage** - - - To maintain compliance with our licensing terms and ensure optimal - performance of HumanSignal's APIs, please consider the following - guidelines when managing user assignments: - - - * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is - assigned to a user, maintain that assignment for at least seven - consecutive days before rotating it to another user. - - - * **Automate, Monitor, and Log Rotations**: Implement automated - scheduling and logging mechanisms to track the timing of user rotations. - This helps ensure that rotations adhere to the seven-day minimum period. - - - * **Adhere to API Update Frequency and Wait Periods**: When updating - user assignments via our APIs, follow the recommended frequency and wait - period guidelines provided in the HumanSignal API documentation. Avoid - sending rapid, successive requests that might overload the endpoint. - Instead, incorporate appropriate delays between calls as specified in - the documentation. - - - * **Avoid Overloading the API Endpoint**: Design your integration to - batch or schedule updates where possible, and implement backoff - strategies if the API indicates rate limiting. This helps prevent - service disruptions and ensures a smooth operation. - - source: - openapi: openapi/openapi.yaml - path-parameters: - id: - type: integer - docs: A unique integer value identifying this organization. - display-name: Update organization member/role - request: - name: PatchedOrganizationMemberCreateUpdateRequest - body: - properties: - user_id: optional - role: optional - content-type: application/json - response: - docs: '' - type: root.LseOrganizationMemberList - examples: - - path-parameters: - id: 1 - request: {} - response: - body: - id: 1 - organization: 1 - user: - id: 1 - first_name: first_name - last_name: last_name - username: username - email: email - last_activity: '2024-01-15T09:30:00Z' - custom_hotkeys: - key: value - avatar: avatar - initials: initials - phone: phone - active_organization: 1 - allow_newsletters: true - date_joined: '2024-01-15T09:30:00Z' - lse_fields: - invite_expired: invite_expired - invite_expired_at: invite_expired_at - invited_at: '2024-01-15T09:30:00Z' - invite_activated: true - trial_company: trial_company - trial_role: annotator - trial_models_in_production: trial_models_in_production - trial_experience_labeling: trial_experience_labeling - trial_license_enterprise: true - social_auth_finished: true - invited_by: 1 - onboarding_state: not_started - email_notification_settings: email_notification_settings - pause: pause - created_projects: created_projects - contributed_to_projects: contributed_to_projects - role: role - audiences: - - public get: path: /api/organizations/{id}/memberships/{user_pk}/ method: GET diff --git a/.mock/definition/projectTemplates.yml b/.mock/definition/projectTemplates.yml index 2154b4775..0c08df9f8 100644 --- a/.mock/definition/projectTemplates.yml +++ b/.mock/definition/projectTemplates.yml @@ -350,7 +350,7 @@ service: key: value reviewer_queue_total: reviewer_queue_total queue_left: queue_left - members_count: 1 + members_count: members_count custom_task_lock_ttl: 1 prompts: prompts annotation_limit_count: 1 diff --git a/.mock/definition/projects.yml b/.mock/definition/projects.yml index da61a7042..c7057d197 100644 --- a/.mock/definition/projects.yml +++ b/.mock/definition/projects.yml @@ -135,10 +135,6 @@ service: useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. - members_limit: - type: optional - default: 10 - docs: Maximum number of members to return. ordering: type: optional docs: Which field to use when ordering the results. @@ -164,89 +160,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - control_weights: - key: value - start_training_on_annotation_update: true - id: 1 - ground_truth_number: 1 - config_has_control_tags: true + - reveal_preannotations_interactively: true + organization: 1 annotation_limit_percent: annotation_limit_percent - duplication_done: true - finished_task_number: 1 - members: members - total_annotations_number: total_annotations_number - members_count: 1 - enable_empty_annotation: true - config_suitable_for_bulk_annotation: true - task_number: 1 - workspace_title: workspace_title - total_predictions_number: 1 - is_published: true - is_draft: true - description: description - rejected: rejected - custom_script: custom_script - workspace: workspace + color: color show_ground_truth_first: true - expert_instruction: expert_instruction - allow_stream: allow_stream + overlap_cohort_percentage: 1 + custom_script: custom_script reviewer_queue_total: reviewer_queue_total - created_at: '2024-01-15T09:30:00Z' + members_count: members_count + custom_task_lock_ttl: 1 annotator_evaluation_minimum_tasks: 1 - review_total_tasks: review_total_tasks - min_annotations_to_start_training: 1 + members: members + finished_task_number: 1 + pinned_at: '2024-01-15T09:30:00Z' + duplication_done: true + num_tasks_with_annotations: num_tasks_with_annotations + config_suitable_for_bulk_annotation: true + created_at: '2024-01-15T09:30:00Z' + pause_on_failed_annotator_evaluation: true + reviewed_number: reviewed_number label_config: label_config - created_by: - id: 1 - avatar: avatar - maximum_annotations: 1 - evaluate_predictions_automatically: true + skip_queue: REQUEUE_FOR_ME + skipped_annotations_number: skipped_annotations_number annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - model_version: model_version + title: title useful_annotation_number: useful_annotation_number - has_blueprints: has_blueprints - pause_on_failed_annotator_evaluation: true - show_instruction: true - queue_left: queue_left - custom_task_lock_ttl: 1 - pinned_at: '2024-01-15T09:30:00Z' + total_annotations_number: total_annotations_number + allow_stream: allow_stream + sampling: Sequential sampling + annotation_limit_count: 1 + control_weights: + key: value + ground_truth_number: 1 + expert_instruction: expert_instruction + parsed_label_config: + key: value ready: ready - description_short: description_short - show_overlap_first: true - reveal_preannotations_interactively: true comment_classification_config: comment_classification_config - show_skip_button: true - data_types: - key: value - organization: 1 - show_collab_predictions: true - reviewed_number: reviewed_number - prompts: prompts - overlap_cohort_percentage: 1 + description_short: description_short + config_has_control_tags: true + model_version: model_version + is_published: true + rejected: rejected + min_annotations_to_start_training: 1 + description: description + queue_left: queue_left + total_predictions_number: 1 duplication_status: duplication_status - skipped_annotations_number: skipped_annotations_number + show_collab_predictions: true + show_annotation_history: true + id: 1 + assignment_settings: + id: 1 + workspace_title: workspace_title + has_blueprints: has_blueprints + workspace: workspace + show_instruction: true + maximum_annotations: 1 + require_comment_on_skip: true + review_total_tasks: review_total_tasks + created_by: + id: 1 + avatar: avatar + queue_done: queue_done + task_number: 1 blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' - sampling: Sequential sampling - color: color - title: title - skip_queue: REQUEUE_FOR_ME + show_overlap_first: true + queue_total: queue_total + evaluate_predictions_automatically: true + prompts: prompts review_settings: id: 1 requeue_rejected_tasks_to_annotator: true - num_tasks_with_annotations: num_tasks_with_annotations - assignment_settings: - id: 1 - require_comment_on_skip: true - annotation_limit_count: 1 - queue_done: queue_done - show_annotation_history: true - queue_total: queue_total - parsed_label_config: + show_skip_button: true + data_types: key: value + enable_empty_annotation: true + is_draft: true + start_training_on_annotation_update: true audiences: - public create: diff --git a/.mock/definition/prompts.yml b/.mock/definition/prompts.yml index 7bbcddeea..a956b67c2 100644 --- a/.mock/definition/prompts.yml +++ b/.mock/definition/prompts.yml @@ -424,89 +424,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - control_weights: - key: value - start_training_on_annotation_update: true - id: 1 - ground_truth_number: 1 - config_has_control_tags: true + - reveal_preannotations_interactively: true + organization: 1 annotation_limit_percent: annotation_limit_percent - duplication_done: true - finished_task_number: 1 - members: members - total_annotations_number: total_annotations_number - members_count: 1 - enable_empty_annotation: true - config_suitable_for_bulk_annotation: true - task_number: 1 - workspace_title: workspace_title - total_predictions_number: 1 - is_published: true - is_draft: true - description: description - rejected: rejected - custom_script: custom_script - workspace: workspace + color: color show_ground_truth_first: true - expert_instruction: expert_instruction - allow_stream: allow_stream + overlap_cohort_percentage: 1 + custom_script: custom_script reviewer_queue_total: reviewer_queue_total - created_at: '2024-01-15T09:30:00Z' + members_count: members_count + custom_task_lock_ttl: 1 annotator_evaluation_minimum_tasks: 1 - review_total_tasks: review_total_tasks - min_annotations_to_start_training: 1 + members: members + finished_task_number: 1 + pinned_at: '2024-01-15T09:30:00Z' + duplication_done: true + num_tasks_with_annotations: num_tasks_with_annotations + config_suitable_for_bulk_annotation: true + created_at: '2024-01-15T09:30:00Z' + pause_on_failed_annotator_evaluation: true + reviewed_number: reviewed_number label_config: label_config - created_by: - id: 1 - avatar: avatar - maximum_annotations: 1 - evaluate_predictions_automatically: true + skip_queue: REQUEUE_FOR_ME + skipped_annotations_number: skipped_annotations_number annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - model_version: model_version + title: title useful_annotation_number: useful_annotation_number - has_blueprints: has_blueprints - pause_on_failed_annotator_evaluation: true - show_instruction: true - queue_left: queue_left - custom_task_lock_ttl: 1 - pinned_at: '2024-01-15T09:30:00Z' + total_annotations_number: total_annotations_number + allow_stream: allow_stream + sampling: Sequential sampling + annotation_limit_count: 1 + control_weights: + key: value + ground_truth_number: 1 + expert_instruction: expert_instruction + parsed_label_config: + key: value ready: ready - description_short: description_short - show_overlap_first: true - reveal_preannotations_interactively: true comment_classification_config: comment_classification_config - show_skip_button: true - data_types: - key: value - organization: 1 - show_collab_predictions: true - reviewed_number: reviewed_number - prompts: prompts - overlap_cohort_percentage: 1 + description_short: description_short + config_has_control_tags: true + model_version: model_version + is_published: true + rejected: rejected + min_annotations_to_start_training: 1 + description: description + queue_left: queue_left + total_predictions_number: 1 duplication_status: duplication_status - skipped_annotations_number: skipped_annotations_number + show_collab_predictions: true + show_annotation_history: true + id: 1 + assignment_settings: + id: 1 + workspace_title: workspace_title + has_blueprints: has_blueprints + workspace: workspace + show_instruction: true + maximum_annotations: 1 + require_comment_on_skip: true + review_total_tasks: review_total_tasks + created_by: + id: 1 + avatar: avatar + queue_done: queue_done + task_number: 1 blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' - sampling: Sequential sampling - color: color - title: title - skip_queue: REQUEUE_FOR_ME + show_overlap_first: true + queue_total: queue_total + evaluate_predictions_automatically: true + prompts: prompts review_settings: id: 1 requeue_rejected_tasks_to_annotator: true - num_tasks_with_annotations: num_tasks_with_annotations - assignment_settings: - id: 1 - require_comment_on_skip: true - annotation_limit_count: 1 - queue_done: queue_done - show_annotation_history: true - queue_total: queue_total - parsed_label_config: + show_skip_button: true + data_types: key: value + enable_empty_annotation: true + is_draft: true + start_training_on_annotation_update: true audiences: - public source: diff --git a/.mock/openapi/openapi.yaml b/.mock/openapi/openapi.yaml index 6a582b6a4..1aa01f7c4 100644 --- a/.mock/openapi/openapi.yaml +++ b/.mock/openapi/openapi.yaml @@ -563,238 +563,6 @@ paths: x-fern-sdk-method-name: create_bulk x-fern-audiences: - public - /api/billing/info: - get: - operationId: api_billing_info_retrieve - description: Retrieve billing checks and feature flags for the active organization. - summary: Get billing info - tags: - - Billing - security: - - Token: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BillingInfoResponse' - examples: - Real-sample: - value: - billing_checks: - users: - count: 110 - total: 221 - limit: 1000 - reached: false - trial_days: 0 - projects: - count: 2044 - limit: 1000000 - reached: false - organization_is_active: true - license_issued: '2000-01-01' - license_warning: '2030-01-01' - is_license_warning: false - license_expires: '2030-01-02' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: null - is_prompts_warning: false - prompts_expire: null - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - export_storages: - count: 0 - limit: 0 - reached: false - results: - count: 42949 - limit: 1000000000 - reached: false - billing_flags: - cloud_instance: true - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: true - white_label_id: null - allow_data_credentials: false - allow_organization_webhooks: false - disable_members_page: false - secure_mode: false - manual_workspace_management: true - manual_role_management: true - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: true - automax_enabled: true - storage_persistence: true - allow_ai: true - early_adopter: true - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: true - embed_domains: - - domain: http://localhost:3000 - - domain: https://purple-zoos-flash.loca.lt - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: '....' - activated_at: null - summary: real-sample - Cloud: - value: - billing_checks: - users: - count: 5 - total: 6 - limit: 10 - reached: false - projects: - count: 3 - limit: 50 - reached: false - results: - count: 100 - limit: 1000 - reached: false - trial_days: 14 - organization_is_active: true - license_issued: '2023-01-01' - license_warning: '2024-12-01' - is_license_warning: false - license_expires: '2025-01-01' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: null - is_prompts_warning: false - prompts_expire: '2024-12-31' - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - export_storages: - count: 0 - limit: 0 - reached: false - billing_flags: - activated_at: '2023-01-01T00:00:00Z' - cloud_instance: true - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: false - white_label_id: null - allow_data_credentials: true - allow_organization_webhooks: true - disable_members_page: false - secure_mode: false - manual_workspace_management: false - manual_role_management: false - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: false - automax_enabled: true - storage_persistence: true - allow_ai: true - early_adopter: false - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: false - embed_domains: - - domain: http://localhost:3000 - - domain: https://example.com - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: '....' - summary: cloud - Enterprise: - value: - billing_checks: - users: - count: 20 - total: 22 - limit: 100 - reached: false - projects: - count: 15 - limit: 200 - reached: false - results: - count: 25000 - limit: 100000 - reached: false - trial_days: 0 - organization_is_active: true - license_issued: '2023-01-01' - license_warning: '2024-12-01' - is_license_warning: false - license_expires: '2025-01-01' - is_license_expired: false - prompts_enabled: true - prompts_status: Enabled - prompts_warning: null - is_prompts_warning: false - prompts_expire: null - is_prompts_expire: false - prompts_api_keys_enabled: true - import_storages: - count: 0 - limit: 0 - reached: false - export_storages: - count: 0 - limit: 0 - reached: false - billing_flags: - activated_at: null - cloud_instance: false - allow_activity_log: true - allow_invite_project_experts: true - allow_sso: true - white_label_id: wl-1 - allow_data_credentials: true - allow_organization_webhooks: true - disable_members_page: false - secure_mode: false - manual_workspace_management: false - manual_role_management: false - hide_storage_settings_for_manager: false - disable_project_imports: false - automax_token_exists: true - automax_enabled: true - storage_persistence: true - allow_ai: false - early_adopter: true - allow_ask_ai: true - allow_invite_people: true - allow_storage_proxy: true - embed_enabled: false - embed_domains: - - domain: http://localhost:3000 - - domain: https://example.com - embed_settings: - public_verify_alg: - - RS256 - public_verify_key: '....' - summary: enterprise - description: Billing information for the active organization - x-fern-sdk-group-name: - - billing - x-fern-sdk-method-name: info - x-fern-audiences: - - public /api/blueprints/: post: operationId: api_blueprints_create @@ -5416,29 +5184,72 @@ paths: schema: $ref: '#/components/schemas/PaginatedLseOrganizationMemberListList' description: '' - x-fern-sdk-group-name: - - organizations - - members - x-fern-sdk-method-name: list - x-fern-audiences: - - public + post: + operationId: api_organizations_memberships_create + description: "\n Assign a role to a user in an organization. To do so, make\ + \ the following cURL request:\n\n ```bash\n curl -H 'Content-Type: application/json'\ + \ -H 'Authorization: Token abc123' \\\n -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships'\ + \ --data '[{{\"user_id\": Int, \"role\": \"NO|DI|OW|AD|MA|AN|RE\" }}]'\n \ + \ ```\n \n Enumerate a role with one of the following abbreviations:\n\ + \n | Role | Full Role Name |\n | --- | --- |\n | NO | Not Activated\ + \ |\n | DI | Deactivated |\n | OW | Owner |\n | AD | Administrator\ + \ |\n | MA | Manager |\n | AN | Annotator |\n | RE | Reviewer |\n\ + \n For example, to set a user with an ID of 9 as an annotator, make the\ + \ following cURL request:\n ```bash\n curl -H 'Content-Type: application/json'\ + \ -H 'Authorization: Token abc123' \\\n -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships'\ + \ --data '[{{\"user_id\": 9, \"role\": \"AN\" }}]'\n ```\n " + summary: Create organization member/role + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this organization. + required: true + tags: + - Organizations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' + required: true + security: + - Token: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LseOrganizationMemberList' + description: '' patch: operationId: api_organizations_memberships_partial_update - description: |+ - Update organization membership or role for a specific user ID. - - **User Rotation Best Practices for API Usage** - - To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: - - * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. - - * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. - - * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. - - * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. - + description: "\n Update organization membership or role for a specific user\ + \ ID.\n\n **User Rotation Best Practices for API Usage**\n \n To\ + \ maintain compliance with our licensing terms and ensure optimal performance\ + \ of HumanSignal's APIs, please consider the following guidelines when managing\ + \ user assignments:\n \n * **Maintain a 7-Day Minimum Assignment**:\ + \ Once a licensed seat is assigned to a user, maintain that assignment for\ + \ at least seven consecutive days before rotating it to another user.\n\n\ + \ * **Automate, Monitor, and Log Rotations**: Implement automated scheduling\ + \ and logging mechanisms to track the timing of user rotations. This helps\ + \ ensure that rotations adhere to the seven-day minimum period.\n\n * **Adhere\ + \ to API Update Frequency and Wait Periods**: When updating user assignments\ + \ via our APIs, follow the recommended frequency and wait period guidelines\ + \ provided in the HumanSignal API documentation. Avoid sending rapid, successive\ + \ requests that might overload the endpoint. Instead, incorporate appropriate\ + \ delays between calls as specified in the documentation.\n \n * **Avoid\ + \ Overloading the API Endpoint**: Design your integration to batch or schedule\ + \ updates where possible, and implement backoff strategies if the API indicates\ + \ rate limiting. This helps prevent service disruptions and ensures a smooth\ + \ operation.\n " summary: Update organization member/role parameters: - in: path @@ -5469,12 +5280,6 @@ paths: schema: $ref: '#/components/schemas/LseOrganizationMemberList' description: '' - x-fern-sdk-group-name: - - organizations - - members - x-fern-sdk-method-name: update - x-fern-audiences: - - public /api/organizations/{id}/memberships/{user_pk}/: get: operationId: api_organizations_memberships_retrieve @@ -6266,12 +6071,6 @@ paths: total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.' - - in: query - name: members_limit - schema: - type: integer - default: 10 - description: Maximum number of members to return. - in: query name: ordering schema: @@ -15777,267 +15576,267 @@ components: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: - control_weights: - nullable: true - description: 'Dict of weights for each control tag in metric calculation. - Each control tag (e.g. label or choice) will have it''s own key in control - weight dict with weight for each label and overall weight.For example, - if bounding box annotation with control tag named my_bbox should be included - with 0.33 weight in agreement calculation, and the first label Car should - be twice more important than Airplaine, then you have to need the specify: - {''my_bbox'': {''type'': ''RectangleLabels'', ''labels'': {''Car'': 1.0, - ''Airplaine'': 0.5}, ''overall'': 0.33}' - start_training_on_annotation_update: + reveal_preannotations_interactively: type: boolean - readOnly: true - description: Start model training after any annotations are submitted or - updated - id: - type: integer - readOnly: true - ground_truth_number: + description: Reveal pre-annotations interactively + organization: type: integer - readOnly: true - description: Honeypot annotation number in project - config_has_control_tags: - type: boolean - readOnly: true - description: Flag to detect is project ready for labeling + nullable: true annotation_limit_percent: type: string format: decimal pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ nullable: true - duplication_done: + color: + type: string + nullable: true + maxLength: 16 + show_ground_truth_first: type: boolean - default: false - finished_task_number: + overlap_cohort_percentage: type: integer - readOnly: true - members: + maximum: 2147483647 + minimum: -2147483648 + custom_script: type: string - readOnly: true - total_annotations_number: + reviewer_queue_total: type: string readOnly: true members_count: - type: integer - readOnly: true - enable_empty_annotation: - type: boolean - description: Allow annotators to submit empty annotations - config_suitable_for_bulk_annotation: - type: boolean - readOnly: true - description: Flag to detect is project ready for bulk annotation - task_number: - type: integer - readOnly: true - description: Total task number in project - workspace_title: type: string readOnly: true - total_predictions_number: + custom_task_lock_ttl: type: integer - readOnly: true - is_published: - type: boolean - title: Published - description: Whether or not the project is published to annotators - is_draft: - type: boolean - description: Whether or not the project is in the middle of being created - description: - type: string + maximum: 86400 + minimum: 1 nullable: true - description: Project description - rejected: + description: TTL in seconds for task reservations, on new and existing tasks + annotator_evaluation_minimum_tasks: + type: integer + minimum: 0 + nullable: true + default: 10 + members: type: string readOnly: true - custom_script: - type: string - workspace: - type: string + finished_task_number: + type: integer readOnly: true - show_ground_truth_first: - type: boolean - expert_instruction: + pinned_at: type: string + format: date-time nullable: true - description: Labeling instructions in HTML format - allow_stream: + description: Pinned date and time + duplication_done: + type: boolean + default: false + num_tasks_with_annotations: type: string readOnly: true - reviewer_queue_total: - type: string + config_suitable_for_bulk_annotation: + type: boolean readOnly: true + description: Flag to detect is project ready for bulk annotation created_at: type: string format: date-time readOnly: true - annotator_evaluation_minimum_tasks: - type: integer - minimum: 0 + pause_on_failed_annotator_evaluation: + type: boolean nullable: true - default: 10 - review_total_tasks: + default: false + reviewed_number: type: string readOnly: true - min_annotations_to_start_training: - type: integer - maximum: 2147483647 - minimum: -2147483648 - description: Minimum number of completed tasks after which model training - is started label_config: type: string nullable: true description: Label config in XML format. See more about it in documentation - created_by: - allOf: - - $ref: '#/components/schemas/UserSimple' - description: Project owner - maximum_annotations: - type: integer - maximum: 2147483647 - minimum: -2147483648 - title: Maximum annotation number - description: Maximum number of annotations for one task. If the number of - annotations per task is equal or greater to this value, the task is completed - (is_labeled=True) - evaluate_predictions_automatically: - type: boolean - description: Retrieve and display predictions when loading a task + skip_queue: + nullable: true + oneOf: + - $ref: '#/components/schemas/SkipQueueEnum' + - $ref: '#/components/schemas/NullEnum' + skipped_annotations_number: + type: string + readOnly: true annotator_evaluation_minimum_score: type: string format: decimal pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ nullable: true default: '95.00' - model_version: + title: type: string nullable: true - description: Machine learning model version + description: Project name. Must be between 3 and 50 characters long. + maxLength: 50 + minLength: 3 useful_annotation_number: type: string readOnly: true - has_blueprints: + total_annotations_number: type: string readOnly: true - pause_on_failed_annotator_evaluation: - type: boolean - nullable: true - default: false - show_instruction: - type: boolean - description: Show instructions to the annotator before they start - queue_left: + allow_stream: type: string readOnly: true - custom_task_lock_ttl: + sampling: + nullable: true + oneOf: + - $ref: '#/components/schemas/SamplingEnum' + - $ref: '#/components/schemas/NullEnum' + annotation_limit_count: type: integer - maximum: 86400 minimum: 1 nullable: true - description: TTL in seconds for task reservations, on new and existing tasks - pinned_at: + control_weights: + nullable: true + description: 'Dict of weights for each control tag in metric calculation. + Each control tag (e.g. label or choice) will have it''s own key in control + weight dict with weight for each label and overall weight.For example, + if bounding box annotation with control tag named my_bbox should be included + with 0.33 weight in agreement calculation, and the first label Car should + be twice more important than Airplaine, then you have to need the specify: + {''my_bbox'': {''type'': ''RectangleLabels'', ''labels'': {''Car'': 1.0, + ''Airplaine'': 0.5}, ''overall'': 0.33}' + ground_truth_number: + type: integer + readOnly: true + description: Honeypot annotation number in project + expert_instruction: type: string - format: date-time nullable: true - description: Pinned date and time + description: Labeling instructions in HTML format + parsed_label_config: + readOnly: true + description: JSON-formatted labeling configuration ready: type: string readOnly: true + comment_classification_config: + type: string description_short: type: string readOnly: true - show_overlap_first: - type: boolean - reveal_preannotations_interactively: + config_has_control_tags: type: boolean - description: Reveal pre-annotations interactively - comment_classification_config: + readOnly: true + description: Flag to detect is project ready for labeling + model_version: type: string - show_skip_button: + nullable: true + description: Machine learning model version + is_published: type: boolean - description: Show a skip button in interface and allow annotators to skip - the task - data_types: + title: Published + description: Whether or not the project is published to annotators + rejected: + type: string readOnly: true - nullable: true - organization: + min_annotations_to_start_training: type: integer + maximum: 2147483647 + minimum: -2147483648 + description: Minimum number of completed tasks after which model training + is started + description: + type: string nullable: true + description: Project description + queue_left: + type: string + readOnly: true + total_predictions_number: + type: integer + readOnly: true + duplication_status: + type: string show_collab_predictions: type: boolean title: Show predictions to annotator description: If set, the annotator can view model predictions - reviewed_number: + show_annotation_history: + type: boolean + description: Show annotation history to annotator + id: + type: integer + readOnly: true + assignment_settings: + $ref: '#/components/schemas/AssignmentSettings' + workspace_title: type: string readOnly: true - prompts: + has_blueprints: type: string readOnly: true - overlap_cohort_percentage: + workspace: + type: string + readOnly: true + show_instruction: + type: boolean + description: Show instructions to the annotator before they start + maximum_annotations: type: integer maximum: 2147483647 minimum: -2147483648 - duplication_status: + title: Maximum annotation number + description: Maximum number of annotations for one task. If the number of + annotations per task is equal or greater to this value, the task is completed + (is_labeled=True) + require_comment_on_skip: + type: boolean + default: false + review_total_tasks: type: string - skipped_annotations_number: + readOnly: true + created_by: + allOf: + - $ref: '#/components/schemas/UserSimple' + description: Project owner + queue_done: type: string readOnly: true + task_number: + type: integer + readOnly: true + description: Total task number in project blueprints: type: array items: $ref: '#/components/schemas/BlueprintList' readOnly: true - sampling: - nullable: true - oneOf: - - $ref: '#/components/schemas/SamplingEnum' - - $ref: '#/components/schemas/NullEnum' - color: - type: string - nullable: true - maxLength: 16 - title: - type: string - nullable: true - description: Project name. Must be between 3 and 50 characters long. - maxLength: 50 - minLength: 3 - skip_queue: - nullable: true - oneOf: - - $ref: '#/components/schemas/SkipQueueEnum' - - $ref: '#/components/schemas/NullEnum' - review_settings: - $ref: '#/components/schemas/ReviewSettings' - num_tasks_with_annotations: + show_overlap_first: + type: boolean + queue_total: type: string readOnly: true - assignment_settings: - $ref: '#/components/schemas/AssignmentSettings' - require_comment_on_skip: + evaluate_predictions_automatically: type: boolean - default: false - annotation_limit_count: - type: integer - minimum: 1 - nullable: true - queue_done: + description: Retrieve and display predictions when loading a task + prompts: type: string readOnly: true - show_annotation_history: + review_settings: + $ref: '#/components/schemas/ReviewSettings' + show_skip_button: type: boolean - description: Show annotation history to annotator - queue_total: - type: string + description: Show a skip button in interface and allow annotators to skip + the task + data_types: readOnly: true - parsed_label_config: + nullable: true + enable_empty_annotation: + type: boolean + description: Allow annotators to submit empty annotations + is_draft: + type: boolean + description: Whether or not the project is in the middle of being created + start_training_on_annotation_update: + type: boolean readOnly: true - description: JSON-formatted labeling configuration + description: Start model training after any annotations are submitted or + updated required: - allow_stream - assignment_settings @@ -17414,169 +17213,6 @@ components: required: - modelrun_id - results - BillingChecks: - type: object - properties: - users: - $ref: '#/components/schemas/CountLimit' - projects: - $ref: '#/components/schemas/CountLimit' - results: - $ref: '#/components/schemas/CountLimit' - trial_days: - type: integer - organization_is_active: - type: boolean - license_issued: - type: string - format: date - nullable: true - license_warning: - type: string - format: date - nullable: true - is_license_warning: - type: boolean - license_expires: - type: string - format: date - nullable: true - is_license_expired: - type: boolean - prompts_enabled: - type: boolean - prompts_status: - $ref: '#/components/schemas/PromptsStatusEnum' - prompts_warning: - type: string - nullable: true - is_prompts_warning: - type: boolean - prompts_expire: - type: string - nullable: true - is_prompts_expire: - type: boolean - prompts_api_keys_enabled: - type: boolean - import_storages: - $ref: '#/components/schemas/CountLimit' - export_storages: - $ref: '#/components/schemas/CountLimit' - required: - - export_storages - - import_storages - - is_license_expired - - is_license_warning - - is_prompts_expire - - is_prompts_warning - - license_expires - - license_issued - - license_warning - - organization_is_active - - projects - - prompts_api_keys_enabled - - prompts_enabled - - prompts_expire - - prompts_status - - prompts_warning - - results - - trial_days - - users - BillingFlags: - type: object - properties: - activated_at: - type: string - format: date-time - nullable: true - cloud_instance: - type: boolean - allow_activity_log: - type: boolean - allow_invite_project_experts: - type: boolean - allow_sso: - type: boolean - white_label_id: - type: string - nullable: true - allow_data_credentials: - type: boolean - allow_organization_webhooks: - type: boolean - disable_members_page: - type: boolean - secure_mode: - type: boolean - manual_workspace_management: - type: boolean - manual_role_management: - type: boolean - hide_storage_settings_for_manager: - type: boolean - disable_project_imports: - type: boolean - automax_token_exists: - type: boolean - automax_enabled: - type: boolean - storage_persistence: - type: boolean - allow_ai: - type: boolean - early_adopter: - type: boolean - allow_ask_ai: - type: boolean - allow_invite_people: - type: boolean - allow_storage_proxy: - type: boolean - embed_enabled: - type: boolean - embed_domains: - type: array - items: - type: object - additionalProperties: {} - embed_settings: - type: object - additionalProperties: {} - required: - - activated_at - - allow_activity_log - - allow_ai - - allow_ask_ai - - allow_data_credentials - - allow_invite_people - - allow_invite_project_experts - - allow_organization_webhooks - - allow_sso - - allow_storage_proxy - - automax_enabled - - automax_token_exists - - cloud_instance - - disable_members_page - - disable_project_imports - - early_adopter - - embed_enabled - - hide_storage_settings_for_manager - - manual_role_management - - manual_workspace_management - - secure_mode - - storage_persistence - - white_label_id - BillingInfoResponse: - type: object - properties: - billing_checks: - $ref: '#/components/schemas/BillingChecks' - billing_flags: - $ref: '#/components/schemas/BillingFlags' - required: - - billing_checks - - billing_flags BlankEnum: enum: - '' @@ -17934,21 +17570,6 @@ components: description: Traceback report in case of errors required: - export_type - CountLimit: - type: object - properties: - count: - type: integer - limit: - type: integer - reached: - type: boolean - total: - type: integer - required: - - count - - limit - - reached CustomScriptsEditableByEnum: enum: - AD @@ -20325,7 +19946,7 @@ components: type: string readOnly: true members_count: - type: integer + type: string readOnly: true custom_task_lock_ttl: type: integer @@ -23161,6 +22782,16 @@ components: - created_at - organization - user + OrganizationMemberCreateUpdateRequest: + type: object + properties: + user_id: + type: integer + role: + $ref: '#/components/schemas/Role9e7Enum' + required: + - role + - user_id OrganizationMembership: type: object properties: @@ -25945,24 +25576,6 @@ components: nullable: true required: - name - PromptsStatusEnum: - enum: - - Enabled - - Cloud license per organization disabled - - On-premise global license disabled - - Expired - - Adala not connected - - Disabled for this organization [FF] - - unknown - type: string - description: |- - * `Enabled` - Enabled - * `Cloud license per organization disabled` - Cloud license per organization disabled - * `On-premise global license disabled` - On-premise global license disabled - * `Expired` - Expired - * `Adala not connected` - Adala not connected - * `Disabled for this organization [FF]` - Disabled for this organization [FF] - * `unknown` - unknown ProviderEnum: enum: - OpenAI diff --git a/reference.md b/reference.md index d4de5f4ea..793adfc2c 100644 --- a/reference.md +++ b/reference.md @@ -754,67 +754,6 @@ client.annotations.create( - - - - -## Billing -
client.billing.info() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve billing checks and feature flags for the active organization. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.billing.info() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -6506,14 +6445,6 @@ for page in response.iter_pages():
-**members_limit:** `typing.Optional[int]` — Maximum number of members to return. - -
-
- -
-
- **ordering:** `typing.Optional[str]` — Which field to use when ordering the results.
@@ -19341,223 +19272,6 @@ client.import_storage.s3s.validate( ## Organizations Members -
client.organizations.members.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve a list of all users and roles in a specific organization. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.organizations.members.list( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — A unique integer value identifying this organization. - -
-
- -
-
- -**exclude_project_id:** `typing.Optional[int]` — Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). - -
-
- -
-
- -**exclude_workspace_id:** `typing.Optional[int]` — Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). - -
-
- -
-
- -**ordering:** `typing.Optional[str]` — Which field to use when ordering the results. - -
-
- -
-
- -**page:** `typing.Optional[int]` — A page number within the paginated result set. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
- -
-
- -**search:** `typing.Optional[str]` — A search term. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.organizations.members.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update organization membership or role for a specific user ID. - -**User Rotation Best Practices for API Usage** - -To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: - -* **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. - -* **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. - -* **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. - -* **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.organizations.members.update( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — A unique integer value identifying this organization. - -
-
- -
-
- -**user_id:** `typing.Optional[int]` - -
-
- -
-
- -**role:** `typing.Optional[Role9E7Enum]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
-
client.organizations.members.get(...)
diff --git a/src/label_studio_sdk/__init__.py b/src/label_studio_sdk/__init__.py index b04c1571d..85bcd2939 100644 --- a/src/label_studio_sdk/__init__.py +++ b/src/label_studio_sdk/__init__.py @@ -20,9 +20,6 @@ AzureBlobImportStorage, BatchFailedPredictions, BatchPredictions, - BillingChecks, - BillingFlags, - BillingInfoResponse, BlankEnum, BlueprintList, BudgetResetPeriodEnum, @@ -32,7 +29,6 @@ CommentSerializerWithExpandedUser, ConvertedFormat, ConvertedFormatRequest, - CountLimit, CustomScriptsEditableByEnum, DefaultRoleEnum, EditionEnum, @@ -61,7 +57,6 @@ LseKeyIndicatorValue, LseOrganization, LseOrganizationCustomScriptsEditableBy, - LseOrganizationMemberList, LseProjectCreate, LseProjectCreateSampling, LseProjectCreateSkipQueue, @@ -93,7 +88,6 @@ LseTaskSerializerForReviewersPredictionsItem, LseUser, LseUserApi, - LseUserOrganizationMemberList, LseapiTokenCreate, LseapiTokenList, LsejwtSettings, @@ -116,7 +110,6 @@ OrganizationMember, OrganizationMembership, PaginatedAllRolesProjectListList, - PaginatedLseOrganizationMemberListList, PaginatedRoleBasedTaskList, Pause, PauseRequest, @@ -129,7 +122,6 @@ ProjectSampling, ProjectSkipQueue, ProjectSubsetEnum, - PromptsStatusEnum, ProviderEnum, ReasonEnum, RedisExportStorage, @@ -144,7 +136,6 @@ ReviewSettingsRequeueRejectedTasksMode, ReviewSettingsReviewCriteria, ReviewedEnum, - Role9E7Enum, RoleBasedTask, S3ExportStorage, S3ImportStorage, @@ -187,7 +178,6 @@ from . import ( actions, annotations, - billing, comments, export_storage, files, @@ -317,9 +307,6 @@ "BadRequestError", "BatchFailedPredictions", "BatchPredictions", - "BillingChecks", - "BillingFlags", - "BillingInfoResponse", "BlankEnum", "BlueprintList", "BudgetResetPeriodEnum", @@ -330,7 +317,6 @@ "CommentSerializerWithExpandedUser", "ConvertedFormat", "ConvertedFormatRequest", - "CountLimit", "CustomScriptsEditableByEnum", "DefaultRoleEnum", "EditionEnum", @@ -365,7 +351,6 @@ "LseKeyIndicatorValue", "LseOrganization", "LseOrganizationCustomScriptsEditableBy", - "LseOrganizationMemberList", "LseProjectCreate", "LseProjectCreateRequestSampling", "LseProjectCreateRequestSkipQueue", @@ -399,7 +384,6 @@ "LseTaskSerializerForReviewersPredictionsItem", "LseUser", "LseUserApi", - "LseUserOrganizationMemberList", "LseapiTokenCreate", "LseapiTokenList", "LsejwtSettings", @@ -428,7 +412,6 @@ "OrganizationMember", "OrganizationMembership", "PaginatedAllRolesProjectListList", - "PaginatedLseOrganizationMemberListList", "PaginatedRoleBasedTaskList", "PatchedLseProjectUpdateRequestSampling", "PatchedLseProjectUpdateRequestSkipQueue", @@ -447,7 +430,6 @@ "ProjectsImportTasksResponse", "ProjectsListRequestFilter", "PromptsCompatibleProjectsRequestProjectType", - "PromptsStatusEnum", "ProviderEnum", "ReasonEnum", "RedisExportStorage", @@ -462,7 +444,6 @@ "ReviewSettingsRequeueRejectedTasksMode", "ReviewSettingsReviewCriteria", "ReviewedEnum", - "Role9E7Enum", "RoleBasedTask", "S3ExportStorage", "S3ImportStorage", @@ -532,7 +513,6 @@ "__version__", "actions", "annotations", - "billing", "comments", "export_storage", "files", diff --git a/src/label_studio_sdk/base_client.py b/src/label_studio_sdk/base_client.py index 19c2e27a5..daf3eec93 100644 --- a/src/label_studio_sdk/base_client.py +++ b/src/label_studio_sdk/base_client.py @@ -7,7 +7,6 @@ from .core.api_error import ApiError from .core.client_wrapper import SyncClientWrapper from .annotations.client import AnnotationsClient -from .billing.client import BillingClient from .comments.client import CommentsClient from .users.client import UsersClient from .actions.client import ActionsClient @@ -29,7 +28,6 @@ from .workspaces.client import WorkspacesClient from .core.client_wrapper import AsyncClientWrapper from .annotations.client import AsyncAnnotationsClient -from .billing.client import AsyncBillingClient from .comments.client import AsyncCommentsClient from .users.client import AsyncUsersClient from .actions.client import AsyncActionsClient @@ -114,7 +112,6 @@ def __init__( timeout=_defaulted_timeout, ) self.annotations = AnnotationsClient(client_wrapper=self._client_wrapper) - self.billing = BillingClient(client_wrapper=self._client_wrapper) self.comments = CommentsClient(client_wrapper=self._client_wrapper) self.users = UsersClient(client_wrapper=self._client_wrapper) self.actions = ActionsClient(client_wrapper=self._client_wrapper) @@ -199,7 +196,6 @@ def __init__( timeout=_defaulted_timeout, ) self.annotations = AsyncAnnotationsClient(client_wrapper=self._client_wrapper) - self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper) self.comments = AsyncCommentsClient(client_wrapper=self._client_wrapper) self.users = AsyncUsersClient(client_wrapper=self._client_wrapper) self.actions = AsyncActionsClient(client_wrapper=self._client_wrapper) diff --git a/src/label_studio_sdk/billing/__init__.py b/src/label_studio_sdk/billing/__init__.py deleted file mode 100644 index f3ea2659b..000000000 --- a/src/label_studio_sdk/billing/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - diff --git a/src/label_studio_sdk/billing/client.py b/src/label_studio_sdk/billing/client.py deleted file mode 100644 index 3384bd56a..000000000 --- a/src/label_studio_sdk/billing/client.py +++ /dev/null @@ -1,112 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.client_wrapper import SyncClientWrapper -import typing -from ..core.request_options import RequestOptions -from ..types.billing_info_response import BillingInfoResponse -from ..core.unchecked_base_model import construct_type -from json.decoder import JSONDecodeError -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper - - -class BillingClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse: - """ - Retrieve billing checks and feature flags for the active organization. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BillingInfoResponse - Billing information for the active organization - - Examples - -------- - from label_studio_sdk import LabelStudio - - client = LabelStudio( - api_key="YOUR_API_KEY", - ) - client.billing.info() - """ - _response = self._client_wrapper.httpx_client.request( - "api/billing/info", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BillingInfoResponse, - construct_type( - type_=BillingInfoResponse, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - -class AsyncBillingClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse: - """ - Retrieve billing checks and feature flags for the active organization. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BillingInfoResponse - Billing information for the active organization - - Examples - -------- - import asyncio - - from label_studio_sdk import AsyncLabelStudio - - client = AsyncLabelStudio( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.billing.info() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/billing/info", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BillingInfoResponse, - construct_type( - type_=BillingInfoResponse, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/label_studio_sdk/organizations/members/client.py b/src/label_studio_sdk/organizations/members/client.py index 4e4604d38..f5eeb8977 100644 --- a/src/label_studio_sdk/organizations/members/client.py +++ b/src/label_studio_sdk/organizations/members/client.py @@ -1,191 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import typing from ...core.client_wrapper import SyncClientWrapper +import typing from ...core.request_options import RequestOptions -from ...types.paginated_lse_organization_member_list_list import PaginatedLseOrganizationMemberListList +from ...types.organization_member import OrganizationMember from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type from json.decoder import JSONDecodeError from ...core.api_error import ApiError -from ...types.role9e7enum import Role9E7Enum -from ...types.lse_organization_member_list import LseOrganizationMemberList -from ...types.organization_member import OrganizationMember from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.method_not_allowed_error import MethodNotAllowedError from ...core.client_wrapper import AsyncClientWrapper -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - class MembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - id: int, - *, - exclude_project_id: typing.Optional[int] = None, - exclude_workspace_id: typing.Optional[int] = None, - ordering: typing.Optional[str] = None, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - search: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> PaginatedLseOrganizationMemberListList: - """ - Retrieve a list of all users and roles in a specific organization. - - Parameters - ---------- - id : int - A unique integer value identifying this organization. - - exclude_project_id : typing.Optional[int] - Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). - - exclude_workspace_id : typing.Optional[int] - Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). - - ordering : typing.Optional[str] - Which field to use when ordering the results. - - page : typing.Optional[int] - A page number within the paginated result set. - - page_size : typing.Optional[int] - Number of results to return per page. - - search : typing.Optional[str] - A search term. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - PaginatedLseOrganizationMemberListList - - - Examples - -------- - from label_studio_sdk import LabelStudio - - client = LabelStudio( - api_key="YOUR_API_KEY", - ) - client.organizations.members.list( - id=1, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/organizations/{jsonable_encoder(id)}/memberships", - method="GET", - params={ - "exclude_project_id": exclude_project_id, - "exclude_workspace_id": exclude_workspace_id, - "ordering": ordering, - "page": page, - "page_size": page_size, - "search": search, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - PaginatedLseOrganizationMemberListList, - construct_type( - type_=PaginatedLseOrganizationMemberListList, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def update( - self, - id: int, - *, - user_id: typing.Optional[int] = OMIT, - role: typing.Optional[Role9E7Enum] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> LseOrganizationMemberList: - """ - Update organization membership or role for a specific user ID. - - **User Rotation Best Practices for API Usage** - - To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: - - * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. - - * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. - - * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. - - * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. - - Parameters - ---------- - id : int - A unique integer value identifying this organization. - - user_id : typing.Optional[int] - - role : typing.Optional[Role9E7Enum] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - LseOrganizationMemberList - - - Examples - -------- - from label_studio_sdk import LabelStudio - - client = LabelStudio( - api_key="YOUR_API_KEY", - ) - client.organizations.members.update( - id=1, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/organizations/{jsonable_encoder(id)}/memberships", - method="PATCH", - json={ - "user_id": user_id, - "role": role, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - LseOrganizationMemberList, - construct_type( - type_=LseOrganizationMemberList, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - def get( self, id: int, user_pk: int, *, request_options: typing.Optional[RequestOptions] = None ) -> OrganizationMember: @@ -316,184 +148,6 @@ class AsyncMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - id: int, - *, - exclude_project_id: typing.Optional[int] = None, - exclude_workspace_id: typing.Optional[int] = None, - ordering: typing.Optional[str] = None, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - search: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> PaginatedLseOrganizationMemberListList: - """ - Retrieve a list of all users and roles in a specific organization. - - Parameters - ---------- - id : int - A unique integer value identifying this organization. - - exclude_project_id : typing.Optional[int] - Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). - - exclude_workspace_id : typing.Optional[int] - Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). - - ordering : typing.Optional[str] - Which field to use when ordering the results. - - page : typing.Optional[int] - A page number within the paginated result set. - - page_size : typing.Optional[int] - Number of results to return per page. - - search : typing.Optional[str] - A search term. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - PaginatedLseOrganizationMemberListList - - - Examples - -------- - import asyncio - - from label_studio_sdk import AsyncLabelStudio - - client = AsyncLabelStudio( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.organizations.members.list( - id=1, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/organizations/{jsonable_encoder(id)}/memberships", - method="GET", - params={ - "exclude_project_id": exclude_project_id, - "exclude_workspace_id": exclude_workspace_id, - "ordering": ordering, - "page": page, - "page_size": page_size, - "search": search, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - PaginatedLseOrganizationMemberListList, - construct_type( - type_=PaginatedLseOrganizationMemberListList, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def update( - self, - id: int, - *, - user_id: typing.Optional[int] = OMIT, - role: typing.Optional[Role9E7Enum] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> LseOrganizationMemberList: - """ - Update organization membership or role for a specific user ID. - - **User Rotation Best Practices for API Usage** - - To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: - - * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. - - * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. - - * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. - - * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. - - Parameters - ---------- - id : int - A unique integer value identifying this organization. - - user_id : typing.Optional[int] - - role : typing.Optional[Role9E7Enum] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - LseOrganizationMemberList - - - Examples - -------- - import asyncio - - from label_studio_sdk import AsyncLabelStudio - - client = AsyncLabelStudio( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.organizations.members.update( - id=1, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/organizations/{jsonable_encoder(id)}/memberships", - method="PATCH", - json={ - "user_id": user_id, - "role": role, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - LseOrganizationMemberList, - construct_type( - type_=LseOrganizationMemberList, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - async def get( self, id: int, user_pk: int, *, request_options: typing.Optional[RequestOptions] = None ) -> OrganizationMember: diff --git a/src/label_studio_sdk/projects/client.py b/src/label_studio_sdk/projects/client.py index 931f58019..cde8288d9 100644 --- a/src/label_studio_sdk/projects/client.py +++ b/src/label_studio_sdk/projects/client.py @@ -55,7 +55,6 @@ def list( filter: typing.Optional[ProjectsListRequestFilter] = None, ids: typing.Optional[str] = None, include: typing.Optional[str] = None, - members_limit: typing.Optional[int] = None, ordering: typing.Optional[str] = None, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, @@ -77,9 +76,6 @@ def list( include : typing.Optional[str] Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. - members_limit : typing.Optional[int] - Maximum number of members to return. - ordering : typing.Optional[str] Which field to use when ordering the results. @@ -125,7 +121,6 @@ def list( "filter": filter, "ids": ids, "include": include, - "members_limit": members_limit, "ordering": ordering, "page": page, "page_size": page_size, @@ -148,7 +143,6 @@ def list( filter=filter, ids=ids, include=include, - members_limit=members_limit, ordering=ordering, page=page + 1, page_size=page_size, @@ -982,7 +976,6 @@ async def list( filter: typing.Optional[ProjectsListRequestFilter] = None, ids: typing.Optional[str] = None, include: typing.Optional[str] = None, - members_limit: typing.Optional[int] = None, ordering: typing.Optional[str] = None, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, @@ -1004,9 +997,6 @@ async def list( include : typing.Optional[str] Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. - members_limit : typing.Optional[int] - Maximum number of members to return. - ordering : typing.Optional[str] Which field to use when ordering the results. @@ -1060,7 +1050,6 @@ async def main() -> None: "filter": filter, "ids": ids, "include": include, - "members_limit": members_limit, "ordering": ordering, "page": page, "page_size": page_size, @@ -1083,7 +1072,6 @@ async def main() -> None: filter=filter, ids=ids, include=include, - members_limit=members_limit, ordering=ordering, page=page + 1, page_size=page_size, diff --git a/src/label_studio_sdk/types/__init__.py b/src/label_studio_sdk/types/__init__.py index d45ee28c6..3064ecdb3 100644 --- a/src/label_studio_sdk/types/__init__.py +++ b/src/label_studio_sdk/types/__init__.py @@ -21,9 +21,6 @@ from .azure_blob_import_storage import AzureBlobImportStorage from .batch_failed_predictions import BatchFailedPredictions from .batch_predictions import BatchPredictions -from .billing_checks import BillingChecks -from .billing_flags import BillingFlags -from .billing_info_response import BillingInfoResponse from .blank_enum import BlankEnum from .blueprint_list import BlueprintList from .budget_reset_period_enum import BudgetResetPeriodEnum @@ -33,7 +30,6 @@ from .comment_serializer_with_expanded_user import CommentSerializerWithExpandedUser from .converted_format import ConvertedFormat from .converted_format_request import ConvertedFormatRequest -from .count_limit import CountLimit from .custom_scripts_editable_by_enum import CustomScriptsEditableByEnum from .default_role_enum import DefaultRoleEnum from .edition_enum import EditionEnum @@ -62,7 +58,6 @@ from .lse_key_indicator_value import LseKeyIndicatorValue from .lse_organization import LseOrganization from .lse_organization_custom_scripts_editable_by import LseOrganizationCustomScriptsEditableBy -from .lse_organization_member_list import LseOrganizationMemberList from .lse_project_create import LseProjectCreate from .lse_project_create_sampling import LseProjectCreateSampling from .lse_project_create_skip_queue import LseProjectCreateSkipQueue @@ -94,7 +89,6 @@ from .lse_task_serializer_for_reviewers_predictions_item import LseTaskSerializerForReviewersPredictionsItem from .lse_user import LseUser from .lse_user_api import LseUserApi -from .lse_user_organization_member_list import LseUserOrganizationMemberList from .lseapi_token_create import LseapiTokenCreate from .lseapi_token_list import LseapiTokenList from .lsejwt_settings import LsejwtSettings @@ -117,7 +111,6 @@ from .organization_member import OrganizationMember from .organization_membership import OrganizationMembership from .paginated_all_roles_project_list_list import PaginatedAllRolesProjectListList -from .paginated_lse_organization_member_list_list import PaginatedLseOrganizationMemberListList from .paginated_role_based_task_list import PaginatedRoleBasedTaskList from .pause import Pause from .pause_request import PauseRequest @@ -130,7 +123,6 @@ from .project_sampling import ProjectSampling from .project_skip_queue import ProjectSkipQueue from .project_subset_enum import ProjectSubsetEnum -from .prompts_status_enum import PromptsStatusEnum from .provider_enum import ProviderEnum from .reason_enum import ReasonEnum from .redis_export_storage import RedisExportStorage @@ -145,7 +137,6 @@ from .review_settings_requeue_rejected_tasks_mode import ReviewSettingsRequeueRejectedTasksMode from .review_settings_review_criteria import ReviewSettingsReviewCriteria from .reviewed_enum import ReviewedEnum -from .role9e7enum import Role9E7Enum from .role_based_task import RoleBasedTask from .s3export_storage import S3ExportStorage from .s3import_storage import S3ImportStorage @@ -197,9 +188,6 @@ "AzureBlobImportStorage", "BatchFailedPredictions", "BatchPredictions", - "BillingChecks", - "BillingFlags", - "BillingInfoResponse", "BlankEnum", "BlueprintList", "BudgetResetPeriodEnum", @@ -209,7 +197,6 @@ "CommentSerializerWithExpandedUser", "ConvertedFormat", "ConvertedFormatRequest", - "CountLimit", "CustomScriptsEditableByEnum", "DefaultRoleEnum", "EditionEnum", @@ -238,7 +225,6 @@ "LseKeyIndicatorValue", "LseOrganization", "LseOrganizationCustomScriptsEditableBy", - "LseOrganizationMemberList", "LseProjectCreate", "LseProjectCreateSampling", "LseProjectCreateSkipQueue", @@ -270,7 +256,6 @@ "LseTaskSerializerForReviewersPredictionsItem", "LseUser", "LseUserApi", - "LseUserOrganizationMemberList", "LseapiTokenCreate", "LseapiTokenList", "LsejwtSettings", @@ -293,7 +278,6 @@ "OrganizationMember", "OrganizationMembership", "PaginatedAllRolesProjectListList", - "PaginatedLseOrganizationMemberListList", "PaginatedRoleBasedTaskList", "Pause", "PauseRequest", @@ -306,7 +290,6 @@ "ProjectSampling", "ProjectSkipQueue", "ProjectSubsetEnum", - "PromptsStatusEnum", "ProviderEnum", "ReasonEnum", "RedisExportStorage", @@ -321,7 +304,6 @@ "ReviewSettingsRequeueRejectedTasksMode", "ReviewSettingsReviewCriteria", "ReviewedEnum", - "Role9E7Enum", "RoleBasedTask", "S3ExportStorage", "S3ImportStorage", diff --git a/src/label_studio_sdk/types/all_roles_project_list.py b/src/label_studio_sdk/types/all_roles_project_list.py index 28362e3d6..a9730045e 100644 --- a/src/label_studio_sdk/types/all_roles_project_list.py +++ b/src/label_studio_sdk/types/all_roles_project_list.py @@ -4,12 +4,12 @@ import typing import pydantic import datetime as dt +from .all_roles_project_list_skip_queue import AllRolesProjectListSkipQueue +from .all_roles_project_list_sampling import AllRolesProjectListSampling +from .assignment_settings import AssignmentSettings from .user_simple import UserSimple from .blueprint_list import BlueprintList -from .all_roles_project_list_sampling import AllRolesProjectListSampling -from .all_roles_project_list_skip_queue import AllRolesProjectListSkipQueue from .review_settings import ReviewSettings -from .assignment_settings import AssignmentSettings from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -19,174 +19,173 @@ class AllRolesProjectList(UncheckedBaseModel): make sure, that you use correct one(Project.objects.with_counts()) """ - control_weights: typing.Optional[typing.Optional[typing.Any]] = None - start_training_on_annotation_update: bool = pydantic.Field() - """ - Start model training after any annotations are submitted or updated - """ - - id: int - ground_truth_number: int = pydantic.Field() + reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None) """ - Honeypot annotation number in project + Reveal pre-annotations interactively """ - config_has_control_tags: bool = pydantic.Field() + organization: typing.Optional[int] = None + annotation_limit_percent: typing.Optional[str] = None + color: typing.Optional[str] = None + show_ground_truth_first: typing.Optional[bool] = None + overlap_cohort_percentage: typing.Optional[int] = None + custom_script: typing.Optional[str] = None + reviewer_queue_total: str + members_count: str + custom_task_lock_ttl: typing.Optional[int] = pydantic.Field(default=None) """ - Flag to detect is project ready for labeling + TTL in seconds for task reservations, on new and existing tasks """ - annotation_limit_percent: typing.Optional[str] = None - duplication_done: typing.Optional[bool] = None - finished_task_number: int + annotator_evaluation_minimum_tasks: typing.Optional[int] = None members: str - total_annotations_number: str - members_count: int - enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) + finished_task_number: int + pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ - Allow annotators to submit empty annotations + Pinned date and time """ + duplication_done: typing.Optional[bool] = None + num_tasks_with_annotations: str config_suitable_for_bulk_annotation: bool = pydantic.Field() """ Flag to detect is project ready for bulk annotation """ - task_number: int = pydantic.Field() + created_at: dt.datetime + pause_on_failed_annotator_evaluation: typing.Optional[bool] = None + reviewed_number: str + label_config: typing.Optional[str] = pydantic.Field(default=None) """ - Total task number in project + Label config in XML format. See more about it in documentation """ - workspace_title: str - total_predictions_number: int - is_published: typing.Optional[bool] = pydantic.Field(default=None) + skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None + skipped_annotations_number: str + annotator_evaluation_minimum_score: typing.Optional[str] = None + title: typing.Optional[str] = pydantic.Field(default=None) """ - Whether or not the project is published to annotators + Project name. Must be between 3 and 50 characters long. """ - is_draft: typing.Optional[bool] = pydantic.Field(default=None) + useful_annotation_number: str + total_annotations_number: str + allow_stream: str + sampling: typing.Optional[AllRolesProjectListSampling] = None + annotation_limit_count: typing.Optional[int] = None + control_weights: typing.Optional[typing.Optional[typing.Any]] = None + ground_truth_number: int = pydantic.Field() """ - Whether or not the project is in the middle of being created + Honeypot annotation number in project """ - description: typing.Optional[str] = pydantic.Field(default=None) + expert_instruction: typing.Optional[str] = pydantic.Field(default=None) """ - Project description + Labeling instructions in HTML format """ - rejected: str - custom_script: typing.Optional[str] = None - workspace: str - show_ground_truth_first: typing.Optional[bool] = None - expert_instruction: typing.Optional[str] = pydantic.Field(default=None) + parsed_label_config: typing.Optional[typing.Any] = None + ready: str + comment_classification_config: typing.Optional[str] = None + description_short: str + config_has_control_tags: bool = pydantic.Field() """ - Labeling instructions in HTML format + Flag to detect is project ready for labeling """ - allow_stream: str - reviewer_queue_total: str - created_at: dt.datetime - annotator_evaluation_minimum_tasks: typing.Optional[int] = None - review_total_tasks: str - min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) + model_version: typing.Optional[str] = pydantic.Field(default=None) """ - Minimum number of completed tasks after which model training is started + Machine learning model version """ - label_config: typing.Optional[str] = pydantic.Field(default=None) + is_published: typing.Optional[bool] = pydantic.Field(default=None) """ - Label config in XML format. See more about it in documentation + Whether or not the project is published to annotators """ - created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) + rejected: str + min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) """ - Project owner + Minimum number of completed tasks after which model training is started """ - maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) + description: typing.Optional[str] = pydantic.Field(default=None) """ - Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) + Project description """ - evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) + queue_left: str + total_predictions_number: int + duplication_status: typing.Optional[str] = None + show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) """ - Retrieve and display predictions when loading a task + If set, the annotator can view model predictions """ - annotator_evaluation_minimum_score: typing.Optional[str] = None - model_version: typing.Optional[str] = pydantic.Field(default=None) + show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) """ - Machine learning model version + Show annotation history to annotator """ - useful_annotation_number: str + id: int + assignment_settings: AssignmentSettings + workspace_title: str has_blueprints: str - pause_on_failed_annotator_evaluation: typing.Optional[bool] = None + workspace: str show_instruction: typing.Optional[bool] = pydantic.Field(default=None) """ Show instructions to the annotator before they start """ - queue_left: str - custom_task_lock_ttl: typing.Optional[int] = pydantic.Field(default=None) + maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) """ - TTL in seconds for task reservations, on new and existing tasks + Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) """ - pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + require_comment_on_skip: typing.Optional[bool] = None + review_total_tasks: str + created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) """ - Pinned date and time + Project owner """ - ready: str - description_short: str + queue_done: str + task_number: int = pydantic.Field() + """ + Total task number in project + """ + + blueprints: typing.List[BlueprintList] show_overlap_first: typing.Optional[bool] = None - reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None) + queue_total: str + evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) """ - Reveal pre-annotations interactively + Retrieve and display predictions when loading a task """ - comment_classification_config: typing.Optional[str] = None + prompts: str + review_settings: ReviewSettings show_skip_button: typing.Optional[bool] = pydantic.Field(default=None) """ Show a skip button in interface and allow annotators to skip the task """ data_types: typing.Optional[typing.Any] = None - organization: typing.Optional[int] = None - show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) + enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) """ - If set, the annotator can view model predictions + Allow annotators to submit empty annotations """ - reviewed_number: str - prompts: str - overlap_cohort_percentage: typing.Optional[int] = None - duplication_status: typing.Optional[str] = None - skipped_annotations_number: str - blueprints: typing.List[BlueprintList] - sampling: typing.Optional[AllRolesProjectListSampling] = None - color: typing.Optional[str] = None - title: typing.Optional[str] = pydantic.Field(default=None) + is_draft: typing.Optional[bool] = pydantic.Field(default=None) """ - Project name. Must be between 3 and 50 characters long. + Whether or not the project is in the middle of being created """ - skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None - review_settings: ReviewSettings - num_tasks_with_annotations: str - assignment_settings: AssignmentSettings - require_comment_on_skip: typing.Optional[bool] = None - annotation_limit_count: typing.Optional[int] = None - queue_done: str - show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) + start_training_on_annotation_update: bool = pydantic.Field() """ - Show annotation history to annotator + Start model training after any annotations are submitted or updated """ - queue_total: str - parsed_label_config: typing.Optional[typing.Any] = None - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/label_studio_sdk/types/billing_checks.py b/src/label_studio_sdk/types/billing_checks.py deleted file mode 100644 index a45a8a158..000000000 --- a/src/label_studio_sdk/types/billing_checks.py +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -from .count_limit import CountLimit -import typing -from .prompts_status_enum import PromptsStatusEnum -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class BillingChecks(UncheckedBaseModel): - users: CountLimit - projects: CountLimit - results: CountLimit - trial_days: int - organization_is_active: bool - license_issued: typing.Optional[str] = None - license_warning: typing.Optional[str] = None - is_license_warning: bool - license_expires: typing.Optional[str] = None - is_license_expired: bool - prompts_enabled: bool - prompts_status: PromptsStatusEnum - prompts_warning: typing.Optional[str] = None - is_prompts_warning: bool - prompts_expire: typing.Optional[str] = None - is_prompts_expire: bool - prompts_api_keys_enabled: bool - import_storages: CountLimit - export_storages: CountLimit - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/billing_flags.py b/src/label_studio_sdk/types/billing_flags.py deleted file mode 100644 index 980902f5e..000000000 --- a/src/label_studio_sdk/types/billing_flags.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -import typing -import datetime as dt -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class BillingFlags(UncheckedBaseModel): - activated_at: typing.Optional[dt.datetime] = None - cloud_instance: bool - allow_activity_log: bool - allow_invite_project_experts: bool - allow_sso: bool - white_label_id: typing.Optional[str] = None - allow_data_credentials: bool - allow_organization_webhooks: bool - disable_members_page: bool - secure_mode: bool - manual_workspace_management: bool - manual_role_management: bool - hide_storage_settings_for_manager: bool - disable_project_imports: bool - automax_token_exists: bool - automax_enabled: bool - storage_persistence: bool - allow_ai: bool - early_adopter: bool - allow_ask_ai: bool - allow_invite_people: bool - allow_storage_proxy: bool - embed_enabled: bool - embed_domains: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None - embed_settings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/billing_info_response.py b/src/label_studio_sdk/types/billing_info_response.py deleted file mode 100644 index 0bfaf5523..000000000 --- a/src/label_studio_sdk/types/billing_info_response.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -from .billing_checks import BillingChecks -from .billing_flags import BillingFlags -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class BillingInfoResponse(UncheckedBaseModel): - billing_checks: BillingChecks - billing_flags: BillingFlags - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/count_limit.py b/src/label_studio_sdk/types/count_limit.py deleted file mode 100644 index 26a6050fd..000000000 --- a/src/label_studio_sdk/types/count_limit.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -import typing -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class CountLimit(UncheckedBaseModel): - count: int - limit: int - reached: bool - total: typing.Optional[int] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/lse_organization_member_list.py b/src/label_studio_sdk/types/lse_organization_member_list.py deleted file mode 100644 index bce1303bb..000000000 --- a/src/label_studio_sdk/types/lse_organization_member_list.py +++ /dev/null @@ -1,32 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -import pydantic -from .lse_user_organization_member_list import LseUserOrganizationMemberList -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing - - -class LseOrganizationMemberList(UncheckedBaseModel): - """ - A serializer mixin that takes an additional `fields` argument that controls - which fields should be displayed. - """ - - id: int - organization: int = pydantic.Field() - """ - Organization ID - """ - - user: LseUserOrganizationMemberList - role: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/lse_user_organization_member_list.py b/src/label_studio_sdk/types/lse_user_organization_member_list.py deleted file mode 100644 index 7699d06a8..000000000 --- a/src/label_studio_sdk/types/lse_user_organization_member_list.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -import typing -import datetime as dt -import pydantic -from .lse_fields import LseFields -from ..core.pydantic_utilities import IS_PYDANTIC_V2 - - -class LseUserOrganizationMemberList(UncheckedBaseModel): - """ - A ModelSerializer that takes additional arguments for - "fields", "omit" and "expand" in order to - control which fields are displayed, and whether to replace simple - values with complex, nested serializations - """ - - id: int - first_name: typing.Optional[str] = None - last_name: typing.Optional[str] = None - username: str - email: typing.Optional[str] = None - last_activity: dt.datetime - custom_hotkeys: typing.Optional[typing.Optional[typing.Any]] = None - avatar: str - initials: str - phone: typing.Optional[str] = None - active_organization: typing.Optional[int] = None - allow_newsletters: typing.Optional[bool] = pydantic.Field(default=None) - """ - Allow sending newsletters to user - """ - - date_joined: typing.Optional[dt.datetime] = None - lse_fields: LseFields - pause: str - created_projects: str - contributed_to_projects: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py b/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py deleted file mode 100644 index 4b51fb3fd..000000000 --- a/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.unchecked_base_model import UncheckedBaseModel -import typing -from .lse_organization_member_list import LseOrganizationMemberList -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class PaginatedLseOrganizationMemberListList(UncheckedBaseModel): - count: int - next: typing.Optional[str] = None - previous: typing.Optional[str] = None - results: typing.List[LseOrganizationMemberList] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/prompts_status_enum.py b/src/label_studio_sdk/types/prompts_status_enum.py deleted file mode 100644 index b38ee4b50..000000000 --- a/src/label_studio_sdk/types/prompts_status_enum.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -PromptsStatusEnum = typing.Union[ - typing.Literal[ - "Enabled", - "Cloud license per organization disabled", - "On-premise global license disabled", - "Expired", - "Adala not connected", - "Disabled for this organization [FF]", - "unknown", - ], - typing.Any, -] diff --git a/src/label_studio_sdk/types/role9e7enum.py b/src/label_studio_sdk/types/role9e7enum.py deleted file mode 100644 index d70569fb2..000000000 --- a/src/label_studio_sdk/types/role9e7enum.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -Role9E7Enum = typing.Union[typing.Literal["OW", "AD", "MA", "RE", "AN", "DI", "NO"], typing.Any] diff --git a/tests/organizations/test_members.py b/tests/organizations/test_members.py index 604e81da4..658901506 100644 --- a/tests/organizations/test_members.py +++ b/tests/organizations/test_members.py @@ -6,155 +6,6 @@ from ..utilities import validate_response -async def test_list_(client: LabelStudio, async_client: AsyncLabelStudio) -> None: - expected_response: typing.Any = { - "count": 123, - "next": "http://api.example.org/accounts/?page=4", - "previous": "http://api.example.org/accounts/?page=2", - "results": [ - { - "id": 1, - "organization": 1, - "user": { - "id": 1, - "username": "username", - "last_activity": "2024-01-15T09:30:00Z", - "avatar": "avatar", - "initials": "initials", - "lse_fields": { - "invite_expired": "invite_expired", - "invite_expired_at": "invite_expired_at", - "email_notification_settings": "email_notification_settings", - }, - "pause": "pause", - "created_projects": "created_projects", - "contributed_to_projects": "contributed_to_projects", - }, - "role": "role", - } - ], - } - expected_types: typing.Any = { - "count": "integer", - "next": None, - "previous": None, - "results": ( - "list", - { - 0: { - "id": "integer", - "organization": "integer", - "user": { - "id": "integer", - "username": None, - "last_activity": "datetime", - "avatar": None, - "initials": None, - "lse_fields": { - "invite_expired": None, - "invite_expired_at": None, - "email_notification_settings": None, - }, - "pause": None, - "created_projects": None, - "contributed_to_projects": None, - }, - "role": None, - } - }, - ), - } - response = client.organizations.members.list(id=1) - validate_response(response, expected_response, expected_types) - - async_response = await async_client.organizations.members.list(id=1) - validate_response(async_response, expected_response, expected_types) - - -async def test_update(client: LabelStudio, async_client: AsyncLabelStudio) -> None: - expected_response: typing.Any = { - "id": 1, - "organization": 1, - "user": { - "id": 1, - "first_name": "first_name", - "last_name": "last_name", - "username": "username", - "email": "email", - "last_activity": "2024-01-15T09:30:00Z", - "custom_hotkeys": {"key": "value"}, - "avatar": "avatar", - "initials": "initials", - "phone": "phone", - "active_organization": 1, - "allow_newsletters": True, - "date_joined": "2024-01-15T09:30:00Z", - "lse_fields": { - "invite_expired": "invite_expired", - "invite_expired_at": "invite_expired_at", - "invited_at": "2024-01-15T09:30:00Z", - "invite_activated": True, - "trial_company": "trial_company", - "trial_role": "annotator", - "trial_models_in_production": "trial_models_in_production", - "trial_experience_labeling": "trial_experience_labeling", - "trial_license_enterprise": True, - "social_auth_finished": True, - "invited_by": 1, - "onboarding_state": "not_started", - "email_notification_settings": "email_notification_settings", - }, - "pause": "pause", - "created_projects": "created_projects", - "contributed_to_projects": "contributed_to_projects", - }, - "role": "role", - } - expected_types: typing.Any = { - "id": "integer", - "organization": "integer", - "user": { - "id": "integer", - "first_name": None, - "last_name": None, - "username": None, - "email": None, - "last_activity": "datetime", - "custom_hotkeys": None, - "avatar": None, - "initials": None, - "phone": None, - "active_organization": "integer", - "allow_newsletters": None, - "date_joined": "datetime", - "lse_fields": { - "invite_expired": None, - "invite_expired_at": None, - "invited_at": "datetime", - "invite_activated": None, - "trial_company": None, - "trial_role": None, - "trial_models_in_production": None, - "trial_experience_labeling": None, - "trial_license_enterprise": None, - "social_auth_finished": None, - "invited_by": "integer", - "onboarding_state": None, - "email_notification_settings": None, - }, - "pause": None, - "created_projects": None, - "contributed_to_projects": None, - }, - "role": None, - } - response = client.organizations.members.update(id=1) - validate_response(response, expected_response, expected_types) - - async_response = await async_client.organizations.members.update(id=1) - validate_response(async_response, expected_response, expected_types) - - async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None: expected_response: typing.Any = { "user": 1, diff --git a/tests/test_billing.py b/tests/test_billing.py deleted file mode 100644 index dbec9138c..000000000 --- a/tests/test_billing.py +++ /dev/null @@ -1,114 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from label_studio_sdk import LabelStudio -from label_studio_sdk import AsyncLabelStudio -import typing -from .utilities import validate_response - - -async def test_info(client: LabelStudio, async_client: AsyncLabelStudio) -> None: - expected_response: typing.Any = { - "billing_checks": { - "users": {"count": 110, "limit": 1000, "reached": False, "total": 221}, - "projects": {"count": 2044, "limit": 1000000, "reached": False, "total": 1}, - "results": {"count": 42949, "limit": 1000000000, "reached": False, "total": 1}, - "trial_days": 0, - "organization_is_active": True, - "license_issued": "2000-01-01", - "license_warning": "2030-01-01", - "is_license_warning": False, - "license_expires": "2030-01-02", - "is_license_expired": False, - "prompts_enabled": True, - "prompts_status": "Enabled", - "prompts_warning": "prompts_warning", - "is_prompts_warning": False, - "prompts_expire": "prompts_expire", - "is_prompts_expire": False, - "prompts_api_keys_enabled": True, - "import_storages": {"count": 0, "limit": 0, "reached": False, "total": 1}, - "export_storages": {"count": 0, "limit": 0, "reached": False, "total": 1}, - }, - "billing_flags": { - "activated_at": "2024-01-15T09:30:00Z", - "cloud_instance": True, - "allow_activity_log": True, - "allow_invite_project_experts": True, - "allow_sso": True, - "white_label_id": "white_label_id", - "allow_data_credentials": False, - "allow_organization_webhooks": False, - "disable_members_page": False, - "secure_mode": False, - "manual_workspace_management": True, - "manual_role_management": True, - "hide_storage_settings_for_manager": False, - "disable_project_imports": False, - "automax_token_exists": True, - "automax_enabled": True, - "storage_persistence": True, - "allow_ai": True, - "early_adopter": True, - "allow_ask_ai": True, - "allow_invite_people": True, - "allow_storage_proxy": True, - "embed_enabled": True, - "embed_domains": [{"domain": "http://localhost:3000"}, {"domain": "https://purple-zoos-flash.loca.lt"}], - "embed_settings": {"public_verify_alg": ["RS256"], "public_verify_key": "...."}, - }, - } - expected_types: typing.Any = { - "billing_checks": { - "users": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, - "projects": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, - "results": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, - "trial_days": "integer", - "organization_is_active": None, - "license_issued": None, - "license_warning": None, - "is_license_warning": None, - "license_expires": None, - "is_license_expired": None, - "prompts_enabled": None, - "prompts_status": None, - "prompts_warning": None, - "is_prompts_warning": None, - "prompts_expire": None, - "is_prompts_expire": None, - "prompts_api_keys_enabled": None, - "import_storages": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, - "export_storages": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, - }, - "billing_flags": { - "activated_at": "datetime", - "cloud_instance": None, - "allow_activity_log": None, - "allow_invite_project_experts": None, - "allow_sso": None, - "white_label_id": None, - "allow_data_credentials": None, - "allow_organization_webhooks": None, - "disable_members_page": None, - "secure_mode": None, - "manual_workspace_management": None, - "manual_role_management": None, - "hide_storage_settings_for_manager": None, - "disable_project_imports": None, - "automax_token_exists": None, - "automax_enabled": None, - "storage_persistence": None, - "allow_ai": None, - "early_adopter": None, - "allow_ask_ai": None, - "allow_invite_people": None, - "allow_storage_proxy": None, - "embed_enabled": None, - "embed_domains": ("list", {0: ("dict", {0: (None, None)}), 1: ("dict", {0: (None, None)})}), - "embed_settings": ("dict", {0: (None, None), 1: (None, None)}), - }, - } - response = client.billing.info() - validate_response(response, expected_response, expected_types) - - async_response = await async_client.billing.info() - validate_response(async_response, expected_response, expected_types) diff --git a/tests/test_prompts.py b/tests/test_prompts.py index c4bafae9e..2406c51ae 100644 --- a/tests/test_prompts.py +++ b/tests/test_prompts.py @@ -213,79 +213,79 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "previous": "http://api.example.org/accounts/?page=2", "results": [ { - "control_weights": {"key": "value"}, - "start_training_on_annotation_update": True, - "id": 1, - "ground_truth_number": 1, - "config_has_control_tags": True, + "reveal_preannotations_interactively": True, + "organization": 1, "annotation_limit_percent": "annotation_limit_percent", - "duplication_done": True, - "finished_task_number": 1, - "members": "members", - "total_annotations_number": "total_annotations_number", - "members_count": 1, - "enable_empty_annotation": True, - "config_suitable_for_bulk_annotation": True, - "task_number": 1, - "workspace_title": "workspace_title", - "total_predictions_number": 1, - "is_published": True, - "is_draft": True, - "description": "description", - "rejected": "rejected", - "custom_script": "custom_script", - "workspace": "workspace", + "color": "color", "show_ground_truth_first": True, - "expert_instruction": "expert_instruction", - "allow_stream": "allow_stream", + "overlap_cohort_percentage": 1, + "custom_script": "custom_script", "reviewer_queue_total": "reviewer_queue_total", - "created_at": "2024-01-15T09:30:00Z", + "members_count": "members_count", + "custom_task_lock_ttl": 1, "annotator_evaluation_minimum_tasks": 1, - "review_total_tasks": "review_total_tasks", - "min_annotations_to_start_training": 1, + "members": "members", + "finished_task_number": 1, + "pinned_at": "2024-01-15T09:30:00Z", + "duplication_done": True, + "num_tasks_with_annotations": "num_tasks_with_annotations", + "config_suitable_for_bulk_annotation": True, + "created_at": "2024-01-15T09:30:00Z", + "pause_on_failed_annotator_evaluation": True, + "reviewed_number": "reviewed_number", "label_config": "label_config", - "created_by": {"id": 1, "avatar": "avatar"}, - "maximum_annotations": 1, - "evaluate_predictions_automatically": True, + "skip_queue": "REQUEUE_FOR_ME", + "skipped_annotations_number": "skipped_annotations_number", "annotator_evaluation_minimum_score": "annotator_evaluation_minimum_score", - "model_version": "model_version", + "title": "title", "useful_annotation_number": "useful_annotation_number", - "has_blueprints": "has_blueprints", - "pause_on_failed_annotator_evaluation": True, - "show_instruction": True, - "queue_left": "queue_left", - "custom_task_lock_ttl": 1, - "pinned_at": "2024-01-15T09:30:00Z", + "total_annotations_number": "total_annotations_number", + "allow_stream": "allow_stream", + "sampling": "Sequential sampling", + "annotation_limit_count": 1, + "control_weights": {"key": "value"}, + "ground_truth_number": 1, + "expert_instruction": "expert_instruction", + "parsed_label_config": {"key": "value"}, "ready": "ready", - "description_short": "description_short", - "show_overlap_first": True, - "reveal_preannotations_interactively": True, "comment_classification_config": "comment_classification_config", - "show_skip_button": True, - "data_types": {"key": "value"}, - "organization": 1, - "show_collab_predictions": True, - "reviewed_number": "reviewed_number", - "prompts": "prompts", - "overlap_cohort_percentage": 1, + "description_short": "description_short", + "config_has_control_tags": True, + "model_version": "model_version", + "is_published": True, + "rejected": "rejected", + "min_annotations_to_start_training": 1, + "description": "description", + "queue_left": "queue_left", + "total_predictions_number": 1, "duplication_status": "duplication_status", - "skipped_annotations_number": "skipped_annotations_number", - "blueprints": [ - {"id": 1, "share_id": "share_id", "short_url": "short_url", "created_at": "2024-01-15T09:30:00Z"} - ], - "sampling": "Sequential sampling", - "color": "color", - "title": "title", - "skip_queue": "REQUEUE_FOR_ME", - "review_settings": {"id": 1, "requeue_rejected_tasks_to_annotator": True}, - "num_tasks_with_annotations": "num_tasks_with_annotations", + "show_collab_predictions": True, + "show_annotation_history": True, + "id": 1, "assignment_settings": {"id": 1}, + "workspace_title": "workspace_title", + "has_blueprints": "has_blueprints", + "workspace": "workspace", + "show_instruction": True, + "maximum_annotations": 1, "require_comment_on_skip": True, - "annotation_limit_count": 1, + "review_total_tasks": "review_total_tasks", + "created_by": {"id": 1, "avatar": "avatar"}, "queue_done": "queue_done", - "show_annotation_history": True, + "task_number": 1, + "blueprints": [ + {"id": 1, "share_id": "share_id", "short_url": "short_url", "created_at": "2024-01-15T09:30:00Z"} + ], + "show_overlap_first": True, "queue_total": "queue_total", - "parsed_label_config": {"key": "value"}, + "evaluate_predictions_automatically": True, + "prompts": "prompts", + "review_settings": {"id": 1, "requeue_rejected_tasks_to_annotator": True}, + "show_skip_button": True, + "data_types": {"key": "value"}, + "enable_empty_annotation": True, + "is_draft": True, + "start_training_on_annotation_update": True, } ], } @@ -297,80 +297,80 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "list", { 0: { - "control_weights": None, - "start_training_on_annotation_update": None, - "id": "integer", - "ground_truth_number": "integer", - "config_has_control_tags": None, + "reveal_preannotations_interactively": None, + "organization": "integer", "annotation_limit_percent": None, - "duplication_done": None, - "finished_task_number": "integer", - "members": None, - "total_annotations_number": None, - "members_count": "integer", - "enable_empty_annotation": None, - "config_suitable_for_bulk_annotation": None, - "task_number": "integer", - "workspace_title": None, - "total_predictions_number": "integer", - "is_published": None, - "is_draft": None, - "description": None, - "rejected": None, - "custom_script": None, - "workspace": None, + "color": None, "show_ground_truth_first": None, - "expert_instruction": None, - "allow_stream": None, + "overlap_cohort_percentage": "integer", + "custom_script": None, "reviewer_queue_total": None, - "created_at": "datetime", + "members_count": None, + "custom_task_lock_ttl": "integer", "annotator_evaluation_minimum_tasks": "integer", - "review_total_tasks": None, - "min_annotations_to_start_training": "integer", + "members": None, + "finished_task_number": "integer", + "pinned_at": "datetime", + "duplication_done": None, + "num_tasks_with_annotations": None, + "config_suitable_for_bulk_annotation": None, + "created_at": "datetime", + "pause_on_failed_annotator_evaluation": None, + "reviewed_number": None, "label_config": None, - "created_by": {"id": "integer", "avatar": None}, - "maximum_annotations": "integer", - "evaluate_predictions_automatically": None, + "skip_queue": None, + "skipped_annotations_number": None, "annotator_evaluation_minimum_score": None, - "model_version": None, + "title": None, "useful_annotation_number": None, - "has_blueprints": None, - "pause_on_failed_annotator_evaluation": None, - "show_instruction": None, - "queue_left": None, - "custom_task_lock_ttl": "integer", - "pinned_at": "datetime", + "total_annotations_number": None, + "allow_stream": None, + "sampling": None, + "annotation_limit_count": "integer", + "control_weights": None, + "ground_truth_number": "integer", + "expert_instruction": None, + "parsed_label_config": None, "ready": None, - "description_short": None, - "show_overlap_first": None, - "reveal_preannotations_interactively": None, "comment_classification_config": None, - "show_skip_button": None, - "data_types": None, - "organization": "integer", - "show_collab_predictions": None, - "reviewed_number": None, - "prompts": None, - "overlap_cohort_percentage": "integer", + "description_short": None, + "config_has_control_tags": None, + "model_version": None, + "is_published": None, + "rejected": None, + "min_annotations_to_start_training": "integer", + "description": None, + "queue_left": None, + "total_predictions_number": "integer", "duplication_status": None, - "skipped_annotations_number": None, + "show_collab_predictions": None, + "show_annotation_history": None, + "id": "integer", + "assignment_settings": {"id": "integer"}, + "workspace_title": None, + "has_blueprints": None, + "workspace": None, + "show_instruction": None, + "maximum_annotations": "integer", + "require_comment_on_skip": None, + "review_total_tasks": None, + "created_by": {"id": "integer", "avatar": None}, + "queue_done": None, + "task_number": "integer", "blueprints": ( "list", {0: {"id": "integer", "share_id": None, "short_url": None, "created_at": "datetime"}}, ), - "sampling": None, - "color": None, - "title": None, - "skip_queue": None, - "review_settings": {"id": "integer", "requeue_rejected_tasks_to_annotator": None}, - "num_tasks_with_annotations": None, - "assignment_settings": {"id": "integer"}, - "require_comment_on_skip": None, - "annotation_limit_count": "integer", - "queue_done": None, - "show_annotation_history": None, + "show_overlap_first": None, "queue_total": None, - "parsed_label_config": None, + "evaluate_predictions_automatically": None, + "prompts": None, + "review_settings": {"id": "integer", "requeue_rejected_tasks_to_annotator": None}, + "show_skip_button": None, + "data_types": None, + "enable_empty_annotation": None, + "is_draft": None, + "start_training_on_annotation_update": None, } }, ), From 1e7f4dc66d88f43d11b22ad6ba3ac659c6b84e64 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 01:05:45 +0000 Subject: [PATCH 2/2] SDK regeneration --- .mock/definition/__package__.yml | 343 ++++--- .mock/definition/billing.yml | 244 +++++ .mock/definition/organizations.yml | 236 ----- .mock/definition/organizations/members.yml | 168 ++++ .mock/definition/projectTemplates.yml | 2 +- .mock/definition/projects.yml | 132 +-- .mock/definition/prompts.yml | 128 +-- .mock/openapi/openapi.yaml | 893 +++++++++++++----- reference.md | 286 ++++++ src/label_studio_sdk/__init__.py | 20 + src/label_studio_sdk/base_client.py | 4 + src/label_studio_sdk/billing/__init__.py | 2 + src/label_studio_sdk/billing/client.py | 112 +++ .../organizations/members/client.py | 350 ++++++- src/label_studio_sdk/projects/client.py | 12 + src/label_studio_sdk/types/__init__.py | 18 + .../types/all_roles_project_list.py | 190 ++-- src/label_studio_sdk/types/billing_checks.py | 39 + src/label_studio_sdk/types/billing_flags.py | 44 + .../types/billing_info_response.py | 22 + src/label_studio_sdk/types/count_limit.py | 22 + .../types/lse_organization_member_list.py | 32 + .../lse_user_organization_member_list.py | 48 + ...nated_lse_organization_member_list_list.py | 23 + .../types/prompts_status_enum.py | 16 + src/label_studio_sdk/types/role9e7enum.py | 5 + tests/organizations/test_members.py | 149 +++ tests/test_billing.py | 114 +++ tests/test_prompts.py | 240 ++--- 29 files changed, 2941 insertions(+), 953 deletions(-) create mode 100644 .mock/definition/billing.yml create mode 100644 src/label_studio_sdk/billing/__init__.py create mode 100644 src/label_studio_sdk/billing/client.py create mode 100644 src/label_studio_sdk/types/billing_checks.py create mode 100644 src/label_studio_sdk/types/billing_flags.py create mode 100644 src/label_studio_sdk/types/billing_info_response.py create mode 100644 src/label_studio_sdk/types/count_limit.py create mode 100644 src/label_studio_sdk/types/lse_organization_member_list.py create mode 100644 src/label_studio_sdk/types/lse_user_organization_member_list.py create mode 100644 src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py create mode 100644 src/label_studio_sdk/types/prompts_status_enum.py create mode 100644 src/label_studio_sdk/types/role9e7enum.py create mode 100644 tests/test_billing.py diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index e4b7f6501..b0daaa91a 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -187,27 +187,79 @@ types: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: + model_version: + type: optional + docs: Machine learning model version reveal_preannotations_interactively: type: optional docs: Reveal pre-annotations interactively - organization: optional - annotation_limit_percent: + config_suitable_for_bulk_annotation: + type: boolean + docs: Flag to detect is project ready for bulk annotation + custom_script: optional + reviewed_number: string + show_skip_button: + type: optional + docs: Show a skip button in interface and allow annotators to skip the task + workspace: string + rejected: string + created_by: + type: optional + docs: Project owner + is_draft: + type: optional + docs: Whether or not the project is in the middle of being created + parsed_label_config: unknown + blueprints: list + allow_stream: string + members_count: integer + label_config: type: optional + docs: Label config in XML format. See more about it in documentation + maximum_annotations: + type: optional + docs: >- + Maximum number of annotations for one task. If the number of + annotations per task is equal or greater to this value, the task is + completed (is_labeled=True) validation: - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - color: - type: optional + min: -2147483648 + max: 2147483647 + show_instruction: + type: optional + docs: Show instructions to the annotator before they start + total_annotations_number: string + reviewer_queue_total: string + show_overlap_first: optional + comment_classification_config: optional + created_at: datetime + useful_annotation_number: string + min_annotations_to_start_training: + type: optional + docs: >- + Minimum number of completed tasks after which model training is + started validation: - maxLength: 16 - show_ground_truth_first: optional + min: -2147483648 + max: 2147483647 + organization: optional overlap_cohort_percentage: type: optional validation: min: -2147483648 max: 2147483647 - custom_script: optional - reviewer_queue_total: string - members_count: string + show_annotation_history: + type: optional + docs: Show annotation history to annotator + config_has_control_tags: + type: boolean + docs: Flag to detect is project ready for labeling + id: integer + pinned_at: + type: optional + docs: Pinned date and time + review_settings: ReviewSettings + data_types: unknown custom_task_lock_ttl: type: optional docs: TTL in seconds for task reservations, on new and existing tasks @@ -219,137 +271,85 @@ types: default: 10 validation: min: 0 - members: string - finished_task_number: integer - pinned_at: - type: optional - docs: Pinned date and time + annotation_limit_percent: + type: optional + validation: + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + annotation_limit_count: + type: optional + validation: + min: 1 + ready: string + evaluate_predictions_automatically: + type: optional + docs: Retrieve and display predictions when loading a task + duplication_status: optional + prompts: string + skipped_annotations_number: string + enable_empty_annotation: + type: optional + docs: Allow annotators to submit empty annotations + color: + type: optional + validation: + maxLength: 16 + start_training_on_annotation_update: + type: boolean + docs: Start model training after any annotations are submitted or updated + queue_left: string + description_short: string duplication_done: type: optional default: false - num_tasks_with_annotations: string - config_suitable_for_bulk_annotation: - type: boolean - docs: Flag to detect is project ready for bulk annotation - created_at: datetime + members: string pause_on_failed_annotator_evaluation: type: optional default: false - reviewed_number: string - label_config: - type: optional - docs: Label config in XML format. See more about it in documentation - skip_queue: optional - skipped_annotations_number: string - annotator_evaluation_minimum_score: - type: optional - default: '95.00' - validation: - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + has_blueprints: string + show_collab_predictions: + type: optional + docs: If set, the annotator can view model predictions title: type: optional docs: Project name. Must be between 3 and 50 characters long. validation: minLength: 3 maxLength: 50 - useful_annotation_number: string - total_annotations_number: string - allow_stream: string - sampling: optional - annotation_limit_count: - type: optional - validation: - min: 1 - control_weights: optional - ground_truth_number: - type: integer - docs: Honeypot annotation number in project + total_predictions_number: integer + review_total_tasks: string expert_instruction: type: optional docs: Labeling instructions in HTML format - parsed_label_config: unknown - ready: string - comment_classification_config: optional - description_short: string - config_has_control_tags: - type: boolean - docs: Flag to detect is project ready for labeling - model_version: + num_tasks_with_annotations: string + annotator_evaluation_minimum_score: type: optional - docs: Machine learning model version - is_published: - type: optional - docs: Whether or not the project is published to annotators - rejected: string - min_annotations_to_start_training: - type: optional - docs: >- - Minimum number of completed tasks after which model training is - started + default: '95.00' validation: - min: -2147483648 - max: 2147483647 - description: - type: optional - docs: Project description - queue_left: string - total_predictions_number: integer - duplication_status: optional - show_collab_predictions: - type: optional - docs: If set, the annotator can view model predictions - show_annotation_history: - type: optional - docs: Show annotation history to annotator - id: integer + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + finished_task_number: integer + task_number: + type: integer + docs: Total task number in project + control_weights: optional + queue_done: string + show_ground_truth_first: optional assignment_settings: AssignmentSettings - workspace_title: string - has_blueprints: string - workspace: string - show_instruction: - type: optional - docs: Show instructions to the annotator before they start - maximum_annotations: - type: optional - docs: >- - Maximum number of annotations for one task. If the number of - annotations per task is equal or greater to this value, the task is - completed (is_labeled=True) - validation: - min: -2147483648 - max: 2147483647 require_comment_on_skip: type: optional default: false - review_total_tasks: string - created_by: - type: optional - docs: Project owner - queue_done: string - task_number: + ground_truth_number: type: integer - docs: Total task number in project - blueprints: list - show_overlap_first: optional + docs: Honeypot annotation number in project + skip_queue: optional + workspace_title: string + sampling: optional queue_total: string - evaluate_predictions_automatically: - type: optional - docs: Retrieve and display predictions when loading a task - prompts: string - review_settings: ReviewSettings - show_skip_button: - type: optional - docs: Show a skip button in interface and allow annotators to skip the task - data_types: unknown - enable_empty_annotation: - type: optional - docs: Allow annotators to submit empty annotations - is_draft: + is_published: type: optional - docs: Whether or not the project is in the middle of being created - start_training_on_annotation_update: - type: boolean - docs: Start model training after any annotations are submitted or updated + docs: Whether or not the project is published to annotators + description: + type: optional + docs: Project description source: openapi: openapi/openapi.yaml AnnotatedEnum: @@ -1363,6 +1363,73 @@ types: results: list source: openapi: openapi/openapi.yaml + BillingChecks: + properties: + users: CountLimit + projects: CountLimit + results: CountLimit + trial_days: integer + organization_is_active: boolean + license_issued: + type: optional + validation: + format: date + license_warning: + type: optional + validation: + format: date + is_license_warning: boolean + license_expires: + type: optional + validation: + format: date + is_license_expired: boolean + prompts_enabled: boolean + prompts_status: PromptsStatusEnum + prompts_warning: optional + is_prompts_warning: boolean + prompts_expire: optional + is_prompts_expire: boolean + prompts_api_keys_enabled: boolean + import_storages: CountLimit + export_storages: CountLimit + source: + openapi: openapi/openapi.yaml + BillingFlags: + properties: + activated_at: optional + cloud_instance: boolean + allow_activity_log: boolean + allow_invite_project_experts: boolean + allow_sso: boolean + white_label_id: optional + allow_data_credentials: boolean + allow_organization_webhooks: boolean + disable_members_page: boolean + secure_mode: boolean + manual_workspace_management: boolean + manual_role_management: boolean + hide_storage_settings_for_manager: boolean + disable_project_imports: boolean + automax_token_exists: boolean + automax_enabled: boolean + storage_persistence: boolean + allow_ai: boolean + early_adopter: boolean + allow_ask_ai: boolean + allow_invite_people: boolean + allow_storage_proxy: boolean + embed_enabled: boolean + embed_domains: optional>> + embed_settings: optional> + source: + openapi: openapi/openapi.yaml + BillingInfoResponse: + properties: + billing_checks: BillingChecks + billing_flags: BillingFlags + source: + openapi: openapi/openapi.yaml BlankEnum: literal<""> Blueprint: properties: @@ -1573,6 +1640,14 @@ types: docs: Traceback report in case of errors source: openapi: openapi/openapi.yaml + CountLimit: + properties: + count: integer + limit: integer + reached: boolean + total: optional + source: + openapi: openapi/openapi.yaml CustomScriptsEditableByEnum: enum: - AD @@ -3390,7 +3465,7 @@ types: data_types: unknown reviewer_queue_total: string queue_left: string - members_count: string + members_count: integer custom_task_lock_ttl: type: optional docs: TTL in seconds for task reservations, on new and existing tasks @@ -5878,6 +5953,38 @@ types: organization: optional source: openapi: openapi/openapi.yaml + PromptsStatusEnum: + enum: + - Enabled + - value: Cloud license per organization disabled + name: CloudLicensePerOrganizationDisabled + - value: On-premise global license disabled + name: OnPremiseGlobalLicenseDisabled + - Expired + - value: Adala not connected + name: AdalaNotConnected + - value: Disabled for this organization [FF] + name: DisabledForThisOrganizationFf + - unknown + docs: >- + * `Enabled` - Enabled + + * `Cloud license per organization disabled` - Cloud license per + organization disabled + + * `On-premise global license disabled` - On-premise global license + disabled + + * `Expired` - Expired + + * `Adala not connected` - Adala not connected + + * `Disabled for this organization [FF]` - Disabled for this organization + [FF] + + * `unknown` - unknown + source: + openapi: openapi/openapi.yaml ProviderEnum: enum: - OpenAI diff --git a/.mock/definition/billing.yml b/.mock/definition/billing.yml new file mode 100644 index 000000000..8f39d6a46 --- /dev/null +++ b/.mock/definition/billing.yml @@ -0,0 +1,244 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + info: + path: /api/billing/info + method: GET + auth: true + docs: Retrieve billing checks and feature flags for the active organization. + source: + openapi: openapi/openapi.yaml + display-name: Get billing info + response: + docs: Billing information for the active organization + type: root.BillingInfoResponse + examples: + - name: real-sample + response: + body: + billing_checks: + users: + count: 110 + limit: 1000 + reached: false + total: 221 + projects: + count: 2044 + limit: 1000000 + reached: false + total: 1 + results: + count: 42949 + limit: 1000000000 + reached: false + total: 1 + trial_days: 0 + organization_is_active: true + license_issued: '2000-01-01' + license_warning: '2030-01-01' + is_license_warning: false + license_expires: '2030-01-02' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: prompts_warning + is_prompts_warning: false + prompts_expire: prompts_expire + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + total: 1 + export_storages: + count: 0 + limit: 0 + reached: false + total: 1 + billing_flags: + activated_at: '2024-01-15T09:30:00Z' + cloud_instance: true + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: true + white_label_id: white_label_id + allow_data_credentials: false + allow_organization_webhooks: false + disable_members_page: false + secure_mode: false + manual_workspace_management: true + manual_role_management: true + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: true + automax_enabled: true + storage_persistence: true + allow_ai: true + early_adopter: true + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: true + embed_domains: + - domain: http://localhost:3000 + - domain: https://purple-zoos-flash.loca.lt + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: .... + - name: cloud + response: + body: + billing_checks: + users: + count: 5 + limit: 10 + reached: false + total: 6 + projects: + count: 3 + limit: 50 + reached: false + total: 1 + results: + count: 100 + limit: 1000 + reached: false + total: 1 + trial_days: 14 + organization_is_active: true + license_issued: '2023-01-01' + license_warning: '2024-12-01' + is_license_warning: false + license_expires: '2025-01-01' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: prompts_warning + is_prompts_warning: false + prompts_expire: '2024-12-31' + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + total: 1 + export_storages: + count: 0 + limit: 0 + reached: false + total: 1 + billing_flags: + activated_at: '2023-01-01T00:00:00Z' + cloud_instance: true + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: false + white_label_id: white_label_id + allow_data_credentials: true + allow_organization_webhooks: true + disable_members_page: false + secure_mode: false + manual_workspace_management: false + manual_role_management: false + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: false + automax_enabled: true + storage_persistence: true + allow_ai: true + early_adopter: false + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: false + embed_domains: + - domain: http://localhost:3000 + - domain: https://example.com + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: .... + - name: enterprise + response: + body: + billing_checks: + users: + count: 20 + limit: 100 + reached: false + total: 22 + projects: + count: 15 + limit: 200 + reached: false + total: 1 + results: + count: 25000 + limit: 100000 + reached: false + total: 1 + trial_days: 0 + organization_is_active: true + license_issued: '2023-01-01' + license_warning: '2024-12-01' + is_license_warning: false + license_expires: '2025-01-01' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: prompts_warning + is_prompts_warning: false + prompts_expire: prompts_expire + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + total: 1 + export_storages: + count: 0 + limit: 0 + reached: false + total: 1 + billing_flags: + activated_at: '2024-01-15T09:30:00Z' + cloud_instance: false + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: true + white_label_id: wl-1 + allow_data_credentials: true + allow_organization_webhooks: true + disable_members_page: false + secure_mode: false + manual_workspace_management: false + manual_role_management: false + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: true + automax_enabled: true + storage_persistence: true + allow_ai: false + early_adopter: true + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: false + embed_domains: + - domain: http://localhost:3000 + - domain: https://example.com + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: .... + audiences: + - public + source: + openapi: openapi/openapi.yaml diff --git a/.mock/definition/organizations.yml b/.mock/definition/organizations.yml index 9b27c1d91..80d05e163 100644 --- a/.mock/definition/organizations.yml +++ b/.mock/definition/organizations.yml @@ -157,242 +157,6 @@ service: custom_scripts_enabled: custom_scripts_enabled custom_scripts_editable_by: AD email_notification_settings: email_notification_settings - api_organizations_memberships_list: - path: /api/organizations/{id}/memberships - method: GET - auth: true - docs: Retrieve a list of all users and roles in a specific organization. - source: - openapi: openapi/openapi.yaml - path-parameters: - id: - type: integer - docs: A unique integer value identifying this organization. - display-name: Get organization members/roles - request: - name: ApiOrganizationsMembershipsListRequest - query-parameters: - exclude_project_id: - type: optional - docs: >- - Project ID to exclude users who are already associated with this - project (direct members, workspace members, or implicit - admin/owner access). - exclude_workspace_id: - type: optional - docs: >- - Workspace ID to exclude users who are already associated with this - workspace (direct workspace members or implicit admin/owner - access). - ordering: - type: optional - docs: Which field to use when ordering the results. - page: - type: optional - docs: A page number within the paginated result set. - page_size: - type: optional - docs: Number of results to return per page. - search: - type: optional - docs: A search term. - response: - docs: '' - type: root.PaginatedLseOrganizationMemberListList - examples: - - path-parameters: - id: 1 - response: - body: - count: 123 - next: http://api.example.org/accounts/?page=4 - previous: http://api.example.org/accounts/?page=2 - results: - - id: 1 - organization: 1 - user: - id: 1 - username: username - last_activity: '2024-01-15T09:30:00Z' - avatar: avatar - initials: initials - lse_fields: - invite_expired: invite_expired - invite_expired_at: invite_expired_at - email_notification_settings: email_notification_settings - pause: pause - created_projects: created_projects - contributed_to_projects: contributed_to_projects - role: role - api_organizations_memberships_create: - path: /api/organizations/{id}/memberships - method: POST - auth: true - docs: |2- - - Assign a role to a user in an organization. To do so, make the following cURL request: - - ```bash - curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \ - -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships' --data '[{{"user_id": Int, "role": "NO|DI|OW|AD|MA|AN|RE" }}]' - ``` - - Enumerate a role with one of the following abbreviations: - - | Role | Full Role Name | - | --- | --- | - | NO | Not Activated | - | DI | Deactivated | - | OW | Owner | - | AD | Administrator | - | MA | Manager | - | AN | Annotator | - | RE | Reviewer | - - For example, to set a user with an ID of 9 as an annotator, make the following cURL request: - ```bash - curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \ - -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships' --data '[{{"user_id": 9, "role": "AN" }}]' - ``` - - source: - openapi: openapi/openapi.yaml - path-parameters: - id: - type: integer - docs: A unique integer value identifying this organization. - display-name: Create organization member/role - request: - name: OrganizationMemberCreateUpdateRequest - body: - properties: - user_id: integer - role: root.Role9E7Enum - content-type: application/json - response: - docs: '' - type: root.LseOrganizationMemberList - examples: - - path-parameters: - id: 1 - request: - user_id: 1 - role: OW - response: - body: - id: 1 - organization: 1 - user: - id: 1 - first_name: first_name - last_name: last_name - username: username - email: email - last_activity: '2024-01-15T09:30:00Z' - custom_hotkeys: - key: value - avatar: avatar - initials: initials - phone: phone - active_organization: 1 - allow_newsletters: true - date_joined: '2024-01-15T09:30:00Z' - lse_fields: - invite_expired: invite_expired - invite_expired_at: invite_expired_at - invited_at: '2024-01-15T09:30:00Z' - invite_activated: true - trial_company: trial_company - trial_role: annotator - trial_models_in_production: trial_models_in_production - trial_experience_labeling: trial_experience_labeling - trial_license_enterprise: true - social_auth_finished: true - invited_by: 1 - onboarding_state: not_started - email_notification_settings: email_notification_settings - pause: pause - created_projects: created_projects - contributed_to_projects: contributed_to_projects - role: role - api_organizations_memberships_partial_update: - path: /api/organizations/{id}/memberships - method: PATCH - auth: true - docs: |2- - - Update organization membership or role for a specific user ID. - - **User Rotation Best Practices for API Usage** - - To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: - - * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. - - * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. - - * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. - - * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. - - source: - openapi: openapi/openapi.yaml - path-parameters: - id: - type: integer - docs: A unique integer value identifying this organization. - display-name: Update organization member/role - request: - name: PatchedOrganizationMemberCreateUpdateRequest - body: - properties: - user_id: optional - role: optional - content-type: application/json - response: - docs: '' - type: root.LseOrganizationMemberList - examples: - - path-parameters: - id: 1 - request: {} - response: - body: - id: 1 - organization: 1 - user: - id: 1 - first_name: first_name - last_name: last_name - username: username - email: email - last_activity: '2024-01-15T09:30:00Z' - custom_hotkeys: - key: value - avatar: avatar - initials: initials - phone: phone - active_organization: 1 - allow_newsletters: true - date_joined: '2024-01-15T09:30:00Z' - lse_fields: - invite_expired: invite_expired - invite_expired_at: invite_expired_at - invited_at: '2024-01-15T09:30:00Z' - invite_activated: true - trial_company: trial_company - trial_role: annotator - trial_models_in_production: trial_models_in_production - trial_experience_labeling: trial_experience_labeling - trial_license_enterprise: true - social_auth_finished: true - invited_by: 1 - onboarding_state: not_started - email_notification_settings: email_notification_settings - pause: pause - created_projects: created_projects - contributed_to_projects: contributed_to_projects - role: role api_organizations_set_default_role_partial_update: path: /api/organizations/{id}/set-default-role method: PATCH diff --git a/.mock/definition/organizations/members.yml b/.mock/definition/organizations/members.yml index ba50350df..3bfec0a23 100644 --- a/.mock/definition/organizations/members.yml +++ b/.mock/definition/organizations/members.yml @@ -4,6 +4,174 @@ service: auth: false base-path: '' endpoints: + list: + path: /api/organizations/{id}/memberships + method: GET + auth: true + docs: Retrieve a list of all users and roles in a specific organization. + source: + openapi: openapi/openapi.yaml + path-parameters: + id: + type: integer + docs: A unique integer value identifying this organization. + display-name: Get organization members/roles + request: + name: MembersListRequest + query-parameters: + exclude_project_id: + type: optional + docs: >- + Project ID to exclude users who are already associated with this + project (direct members, workspace members, or implicit + admin/owner access). + exclude_workspace_id: + type: optional + docs: >- + Workspace ID to exclude users who are already associated with this + workspace (direct workspace members or implicit admin/owner + access). + ordering: + type: optional + docs: Which field to use when ordering the results. + page: + type: optional + docs: A page number within the paginated result set. + page_size: + type: optional + docs: Number of results to return per page. + search: + type: optional + docs: A search term. + response: + docs: '' + type: root.PaginatedLseOrganizationMemberListList + examples: + - path-parameters: + id: 1 + response: + body: + count: 123 + next: http://api.example.org/accounts/?page=4 + previous: http://api.example.org/accounts/?page=2 + results: + - id: 1 + organization: 1 + user: + id: 1 + username: username + last_activity: '2024-01-15T09:30:00Z' + avatar: avatar + initials: initials + lse_fields: + invite_expired: invite_expired + invite_expired_at: invite_expired_at + email_notification_settings: email_notification_settings + pause: pause + created_projects: created_projects + contributed_to_projects: contributed_to_projects + role: role + audiences: + - public + update: + path: /api/organizations/{id}/memberships + method: PATCH + auth: true + docs: >+ + Update organization membership or role for a specific user ID. + + + **User Rotation Best Practices for API Usage** + + + To maintain compliance with our licensing terms and ensure optimal + performance of HumanSignal's APIs, please consider the following + guidelines when managing user assignments: + + + * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is + assigned to a user, maintain that assignment for at least seven + consecutive days before rotating it to another user. + + + * **Automate, Monitor, and Log Rotations**: Implement automated + scheduling and logging mechanisms to track the timing of user rotations. + This helps ensure that rotations adhere to the seven-day minimum period. + + + * **Adhere to API Update Frequency and Wait Periods**: When updating + user assignments via our APIs, follow the recommended frequency and wait + period guidelines provided in the HumanSignal API documentation. Avoid + sending rapid, successive requests that might overload the endpoint. + Instead, incorporate appropriate delays between calls as specified in + the documentation. + + + * **Avoid Overloading the API Endpoint**: Design your integration to + batch or schedule updates where possible, and implement backoff + strategies if the API indicates rate limiting. This helps prevent + service disruptions and ensures a smooth operation. + + source: + openapi: openapi/openapi.yaml + path-parameters: + id: + type: integer + docs: A unique integer value identifying this organization. + display-name: Update organization member/role + request: + name: PatchedOrganizationMemberCreateUpdateRequest + body: + properties: + user_id: optional + role: optional + content-type: application/json + response: + docs: '' + type: root.LseOrganizationMemberList + examples: + - path-parameters: + id: 1 + request: {} + response: + body: + id: 1 + organization: 1 + user: + id: 1 + first_name: first_name + last_name: last_name + username: username + email: email + last_activity: '2024-01-15T09:30:00Z' + custom_hotkeys: + key: value + avatar: avatar + initials: initials + phone: phone + active_organization: 1 + allow_newsletters: true + date_joined: '2024-01-15T09:30:00Z' + lse_fields: + invite_expired: invite_expired + invite_expired_at: invite_expired_at + invited_at: '2024-01-15T09:30:00Z' + invite_activated: true + trial_company: trial_company + trial_role: annotator + trial_models_in_production: trial_models_in_production + trial_experience_labeling: trial_experience_labeling + trial_license_enterprise: true + social_auth_finished: true + invited_by: 1 + onboarding_state: not_started + email_notification_settings: email_notification_settings + pause: pause + created_projects: created_projects + contributed_to_projects: contributed_to_projects + role: role + audiences: + - public get: path: /api/organizations/{id}/memberships/{user_pk}/ method: GET diff --git a/.mock/definition/projectTemplates.yml b/.mock/definition/projectTemplates.yml index 0c08df9f8..2154b4775 100644 --- a/.mock/definition/projectTemplates.yml +++ b/.mock/definition/projectTemplates.yml @@ -350,7 +350,7 @@ service: key: value reviewer_queue_total: reviewer_queue_total queue_left: queue_left - members_count: members_count + members_count: 1 custom_task_lock_ttl: 1 prompts: prompts annotation_limit_count: 1 diff --git a/.mock/definition/projects.yml b/.mock/definition/projects.yml index c7057d197..5daf4d61c 100644 --- a/.mock/definition/projects.yml +++ b/.mock/definition/projects.yml @@ -135,6 +135,10 @@ service: useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. + members_limit: + type: optional + default: 10 + docs: Maximum number of members to return. ordering: type: optional docs: Which field to use when ordering the results. @@ -160,89 +164,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - reveal_preannotations_interactively: true - organization: 1 - annotation_limit_percent: annotation_limit_percent - color: color - show_ground_truth_first: true - overlap_cohort_percentage: 1 - custom_script: custom_script - reviewer_queue_total: reviewer_queue_total - members_count: members_count - custom_task_lock_ttl: 1 - annotator_evaluation_minimum_tasks: 1 - members: members - finished_task_number: 1 - pinned_at: '2024-01-15T09:30:00Z' - duplication_done: true - num_tasks_with_annotations: num_tasks_with_annotations + - model_version: model_version + reveal_preannotations_interactively: true config_suitable_for_bulk_annotation: true - created_at: '2024-01-15T09:30:00Z' - pause_on_failed_annotator_evaluation: true + custom_script: custom_script reviewed_number: reviewed_number - label_config: label_config - skip_queue: REQUEUE_FOR_ME - skipped_annotations_number: skipped_annotations_number - annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - title: title - useful_annotation_number: useful_annotation_number - total_annotations_number: total_annotations_number - allow_stream: allow_stream - sampling: Sequential sampling - annotation_limit_count: 1 - control_weights: - key: value - ground_truth_number: 1 - expert_instruction: expert_instruction - parsed_label_config: - key: value - ready: ready - comment_classification_config: comment_classification_config - description_short: description_short - config_has_control_tags: true - model_version: model_version - is_published: true - rejected: rejected - min_annotations_to_start_training: 1 - description: description - queue_left: queue_left - total_predictions_number: 1 - duplication_status: duplication_status - show_collab_predictions: true - show_annotation_history: true - id: 1 - assignment_settings: - id: 1 - workspace_title: workspace_title - has_blueprints: has_blueprints + show_skip_button: true workspace: workspace - show_instruction: true - maximum_annotations: 1 - require_comment_on_skip: true - review_total_tasks: review_total_tasks + rejected: rejected created_by: id: 1 avatar: avatar - queue_done: queue_done - task_number: 1 + is_draft: true + parsed_label_config: + key: value blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' + allow_stream: allow_stream + members_count: 1 + label_config: label_config + maximum_annotations: 1 + show_instruction: true + total_annotations_number: total_annotations_number + reviewer_queue_total: reviewer_queue_total show_overlap_first: true - queue_total: queue_total - evaluate_predictions_automatically: true - prompts: prompts + comment_classification_config: comment_classification_config + created_at: '2024-01-15T09:30:00Z' + useful_annotation_number: useful_annotation_number + min_annotations_to_start_training: 1 + organization: 1 + overlap_cohort_percentage: 1 + show_annotation_history: true + config_has_control_tags: true + id: 1 + pinned_at: '2024-01-15T09:30:00Z' review_settings: id: 1 requeue_rejected_tasks_to_annotator: true - show_skip_button: true data_types: key: value + custom_task_lock_ttl: 1 + annotator_evaluation_minimum_tasks: 1 + annotation_limit_percent: annotation_limit_percent + annotation_limit_count: 1 + ready: ready + evaluate_predictions_automatically: true + duplication_status: duplication_status + prompts: prompts + skipped_annotations_number: skipped_annotations_number enable_empty_annotation: true - is_draft: true + color: color start_training_on_annotation_update: true + queue_left: queue_left + description_short: description_short + duplication_done: true + members: members + pause_on_failed_annotator_evaluation: true + has_blueprints: has_blueprints + show_collab_predictions: true + title: title + total_predictions_number: 1 + review_total_tasks: review_total_tasks + expert_instruction: expert_instruction + num_tasks_with_annotations: num_tasks_with_annotations + annotator_evaluation_minimum_score: annotator_evaluation_minimum_score + finished_task_number: 1 + task_number: 1 + control_weights: + key: value + queue_done: queue_done + show_ground_truth_first: true + assignment_settings: + id: 1 + require_comment_on_skip: true + ground_truth_number: 1 + skip_queue: REQUEUE_FOR_ME + workspace_title: workspace_title + sampling: Sequential sampling + queue_total: queue_total + is_published: true + description: description audiences: - public create: diff --git a/.mock/definition/prompts.yml b/.mock/definition/prompts.yml index a956b67c2..38d4480ac 100644 --- a/.mock/definition/prompts.yml +++ b/.mock/definition/prompts.yml @@ -424,89 +424,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - reveal_preannotations_interactively: true - organization: 1 - annotation_limit_percent: annotation_limit_percent - color: color - show_ground_truth_first: true - overlap_cohort_percentage: 1 - custom_script: custom_script - reviewer_queue_total: reviewer_queue_total - members_count: members_count - custom_task_lock_ttl: 1 - annotator_evaluation_minimum_tasks: 1 - members: members - finished_task_number: 1 - pinned_at: '2024-01-15T09:30:00Z' - duplication_done: true - num_tasks_with_annotations: num_tasks_with_annotations + - model_version: model_version + reveal_preannotations_interactively: true config_suitable_for_bulk_annotation: true - created_at: '2024-01-15T09:30:00Z' - pause_on_failed_annotator_evaluation: true + custom_script: custom_script reviewed_number: reviewed_number - label_config: label_config - skip_queue: REQUEUE_FOR_ME - skipped_annotations_number: skipped_annotations_number - annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - title: title - useful_annotation_number: useful_annotation_number - total_annotations_number: total_annotations_number - allow_stream: allow_stream - sampling: Sequential sampling - annotation_limit_count: 1 - control_weights: - key: value - ground_truth_number: 1 - expert_instruction: expert_instruction - parsed_label_config: - key: value - ready: ready - comment_classification_config: comment_classification_config - description_short: description_short - config_has_control_tags: true - model_version: model_version - is_published: true - rejected: rejected - min_annotations_to_start_training: 1 - description: description - queue_left: queue_left - total_predictions_number: 1 - duplication_status: duplication_status - show_collab_predictions: true - show_annotation_history: true - id: 1 - assignment_settings: - id: 1 - workspace_title: workspace_title - has_blueprints: has_blueprints + show_skip_button: true workspace: workspace - show_instruction: true - maximum_annotations: 1 - require_comment_on_skip: true - review_total_tasks: review_total_tasks + rejected: rejected created_by: id: 1 avatar: avatar - queue_done: queue_done - task_number: 1 + is_draft: true + parsed_label_config: + key: value blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' + allow_stream: allow_stream + members_count: 1 + label_config: label_config + maximum_annotations: 1 + show_instruction: true + total_annotations_number: total_annotations_number + reviewer_queue_total: reviewer_queue_total show_overlap_first: true - queue_total: queue_total - evaluate_predictions_automatically: true - prompts: prompts + comment_classification_config: comment_classification_config + created_at: '2024-01-15T09:30:00Z' + useful_annotation_number: useful_annotation_number + min_annotations_to_start_training: 1 + organization: 1 + overlap_cohort_percentage: 1 + show_annotation_history: true + config_has_control_tags: true + id: 1 + pinned_at: '2024-01-15T09:30:00Z' review_settings: id: 1 requeue_rejected_tasks_to_annotator: true - show_skip_button: true data_types: key: value + custom_task_lock_ttl: 1 + annotator_evaluation_minimum_tasks: 1 + annotation_limit_percent: annotation_limit_percent + annotation_limit_count: 1 + ready: ready + evaluate_predictions_automatically: true + duplication_status: duplication_status + prompts: prompts + skipped_annotations_number: skipped_annotations_number enable_empty_annotation: true - is_draft: true + color: color start_training_on_annotation_update: true + queue_left: queue_left + description_short: description_short + duplication_done: true + members: members + pause_on_failed_annotator_evaluation: true + has_blueprints: has_blueprints + show_collab_predictions: true + title: title + total_predictions_number: 1 + review_total_tasks: review_total_tasks + expert_instruction: expert_instruction + num_tasks_with_annotations: num_tasks_with_annotations + annotator_evaluation_minimum_score: annotator_evaluation_minimum_score + finished_task_number: 1 + task_number: 1 + control_weights: + key: value + queue_done: queue_done + show_ground_truth_first: true + assignment_settings: + id: 1 + require_comment_on_skip: true + ground_truth_number: 1 + skip_queue: REQUEUE_FOR_ME + workspace_title: workspace_title + sampling: Sequential sampling + queue_total: queue_total + is_published: true + description: description audiences: - public source: diff --git a/.mock/openapi/openapi.yaml b/.mock/openapi/openapi.yaml index 1aa01f7c4..735377de8 100644 --- a/.mock/openapi/openapi.yaml +++ b/.mock/openapi/openapi.yaml @@ -563,6 +563,238 @@ paths: x-fern-sdk-method-name: create_bulk x-fern-audiences: - public + /api/billing/info: + get: + operationId: api_billing_info_retrieve + description: Retrieve billing checks and feature flags for the active organization. + summary: Get billing info + tags: + - Billing + security: + - Token: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BillingInfoResponse' + examples: + Real-sample: + value: + billing_checks: + users: + count: 110 + total: 221 + limit: 1000 + reached: false + trial_days: 0 + projects: + count: 2044 + limit: 1000000 + reached: false + organization_is_active: true + license_issued: '2000-01-01' + license_warning: '2030-01-01' + is_license_warning: false + license_expires: '2030-01-02' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: null + is_prompts_warning: false + prompts_expire: null + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + export_storages: + count: 0 + limit: 0 + reached: false + results: + count: 42949 + limit: 1000000000 + reached: false + billing_flags: + cloud_instance: true + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: true + white_label_id: null + allow_data_credentials: false + allow_organization_webhooks: false + disable_members_page: false + secure_mode: false + manual_workspace_management: true + manual_role_management: true + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: true + automax_enabled: true + storage_persistence: true + allow_ai: true + early_adopter: true + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: true + embed_domains: + - domain: http://localhost:3000 + - domain: https://purple-zoos-flash.loca.lt + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: '....' + activated_at: null + summary: real-sample + Cloud: + value: + billing_checks: + users: + count: 5 + total: 6 + limit: 10 + reached: false + projects: + count: 3 + limit: 50 + reached: false + results: + count: 100 + limit: 1000 + reached: false + trial_days: 14 + organization_is_active: true + license_issued: '2023-01-01' + license_warning: '2024-12-01' + is_license_warning: false + license_expires: '2025-01-01' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: null + is_prompts_warning: false + prompts_expire: '2024-12-31' + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + export_storages: + count: 0 + limit: 0 + reached: false + billing_flags: + activated_at: '2023-01-01T00:00:00Z' + cloud_instance: true + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: false + white_label_id: null + allow_data_credentials: true + allow_organization_webhooks: true + disable_members_page: false + secure_mode: false + manual_workspace_management: false + manual_role_management: false + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: false + automax_enabled: true + storage_persistence: true + allow_ai: true + early_adopter: false + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: false + embed_domains: + - domain: http://localhost:3000 + - domain: https://example.com + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: '....' + summary: cloud + Enterprise: + value: + billing_checks: + users: + count: 20 + total: 22 + limit: 100 + reached: false + projects: + count: 15 + limit: 200 + reached: false + results: + count: 25000 + limit: 100000 + reached: false + trial_days: 0 + organization_is_active: true + license_issued: '2023-01-01' + license_warning: '2024-12-01' + is_license_warning: false + license_expires: '2025-01-01' + is_license_expired: false + prompts_enabled: true + prompts_status: Enabled + prompts_warning: null + is_prompts_warning: false + prompts_expire: null + is_prompts_expire: false + prompts_api_keys_enabled: true + import_storages: + count: 0 + limit: 0 + reached: false + export_storages: + count: 0 + limit: 0 + reached: false + billing_flags: + activated_at: null + cloud_instance: false + allow_activity_log: true + allow_invite_project_experts: true + allow_sso: true + white_label_id: wl-1 + allow_data_credentials: true + allow_organization_webhooks: true + disable_members_page: false + secure_mode: false + manual_workspace_management: false + manual_role_management: false + hide_storage_settings_for_manager: false + disable_project_imports: false + automax_token_exists: true + automax_enabled: true + storage_persistence: true + allow_ai: false + early_adopter: true + allow_ask_ai: true + allow_invite_people: true + allow_storage_proxy: true + embed_enabled: false + embed_domains: + - domain: http://localhost:3000 + - domain: https://example.com + embed_settings: + public_verify_alg: + - RS256 + public_verify_key: '....' + summary: enterprise + description: Billing information for the active organization + x-fern-sdk-group-name: + - billing + x-fern-sdk-method-name: info + x-fern-audiences: + - public /api/blueprints/: post: operationId: api_blueprints_create @@ -5184,72 +5416,29 @@ paths: schema: $ref: '#/components/schemas/PaginatedLseOrganizationMemberListList' description: '' - post: - operationId: api_organizations_memberships_create - description: "\n Assign a role to a user in an organization. To do so, make\ - \ the following cURL request:\n\n ```bash\n curl -H 'Content-Type: application/json'\ - \ -H 'Authorization: Token abc123' \\\n -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships'\ - \ --data '[{{\"user_id\": Int, \"role\": \"NO|DI|OW|AD|MA|AN|RE\" }}]'\n \ - \ ```\n \n Enumerate a role with one of the following abbreviations:\n\ - \n | Role | Full Role Name |\n | --- | --- |\n | NO | Not Activated\ - \ |\n | DI | Deactivated |\n | OW | Owner |\n | AD | Administrator\ - \ |\n | MA | Manager |\n | AN | Annotator |\n | RE | Reviewer |\n\ - \n For example, to set a user with an ID of 9 as an annotator, make the\ - \ following cURL request:\n ```bash\n curl -H 'Content-Type: application/json'\ - \ -H 'Authorization: Token abc123' \\\n -X POST 'https://label-studio-host/api/organizations/{{id}}/memberships'\ - \ --data '[{{\"user_id\": 9, \"role\": \"AN\" }}]'\n ```\n " - summary: Create organization member/role - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this organization. - required: true - tags: - - Organizations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/OrganizationMemberCreateUpdateRequest' - required: true - security: - - Token: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LseOrganizationMemberList' - description: '' + x-fern-sdk-group-name: + - organizations + - members + x-fern-sdk-method-name: list + x-fern-audiences: + - public patch: operationId: api_organizations_memberships_partial_update - description: "\n Update organization membership or role for a specific user\ - \ ID.\n\n **User Rotation Best Practices for API Usage**\n \n To\ - \ maintain compliance with our licensing terms and ensure optimal performance\ - \ of HumanSignal's APIs, please consider the following guidelines when managing\ - \ user assignments:\n \n * **Maintain a 7-Day Minimum Assignment**:\ - \ Once a licensed seat is assigned to a user, maintain that assignment for\ - \ at least seven consecutive days before rotating it to another user.\n\n\ - \ * **Automate, Monitor, and Log Rotations**: Implement automated scheduling\ - \ and logging mechanisms to track the timing of user rotations. This helps\ - \ ensure that rotations adhere to the seven-day minimum period.\n\n * **Adhere\ - \ to API Update Frequency and Wait Periods**: When updating user assignments\ - \ via our APIs, follow the recommended frequency and wait period guidelines\ - \ provided in the HumanSignal API documentation. Avoid sending rapid, successive\ - \ requests that might overload the endpoint. Instead, incorporate appropriate\ - \ delays between calls as specified in the documentation.\n \n * **Avoid\ - \ Overloading the API Endpoint**: Design your integration to batch or schedule\ - \ updates where possible, and implement backoff strategies if the API indicates\ - \ rate limiting. This helps prevent service disruptions and ensures a smooth\ - \ operation.\n " + description: |+ + Update organization membership or role for a specific user ID. + + **User Rotation Best Practices for API Usage** + + To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: + + * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. + + * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. + + * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. + + * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. + summary: Update organization member/role parameters: - in: path @@ -5280,6 +5469,12 @@ paths: schema: $ref: '#/components/schemas/LseOrganizationMemberList' description: '' + x-fern-sdk-group-name: + - organizations + - members + x-fern-sdk-method-name: update + x-fern-audiences: + - public /api/organizations/{id}/memberships/{user_pk}/: get: operationId: api_organizations_memberships_retrieve @@ -6071,6 +6266,12 @@ paths: total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.' + - in: query + name: members_limit + schema: + type: integer + default: 10 + description: Maximum number of members to return. - in: query name: ordering schema: @@ -15576,35 +15777,118 @@ components: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: + model_version: + type: string + nullable: true + description: Machine learning model version reveal_preannotations_interactively: type: boolean description: Reveal pre-annotations interactively - organization: - type: integer - nullable: true - annotation_limit_percent: + config_suitable_for_bulk_annotation: + type: boolean + readOnly: true + description: Flag to detect is project ready for bulk annotation + custom_script: type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - color: + reviewed_number: type: string - nullable: true - maxLength: 16 - show_ground_truth_first: + readOnly: true + show_skip_button: type: boolean - overlap_cohort_percentage: + description: Show a skip button in interface and allow annotators to skip + the task + workspace: + type: string + readOnly: true + rejected: + type: string + readOnly: true + created_by: + allOf: + - $ref: '#/components/schemas/UserSimple' + description: Project owner + is_draft: + type: boolean + description: Whether or not the project is in the middle of being created + parsed_label_config: + readOnly: true + description: JSON-formatted labeling configuration + blueprints: + type: array + items: + $ref: '#/components/schemas/BlueprintList' + readOnly: true + allow_stream: + type: string + readOnly: true + members_count: + type: integer + readOnly: true + label_config: + type: string + nullable: true + description: Label config in XML format. See more about it in documentation + maximum_annotations: type: integer maximum: 2147483647 minimum: -2147483648 - custom_script: + title: Maximum annotation number + description: Maximum number of annotations for one task. If the number of + annotations per task is equal or greater to this value, the task is completed + (is_labeled=True) + show_instruction: + type: boolean + description: Show instructions to the annotator before they start + total_annotations_number: type: string + readOnly: true reviewer_queue_total: type: string readOnly: true - members_count: + show_overlap_first: + type: boolean + comment_classification_config: + type: string + created_at: + type: string + format: date-time + readOnly: true + useful_annotation_number: + type: string + readOnly: true + min_annotations_to_start_training: + type: integer + maximum: 2147483647 + minimum: -2147483648 + description: Minimum number of completed tasks after which model training + is started + organization: + type: integer + nullable: true + overlap_cohort_percentage: + type: integer + maximum: 2147483647 + minimum: -2147483648 + show_annotation_history: + type: boolean + description: Show annotation history to annotator + config_has_control_tags: + type: boolean + readOnly: true + description: Flag to detect is project ready for labeling + id: + type: integer + readOnly: true + pinned_at: type: string + format: date-time + nullable: true + description: Pinned date and time + review_settings: + $ref: '#/components/schemas/ReviewSettings' + data_types: readOnly: true + nullable: true custom_task_lock_ttl: type: integer maximum: 86400 @@ -15616,80 +15900,96 @@ components: minimum: 0 nullable: true default: 10 - members: + annotation_limit_percent: type: string - readOnly: true - finished_task_number: + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + nullable: true + annotation_limit_count: type: integer - readOnly: true - pinned_at: - type: string - format: date-time + minimum: 1 nullable: true - description: Pinned date and time - duplication_done: - type: boolean - default: false - num_tasks_with_annotations: + ready: type: string readOnly: true - config_suitable_for_bulk_annotation: + evaluate_predictions_automatically: type: boolean + description: Retrieve and display predictions when loading a task + duplication_status: + type: string + prompts: + type: string readOnly: true - description: Flag to detect is project ready for bulk annotation - created_at: + skipped_annotations_number: type: string - format: date-time readOnly: true - pause_on_failed_annotator_evaluation: + enable_empty_annotation: type: boolean - nullable: true - default: false - reviewed_number: + description: Allow annotators to submit empty annotations + color: type: string + nullable: true + maxLength: 16 + start_training_on_annotation_update: + type: boolean readOnly: true - label_config: + description: Start model training after any annotations are submitted or + updated + queue_left: type: string - nullable: true - description: Label config in XML format. See more about it in documentation - skip_queue: - nullable: true - oneOf: - - $ref: '#/components/schemas/SkipQueueEnum' - - $ref: '#/components/schemas/NullEnum' - skipped_annotations_number: + readOnly: true + description_short: type: string readOnly: true - annotator_evaluation_minimum_score: + duplication_done: + type: boolean + default: false + members: type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + readOnly: true + pause_on_failed_annotator_evaluation: + type: boolean nullable: true - default: '95.00' + default: false + has_blueprints: + type: string + readOnly: true + show_collab_predictions: + type: boolean + title: Show predictions to annotator + description: If set, the annotator can view model predictions title: type: string nullable: true description: Project name. Must be between 3 and 50 characters long. maxLength: 50 minLength: 3 - useful_annotation_number: - type: string + total_predictions_number: + type: integer readOnly: true - total_annotations_number: + review_total_tasks: type: string readOnly: true - allow_stream: + expert_instruction: + type: string + nullable: true + description: Labeling instructions in HTML format + num_tasks_with_annotations: type: string readOnly: true - sampling: + annotator_evaluation_minimum_score: + type: string + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ nullable: true - oneOf: - - $ref: '#/components/schemas/SamplingEnum' - - $ref: '#/components/schemas/NullEnum' - annotation_limit_count: + default: '95.00' + finished_task_number: type: integer - minimum: 1 - nullable: true + readOnly: true + task_number: + type: integer + readOnly: true + description: Total task number in project control_weights: nullable: true description: 'Dict of weights for each control tag in metric calculation. @@ -15700,143 +16000,44 @@ components: be twice more important than Airplaine, then you have to need the specify: {''my_bbox'': {''type'': ''RectangleLabels'', ''labels'': {''Car'': 1.0, ''Airplaine'': 0.5}, ''overall'': 0.33}' - ground_truth_number: - type: integer - readOnly: true - description: Honeypot annotation number in project - expert_instruction: - type: string - nullable: true - description: Labeling instructions in HTML format - parsed_label_config: - readOnly: true - description: JSON-formatted labeling configuration - ready: - type: string - readOnly: true - comment_classification_config: - type: string - description_short: - type: string - readOnly: true - config_has_control_tags: - type: boolean - readOnly: true - description: Flag to detect is project ready for labeling - model_version: - type: string - nullable: true - description: Machine learning model version - is_published: - type: boolean - title: Published - description: Whether or not the project is published to annotators - rejected: - type: string - readOnly: true - min_annotations_to_start_training: - type: integer - maximum: 2147483647 - minimum: -2147483648 - description: Minimum number of completed tasks after which model training - is started - description: - type: string - nullable: true - description: Project description - queue_left: + queue_done: type: string readOnly: true - total_predictions_number: - type: integer - readOnly: true - duplication_status: - type: string - show_collab_predictions: - type: boolean - title: Show predictions to annotator - description: If set, the annotator can view model predictions - show_annotation_history: + show_ground_truth_first: type: boolean - description: Show annotation history to annotator - id: - type: integer - readOnly: true assignment_settings: $ref: '#/components/schemas/AssignmentSettings' - workspace_title: - type: string - readOnly: true - has_blueprints: - type: string - readOnly: true - workspace: - type: string - readOnly: true - show_instruction: - type: boolean - description: Show instructions to the annotator before they start - maximum_annotations: - type: integer - maximum: 2147483647 - minimum: -2147483648 - title: Maximum annotation number - description: Maximum number of annotations for one task. If the number of - annotations per task is equal or greater to this value, the task is completed - (is_labeled=True) require_comment_on_skip: type: boolean default: false - review_total_tasks: - type: string - readOnly: true - created_by: - allOf: - - $ref: '#/components/schemas/UserSimple' - description: Project owner - queue_done: - type: string - readOnly: true - task_number: + ground_truth_number: type: integer readOnly: true - description: Total task number in project - blueprints: - type: array - items: - $ref: '#/components/schemas/BlueprintList' + description: Honeypot annotation number in project + skip_queue: + nullable: true + oneOf: + - $ref: '#/components/schemas/SkipQueueEnum' + - $ref: '#/components/schemas/NullEnum' + workspace_title: + type: string readOnly: true - show_overlap_first: - type: boolean + sampling: + nullable: true + oneOf: + - $ref: '#/components/schemas/SamplingEnum' + - $ref: '#/components/schemas/NullEnum' queue_total: type: string readOnly: true - evaluate_predictions_automatically: + is_published: type: boolean - description: Retrieve and display predictions when loading a task - prompts: + title: Published + description: Whether or not the project is published to annotators + description: type: string - readOnly: true - review_settings: - $ref: '#/components/schemas/ReviewSettings' - show_skip_button: - type: boolean - description: Show a skip button in interface and allow annotators to skip - the task - data_types: - readOnly: true nullable: true - enable_empty_annotation: - type: boolean - description: Allow annotators to submit empty annotations - is_draft: - type: boolean - description: Whether or not the project is in the middle of being created - start_training_on_annotation_update: - type: boolean - readOnly: true - description: Start model training after any annotations are submitted or - updated + description: Project description required: - allow_stream - assignment_settings @@ -17213,6 +17414,169 @@ components: required: - modelrun_id - results + BillingChecks: + type: object + properties: + users: + $ref: '#/components/schemas/CountLimit' + projects: + $ref: '#/components/schemas/CountLimit' + results: + $ref: '#/components/schemas/CountLimit' + trial_days: + type: integer + organization_is_active: + type: boolean + license_issued: + type: string + format: date + nullable: true + license_warning: + type: string + format: date + nullable: true + is_license_warning: + type: boolean + license_expires: + type: string + format: date + nullable: true + is_license_expired: + type: boolean + prompts_enabled: + type: boolean + prompts_status: + $ref: '#/components/schemas/PromptsStatusEnum' + prompts_warning: + type: string + nullable: true + is_prompts_warning: + type: boolean + prompts_expire: + type: string + nullable: true + is_prompts_expire: + type: boolean + prompts_api_keys_enabled: + type: boolean + import_storages: + $ref: '#/components/schemas/CountLimit' + export_storages: + $ref: '#/components/schemas/CountLimit' + required: + - export_storages + - import_storages + - is_license_expired + - is_license_warning + - is_prompts_expire + - is_prompts_warning + - license_expires + - license_issued + - license_warning + - organization_is_active + - projects + - prompts_api_keys_enabled + - prompts_enabled + - prompts_expire + - prompts_status + - prompts_warning + - results + - trial_days + - users + BillingFlags: + type: object + properties: + activated_at: + type: string + format: date-time + nullable: true + cloud_instance: + type: boolean + allow_activity_log: + type: boolean + allow_invite_project_experts: + type: boolean + allow_sso: + type: boolean + white_label_id: + type: string + nullable: true + allow_data_credentials: + type: boolean + allow_organization_webhooks: + type: boolean + disable_members_page: + type: boolean + secure_mode: + type: boolean + manual_workspace_management: + type: boolean + manual_role_management: + type: boolean + hide_storage_settings_for_manager: + type: boolean + disable_project_imports: + type: boolean + automax_token_exists: + type: boolean + automax_enabled: + type: boolean + storage_persistence: + type: boolean + allow_ai: + type: boolean + early_adopter: + type: boolean + allow_ask_ai: + type: boolean + allow_invite_people: + type: boolean + allow_storage_proxy: + type: boolean + embed_enabled: + type: boolean + embed_domains: + type: array + items: + type: object + additionalProperties: {} + embed_settings: + type: object + additionalProperties: {} + required: + - activated_at + - allow_activity_log + - allow_ai + - allow_ask_ai + - allow_data_credentials + - allow_invite_people + - allow_invite_project_experts + - allow_organization_webhooks + - allow_sso + - allow_storage_proxy + - automax_enabled + - automax_token_exists + - cloud_instance + - disable_members_page + - disable_project_imports + - early_adopter + - embed_enabled + - hide_storage_settings_for_manager + - manual_role_management + - manual_workspace_management + - secure_mode + - storage_persistence + - white_label_id + BillingInfoResponse: + type: object + properties: + billing_checks: + $ref: '#/components/schemas/BillingChecks' + billing_flags: + $ref: '#/components/schemas/BillingFlags' + required: + - billing_checks + - billing_flags BlankEnum: enum: - '' @@ -17570,6 +17934,21 @@ components: description: Traceback report in case of errors required: - export_type + CountLimit: + type: object + properties: + count: + type: integer + limit: + type: integer + reached: + type: boolean + total: + type: integer + required: + - count + - limit + - reached CustomScriptsEditableByEnum: enum: - AD @@ -19946,7 +20325,7 @@ components: type: string readOnly: true members_count: - type: string + type: integer readOnly: true custom_task_lock_ttl: type: integer @@ -22782,16 +23161,6 @@ components: - created_at - organization - user - OrganizationMemberCreateUpdateRequest: - type: object - properties: - user_id: - type: integer - role: - $ref: '#/components/schemas/Role9e7Enum' - required: - - role - - user_id OrganizationMembership: type: object properties: @@ -25576,6 +25945,24 @@ components: nullable: true required: - name + PromptsStatusEnum: + enum: + - Enabled + - Cloud license per organization disabled + - On-premise global license disabled + - Expired + - Adala not connected + - Disabled for this organization [FF] + - unknown + type: string + description: |- + * `Enabled` - Enabled + * `Cloud license per organization disabled` - Cloud license per organization disabled + * `On-premise global license disabled` - On-premise global license disabled + * `Expired` - Expired + * `Adala not connected` - Adala not connected + * `Disabled for this organization [FF]` - Disabled for this organization [FF] + * `unknown` - unknown ProviderEnum: enum: - OpenAI diff --git a/reference.md b/reference.md index 793adfc2c..d4de5f4ea 100644 --- a/reference.md +++ b/reference.md @@ -754,6 +754,67 @@ client.annotations.create(
+ +
+ + +## Billing +
client.billing.info() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve billing checks and feature flags for the active organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from label_studio_sdk import LabelStudio + +client = LabelStudio( + api_key="YOUR_API_KEY", +) +client.billing.info() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -6445,6 +6506,14 @@ for page in response.iter_pages():
+**members_limit:** `typing.Optional[int]` — Maximum number of members to return. + +
+
+ +
+
+ **ordering:** `typing.Optional[str]` — Which field to use when ordering the results.
@@ -19272,6 +19341,223 @@ client.import_storage.s3s.validate( ## Organizations Members +
client.organizations.members.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of all users and roles in a specific organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from label_studio_sdk import LabelStudio + +client = LabelStudio( + api_key="YOUR_API_KEY", +) +client.organizations.members.list( + id=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `int` — A unique integer value identifying this organization. + +
+
+ +
+
+ +**exclude_project_id:** `typing.Optional[int]` — Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). + +
+
+ +
+
+ +**exclude_workspace_id:** `typing.Optional[int]` — Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). + +
+
+ +
+
+ +**ordering:** `typing.Optional[str]` — Which field to use when ordering the results. + +
+
+ +
+
+ +**page:** `typing.Optional[int]` — A page number within the paginated result set. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**search:** `typing.Optional[str]` — A search term. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.organizations.members.update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update organization membership or role for a specific user ID. + +**User Rotation Best Practices for API Usage** + +To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: + +* **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. + +* **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. + +* **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. + +* **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from label_studio_sdk import LabelStudio + +client = LabelStudio( + api_key="YOUR_API_KEY", +) +client.organizations.members.update( + id=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `int` — A unique integer value identifying this organization. + +
+
+ +
+
+ +**user_id:** `typing.Optional[int]` + +
+
+ +
+
+ +**role:** `typing.Optional[Role9E7Enum]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+
client.organizations.members.get(...)
diff --git a/src/label_studio_sdk/__init__.py b/src/label_studio_sdk/__init__.py index 85bcd2939..b04c1571d 100644 --- a/src/label_studio_sdk/__init__.py +++ b/src/label_studio_sdk/__init__.py @@ -20,6 +20,9 @@ AzureBlobImportStorage, BatchFailedPredictions, BatchPredictions, + BillingChecks, + BillingFlags, + BillingInfoResponse, BlankEnum, BlueprintList, BudgetResetPeriodEnum, @@ -29,6 +32,7 @@ CommentSerializerWithExpandedUser, ConvertedFormat, ConvertedFormatRequest, + CountLimit, CustomScriptsEditableByEnum, DefaultRoleEnum, EditionEnum, @@ -57,6 +61,7 @@ LseKeyIndicatorValue, LseOrganization, LseOrganizationCustomScriptsEditableBy, + LseOrganizationMemberList, LseProjectCreate, LseProjectCreateSampling, LseProjectCreateSkipQueue, @@ -88,6 +93,7 @@ LseTaskSerializerForReviewersPredictionsItem, LseUser, LseUserApi, + LseUserOrganizationMemberList, LseapiTokenCreate, LseapiTokenList, LsejwtSettings, @@ -110,6 +116,7 @@ OrganizationMember, OrganizationMembership, PaginatedAllRolesProjectListList, + PaginatedLseOrganizationMemberListList, PaginatedRoleBasedTaskList, Pause, PauseRequest, @@ -122,6 +129,7 @@ ProjectSampling, ProjectSkipQueue, ProjectSubsetEnum, + PromptsStatusEnum, ProviderEnum, ReasonEnum, RedisExportStorage, @@ -136,6 +144,7 @@ ReviewSettingsRequeueRejectedTasksMode, ReviewSettingsReviewCriteria, ReviewedEnum, + Role9E7Enum, RoleBasedTask, S3ExportStorage, S3ImportStorage, @@ -178,6 +187,7 @@ from . import ( actions, annotations, + billing, comments, export_storage, files, @@ -307,6 +317,9 @@ "BadRequestError", "BatchFailedPredictions", "BatchPredictions", + "BillingChecks", + "BillingFlags", + "BillingInfoResponse", "BlankEnum", "BlueprintList", "BudgetResetPeriodEnum", @@ -317,6 +330,7 @@ "CommentSerializerWithExpandedUser", "ConvertedFormat", "ConvertedFormatRequest", + "CountLimit", "CustomScriptsEditableByEnum", "DefaultRoleEnum", "EditionEnum", @@ -351,6 +365,7 @@ "LseKeyIndicatorValue", "LseOrganization", "LseOrganizationCustomScriptsEditableBy", + "LseOrganizationMemberList", "LseProjectCreate", "LseProjectCreateRequestSampling", "LseProjectCreateRequestSkipQueue", @@ -384,6 +399,7 @@ "LseTaskSerializerForReviewersPredictionsItem", "LseUser", "LseUserApi", + "LseUserOrganizationMemberList", "LseapiTokenCreate", "LseapiTokenList", "LsejwtSettings", @@ -412,6 +428,7 @@ "OrganizationMember", "OrganizationMembership", "PaginatedAllRolesProjectListList", + "PaginatedLseOrganizationMemberListList", "PaginatedRoleBasedTaskList", "PatchedLseProjectUpdateRequestSampling", "PatchedLseProjectUpdateRequestSkipQueue", @@ -430,6 +447,7 @@ "ProjectsImportTasksResponse", "ProjectsListRequestFilter", "PromptsCompatibleProjectsRequestProjectType", + "PromptsStatusEnum", "ProviderEnum", "ReasonEnum", "RedisExportStorage", @@ -444,6 +462,7 @@ "ReviewSettingsRequeueRejectedTasksMode", "ReviewSettingsReviewCriteria", "ReviewedEnum", + "Role9E7Enum", "RoleBasedTask", "S3ExportStorage", "S3ImportStorage", @@ -513,6 +532,7 @@ "__version__", "actions", "annotations", + "billing", "comments", "export_storage", "files", diff --git a/src/label_studio_sdk/base_client.py b/src/label_studio_sdk/base_client.py index daf3eec93..19c2e27a5 100644 --- a/src/label_studio_sdk/base_client.py +++ b/src/label_studio_sdk/base_client.py @@ -7,6 +7,7 @@ from .core.api_error import ApiError from .core.client_wrapper import SyncClientWrapper from .annotations.client import AnnotationsClient +from .billing.client import BillingClient from .comments.client import CommentsClient from .users.client import UsersClient from .actions.client import ActionsClient @@ -28,6 +29,7 @@ from .workspaces.client import WorkspacesClient from .core.client_wrapper import AsyncClientWrapper from .annotations.client import AsyncAnnotationsClient +from .billing.client import AsyncBillingClient from .comments.client import AsyncCommentsClient from .users.client import AsyncUsersClient from .actions.client import AsyncActionsClient @@ -112,6 +114,7 @@ def __init__( timeout=_defaulted_timeout, ) self.annotations = AnnotationsClient(client_wrapper=self._client_wrapper) + self.billing = BillingClient(client_wrapper=self._client_wrapper) self.comments = CommentsClient(client_wrapper=self._client_wrapper) self.users = UsersClient(client_wrapper=self._client_wrapper) self.actions = ActionsClient(client_wrapper=self._client_wrapper) @@ -196,6 +199,7 @@ def __init__( timeout=_defaulted_timeout, ) self.annotations = AsyncAnnotationsClient(client_wrapper=self._client_wrapper) + self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper) self.comments = AsyncCommentsClient(client_wrapper=self._client_wrapper) self.users = AsyncUsersClient(client_wrapper=self._client_wrapper) self.actions = AsyncActionsClient(client_wrapper=self._client_wrapper) diff --git a/src/label_studio_sdk/billing/__init__.py b/src/label_studio_sdk/billing/__init__.py new file mode 100644 index 000000000..f3ea2659b --- /dev/null +++ b/src/label_studio_sdk/billing/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/label_studio_sdk/billing/client.py b/src/label_studio_sdk/billing/client.py new file mode 100644 index 000000000..3384bd56a --- /dev/null +++ b/src/label_studio_sdk/billing/client.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.client_wrapper import SyncClientWrapper +import typing +from ..core.request_options import RequestOptions +from ..types.billing_info_response import BillingInfoResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + + +class BillingClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse: + """ + Retrieve billing checks and feature flags for the active organization. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BillingInfoResponse + Billing information for the active organization + + Examples + -------- + from label_studio_sdk import LabelStudio + + client = LabelStudio( + api_key="YOUR_API_KEY", + ) + client.billing.info() + """ + _response = self._client_wrapper.httpx_client.request( + "api/billing/info", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BillingInfoResponse, + construct_type( + type_=BillingInfoResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncBillingClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse: + """ + Retrieve billing checks and feature flags for the active organization. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BillingInfoResponse + Billing information for the active organization + + Examples + -------- + import asyncio + + from label_studio_sdk import AsyncLabelStudio + + client = AsyncLabelStudio( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.billing.info() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/billing/info", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BillingInfoResponse, + construct_type( + type_=BillingInfoResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/label_studio_sdk/organizations/members/client.py b/src/label_studio_sdk/organizations/members/client.py index f5eeb8977..4e4604d38 100644 --- a/src/label_studio_sdk/organizations/members/client.py +++ b/src/label_studio_sdk/organizations/members/client.py @@ -1,23 +1,191 @@ # This file was auto-generated by Fern from our API Definition. -from ...core.client_wrapper import SyncClientWrapper import typing +from ...core.client_wrapper import SyncClientWrapper from ...core.request_options import RequestOptions -from ...types.organization_member import OrganizationMember +from ...types.paginated_lse_organization_member_list_list import PaginatedLseOrganizationMemberListList from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type from json.decoder import JSONDecodeError from ...core.api_error import ApiError +from ...types.role9e7enum import Role9E7Enum +from ...types.lse_organization_member_list import LseOrganizationMemberList +from ...types.organization_member import OrganizationMember from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.method_not_allowed_error import MethodNotAllowedError from ...core.client_wrapper import AsyncClientWrapper +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + class MembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def list( + self, + id: int, + *, + exclude_project_id: typing.Optional[int] = None, + exclude_workspace_id: typing.Optional[int] = None, + ordering: typing.Optional[str] = None, + page: typing.Optional[int] = None, + page_size: typing.Optional[int] = None, + search: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedLseOrganizationMemberListList: + """ + Retrieve a list of all users and roles in a specific organization. + + Parameters + ---------- + id : int + A unique integer value identifying this organization. + + exclude_project_id : typing.Optional[int] + Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). + + exclude_workspace_id : typing.Optional[int] + Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). + + ordering : typing.Optional[str] + Which field to use when ordering the results. + + page : typing.Optional[int] + A page number within the paginated result set. + + page_size : typing.Optional[int] + Number of results to return per page. + + search : typing.Optional[str] + A search term. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedLseOrganizationMemberListList + + + Examples + -------- + from label_studio_sdk import LabelStudio + + client = LabelStudio( + api_key="YOUR_API_KEY", + ) + client.organizations.members.list( + id=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/organizations/{jsonable_encoder(id)}/memberships", + method="GET", + params={ + "exclude_project_id": exclude_project_id, + "exclude_workspace_id": exclude_workspace_id, + "ordering": ordering, + "page": page, + "page_size": page_size, + "search": search, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PaginatedLseOrganizationMemberListList, + construct_type( + type_=PaginatedLseOrganizationMemberListList, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: int, + *, + user_id: typing.Optional[int] = OMIT, + role: typing.Optional[Role9E7Enum] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> LseOrganizationMemberList: + """ + Update organization membership or role for a specific user ID. + + **User Rotation Best Practices for API Usage** + + To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: + + * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. + + * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. + + * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. + + * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. + + Parameters + ---------- + id : int + A unique integer value identifying this organization. + + user_id : typing.Optional[int] + + role : typing.Optional[Role9E7Enum] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LseOrganizationMemberList + + + Examples + -------- + from label_studio_sdk import LabelStudio + + client = LabelStudio( + api_key="YOUR_API_KEY", + ) + client.organizations.members.update( + id=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/organizations/{jsonable_encoder(id)}/memberships", + method="PATCH", + json={ + "user_id": user_id, + "role": role, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + LseOrganizationMemberList, + construct_type( + type_=LseOrganizationMemberList, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def get( self, id: int, user_pk: int, *, request_options: typing.Optional[RequestOptions] = None ) -> OrganizationMember: @@ -148,6 +316,184 @@ class AsyncMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def list( + self, + id: int, + *, + exclude_project_id: typing.Optional[int] = None, + exclude_workspace_id: typing.Optional[int] = None, + ordering: typing.Optional[str] = None, + page: typing.Optional[int] = None, + page_size: typing.Optional[int] = None, + search: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedLseOrganizationMemberListList: + """ + Retrieve a list of all users and roles in a specific organization. + + Parameters + ---------- + id : int + A unique integer value identifying this organization. + + exclude_project_id : typing.Optional[int] + Project ID to exclude users who are already associated with this project (direct members, workspace members, or implicit admin/owner access). + + exclude_workspace_id : typing.Optional[int] + Workspace ID to exclude users who are already associated with this workspace (direct workspace members or implicit admin/owner access). + + ordering : typing.Optional[str] + Which field to use when ordering the results. + + page : typing.Optional[int] + A page number within the paginated result set. + + page_size : typing.Optional[int] + Number of results to return per page. + + search : typing.Optional[str] + A search term. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedLseOrganizationMemberListList + + + Examples + -------- + import asyncio + + from label_studio_sdk import AsyncLabelStudio + + client = AsyncLabelStudio( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.organizations.members.list( + id=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/organizations/{jsonable_encoder(id)}/memberships", + method="GET", + params={ + "exclude_project_id": exclude_project_id, + "exclude_workspace_id": exclude_workspace_id, + "ordering": ordering, + "page": page, + "page_size": page_size, + "search": search, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PaginatedLseOrganizationMemberListList, + construct_type( + type_=PaginatedLseOrganizationMemberListList, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: int, + *, + user_id: typing.Optional[int] = OMIT, + role: typing.Optional[Role9E7Enum] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> LseOrganizationMemberList: + """ + Update organization membership or role for a specific user ID. + + **User Rotation Best Practices for API Usage** + + To maintain compliance with our licensing terms and ensure optimal performance of HumanSignal's APIs, please consider the following guidelines when managing user assignments: + + * **Maintain a 7-Day Minimum Assignment**: Once a licensed seat is assigned to a user, maintain that assignment for at least seven consecutive days before rotating it to another user. + + * **Automate, Monitor, and Log Rotations**: Implement automated scheduling and logging mechanisms to track the timing of user rotations. This helps ensure that rotations adhere to the seven-day minimum period. + + * **Adhere to API Update Frequency and Wait Periods**: When updating user assignments via our APIs, follow the recommended frequency and wait period guidelines provided in the HumanSignal API documentation. Avoid sending rapid, successive requests that might overload the endpoint. Instead, incorporate appropriate delays between calls as specified in the documentation. + + * **Avoid Overloading the API Endpoint**: Design your integration to batch or schedule updates where possible, and implement backoff strategies if the API indicates rate limiting. This helps prevent service disruptions and ensures a smooth operation. + + Parameters + ---------- + id : int + A unique integer value identifying this organization. + + user_id : typing.Optional[int] + + role : typing.Optional[Role9E7Enum] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LseOrganizationMemberList + + + Examples + -------- + import asyncio + + from label_studio_sdk import AsyncLabelStudio + + client = AsyncLabelStudio( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.organizations.members.update( + id=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/organizations/{jsonable_encoder(id)}/memberships", + method="PATCH", + json={ + "user_id": user_id, + "role": role, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + LseOrganizationMemberList, + construct_type( + type_=LseOrganizationMemberList, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + async def get( self, id: int, user_pk: int, *, request_options: typing.Optional[RequestOptions] = None ) -> OrganizationMember: diff --git a/src/label_studio_sdk/projects/client.py b/src/label_studio_sdk/projects/client.py index cde8288d9..931f58019 100644 --- a/src/label_studio_sdk/projects/client.py +++ b/src/label_studio_sdk/projects/client.py @@ -55,6 +55,7 @@ def list( filter: typing.Optional[ProjectsListRequestFilter] = None, ids: typing.Optional[str] = None, include: typing.Optional[str] = None, + members_limit: typing.Optional[int] = None, ordering: typing.Optional[str] = None, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, @@ -76,6 +77,9 @@ def list( include : typing.Optional[str] Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. + members_limit : typing.Optional[int] + Maximum number of members to return. + ordering : typing.Optional[str] Which field to use when ordering the results. @@ -121,6 +125,7 @@ def list( "filter": filter, "ids": ids, "include": include, + "members_limit": members_limit, "ordering": ordering, "page": page, "page_size": page_size, @@ -143,6 +148,7 @@ def list( filter=filter, ids=ids, include=include, + members_limit=members_limit, ordering=ordering, page=page + 1, page_size=page_size, @@ -976,6 +982,7 @@ async def list( filter: typing.Optional[ProjectsListRequestFilter] = None, ids: typing.Optional[str] = None, include: typing.Optional[str] = None, + members_limit: typing.Optional[int] = None, ordering: typing.Optional[str] = None, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, @@ -997,6 +1004,9 @@ async def list( include : typing.Optional[str] Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included. + members_limit : typing.Optional[int] + Maximum number of members to return. + ordering : typing.Optional[str] Which field to use when ordering the results. @@ -1050,6 +1060,7 @@ async def main() -> None: "filter": filter, "ids": ids, "include": include, + "members_limit": members_limit, "ordering": ordering, "page": page, "page_size": page_size, @@ -1072,6 +1083,7 @@ async def main() -> None: filter=filter, ids=ids, include=include, + members_limit=members_limit, ordering=ordering, page=page + 1, page_size=page_size, diff --git a/src/label_studio_sdk/types/__init__.py b/src/label_studio_sdk/types/__init__.py index 3064ecdb3..d45ee28c6 100644 --- a/src/label_studio_sdk/types/__init__.py +++ b/src/label_studio_sdk/types/__init__.py @@ -21,6 +21,9 @@ from .azure_blob_import_storage import AzureBlobImportStorage from .batch_failed_predictions import BatchFailedPredictions from .batch_predictions import BatchPredictions +from .billing_checks import BillingChecks +from .billing_flags import BillingFlags +from .billing_info_response import BillingInfoResponse from .blank_enum import BlankEnum from .blueprint_list import BlueprintList from .budget_reset_period_enum import BudgetResetPeriodEnum @@ -30,6 +33,7 @@ from .comment_serializer_with_expanded_user import CommentSerializerWithExpandedUser from .converted_format import ConvertedFormat from .converted_format_request import ConvertedFormatRequest +from .count_limit import CountLimit from .custom_scripts_editable_by_enum import CustomScriptsEditableByEnum from .default_role_enum import DefaultRoleEnum from .edition_enum import EditionEnum @@ -58,6 +62,7 @@ from .lse_key_indicator_value import LseKeyIndicatorValue from .lse_organization import LseOrganization from .lse_organization_custom_scripts_editable_by import LseOrganizationCustomScriptsEditableBy +from .lse_organization_member_list import LseOrganizationMemberList from .lse_project_create import LseProjectCreate from .lse_project_create_sampling import LseProjectCreateSampling from .lse_project_create_skip_queue import LseProjectCreateSkipQueue @@ -89,6 +94,7 @@ from .lse_task_serializer_for_reviewers_predictions_item import LseTaskSerializerForReviewersPredictionsItem from .lse_user import LseUser from .lse_user_api import LseUserApi +from .lse_user_organization_member_list import LseUserOrganizationMemberList from .lseapi_token_create import LseapiTokenCreate from .lseapi_token_list import LseapiTokenList from .lsejwt_settings import LsejwtSettings @@ -111,6 +117,7 @@ from .organization_member import OrganizationMember from .organization_membership import OrganizationMembership from .paginated_all_roles_project_list_list import PaginatedAllRolesProjectListList +from .paginated_lse_organization_member_list_list import PaginatedLseOrganizationMemberListList from .paginated_role_based_task_list import PaginatedRoleBasedTaskList from .pause import Pause from .pause_request import PauseRequest @@ -123,6 +130,7 @@ from .project_sampling import ProjectSampling from .project_skip_queue import ProjectSkipQueue from .project_subset_enum import ProjectSubsetEnum +from .prompts_status_enum import PromptsStatusEnum from .provider_enum import ProviderEnum from .reason_enum import ReasonEnum from .redis_export_storage import RedisExportStorage @@ -137,6 +145,7 @@ from .review_settings_requeue_rejected_tasks_mode import ReviewSettingsRequeueRejectedTasksMode from .review_settings_review_criteria import ReviewSettingsReviewCriteria from .reviewed_enum import ReviewedEnum +from .role9e7enum import Role9E7Enum from .role_based_task import RoleBasedTask from .s3export_storage import S3ExportStorage from .s3import_storage import S3ImportStorage @@ -188,6 +197,9 @@ "AzureBlobImportStorage", "BatchFailedPredictions", "BatchPredictions", + "BillingChecks", + "BillingFlags", + "BillingInfoResponse", "BlankEnum", "BlueprintList", "BudgetResetPeriodEnum", @@ -197,6 +209,7 @@ "CommentSerializerWithExpandedUser", "ConvertedFormat", "ConvertedFormatRequest", + "CountLimit", "CustomScriptsEditableByEnum", "DefaultRoleEnum", "EditionEnum", @@ -225,6 +238,7 @@ "LseKeyIndicatorValue", "LseOrganization", "LseOrganizationCustomScriptsEditableBy", + "LseOrganizationMemberList", "LseProjectCreate", "LseProjectCreateSampling", "LseProjectCreateSkipQueue", @@ -256,6 +270,7 @@ "LseTaskSerializerForReviewersPredictionsItem", "LseUser", "LseUserApi", + "LseUserOrganizationMemberList", "LseapiTokenCreate", "LseapiTokenList", "LsejwtSettings", @@ -278,6 +293,7 @@ "OrganizationMember", "OrganizationMembership", "PaginatedAllRolesProjectListList", + "PaginatedLseOrganizationMemberListList", "PaginatedRoleBasedTaskList", "Pause", "PauseRequest", @@ -290,6 +306,7 @@ "ProjectSampling", "ProjectSkipQueue", "ProjectSubsetEnum", + "PromptsStatusEnum", "ProviderEnum", "ReasonEnum", "RedisExportStorage", @@ -304,6 +321,7 @@ "ReviewSettingsRequeueRejectedTasksMode", "ReviewSettingsReviewCriteria", "ReviewedEnum", + "Role9E7Enum", "RoleBasedTask", "S3ExportStorage", "S3ImportStorage", diff --git a/src/label_studio_sdk/types/all_roles_project_list.py b/src/label_studio_sdk/types/all_roles_project_list.py index a9730045e..6462cf34d 100644 --- a/src/label_studio_sdk/types/all_roles_project_list.py +++ b/src/label_studio_sdk/types/all_roles_project_list.py @@ -3,13 +3,13 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing import pydantic -import datetime as dt -from .all_roles_project_list_skip_queue import AllRolesProjectListSkipQueue -from .all_roles_project_list_sampling import AllRolesProjectListSampling -from .assignment_settings import AssignmentSettings from .user_simple import UserSimple from .blueprint_list import BlueprintList +import datetime as dt from .review_settings import ReviewSettings +from .assignment_settings import AssignmentSettings +from .all_roles_project_list_skip_queue import AllRolesProjectListSkipQueue +from .all_roles_project_list_sampling import AllRolesProjectListSampling from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -19,171 +19,171 @@ class AllRolesProjectList(UncheckedBaseModel): make sure, that you use correct one(Project.objects.with_counts()) """ + model_version: typing.Optional[str] = pydantic.Field(default=None) + """ + Machine learning model version + """ + reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None) """ Reveal pre-annotations interactively """ - organization: typing.Optional[int] = None - annotation_limit_percent: typing.Optional[str] = None - color: typing.Optional[str] = None - show_ground_truth_first: typing.Optional[bool] = None - overlap_cohort_percentage: typing.Optional[int] = None + config_suitable_for_bulk_annotation: bool = pydantic.Field() + """ + Flag to detect is project ready for bulk annotation + """ + custom_script: typing.Optional[str] = None - reviewer_queue_total: str - members_count: str - custom_task_lock_ttl: typing.Optional[int] = pydantic.Field(default=None) + reviewed_number: str + show_skip_button: typing.Optional[bool] = pydantic.Field(default=None) """ - TTL in seconds for task reservations, on new and existing tasks + Show a skip button in interface and allow annotators to skip the task """ - annotator_evaluation_minimum_tasks: typing.Optional[int] = None - members: str - finished_task_number: int - pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + workspace: str + rejected: str + created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) """ - Pinned date and time + Project owner """ - duplication_done: typing.Optional[bool] = None - num_tasks_with_annotations: str - config_suitable_for_bulk_annotation: bool = pydantic.Field() + is_draft: typing.Optional[bool] = pydantic.Field(default=None) """ - Flag to detect is project ready for bulk annotation + Whether or not the project is in the middle of being created """ - created_at: dt.datetime - pause_on_failed_annotator_evaluation: typing.Optional[bool] = None - reviewed_number: str + parsed_label_config: typing.Optional[typing.Any] = None + blueprints: typing.List[BlueprintList] + allow_stream: str + members_count: int label_config: typing.Optional[str] = pydantic.Field(default=None) """ Label config in XML format. See more about it in documentation """ - skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None - skipped_annotations_number: str - annotator_evaluation_minimum_score: typing.Optional[str] = None - title: typing.Optional[str] = pydantic.Field(default=None) + maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) """ - Project name. Must be between 3 and 50 characters long. + Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) """ - useful_annotation_number: str - total_annotations_number: str - allow_stream: str - sampling: typing.Optional[AllRolesProjectListSampling] = None - annotation_limit_count: typing.Optional[int] = None - control_weights: typing.Optional[typing.Optional[typing.Any]] = None - ground_truth_number: int = pydantic.Field() + show_instruction: typing.Optional[bool] = pydantic.Field(default=None) """ - Honeypot annotation number in project + Show instructions to the annotator before they start """ - expert_instruction: typing.Optional[str] = pydantic.Field(default=None) + total_annotations_number: str + reviewer_queue_total: str + show_overlap_first: typing.Optional[bool] = None + comment_classification_config: typing.Optional[str] = None + created_at: dt.datetime + useful_annotation_number: str + min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) """ - Labeling instructions in HTML format + Minimum number of completed tasks after which model training is started """ - parsed_label_config: typing.Optional[typing.Any] = None - ready: str - comment_classification_config: typing.Optional[str] = None - description_short: str - config_has_control_tags: bool = pydantic.Field() + organization: typing.Optional[int] = None + overlap_cohort_percentage: typing.Optional[int] = None + show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) """ - Flag to detect is project ready for labeling + Show annotation history to annotator """ - model_version: typing.Optional[str] = pydantic.Field(default=None) + config_has_control_tags: bool = pydantic.Field() """ - Machine learning model version + Flag to detect is project ready for labeling """ - is_published: typing.Optional[bool] = pydantic.Field(default=None) + id: int + pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ - Whether or not the project is published to annotators + Pinned date and time """ - rejected: str - min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) + review_settings: ReviewSettings + data_types: typing.Optional[typing.Any] = None + custom_task_lock_ttl: typing.Optional[int] = pydantic.Field(default=None) """ - Minimum number of completed tasks after which model training is started + TTL in seconds for task reservations, on new and existing tasks """ - description: typing.Optional[str] = pydantic.Field(default=None) + annotator_evaluation_minimum_tasks: typing.Optional[int] = None + annotation_limit_percent: typing.Optional[str] = None + annotation_limit_count: typing.Optional[int] = None + ready: str + evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) """ - Project description + Retrieve and display predictions when loading a task """ - queue_left: str - total_predictions_number: int duplication_status: typing.Optional[str] = None - show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) + prompts: str + skipped_annotations_number: str + enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) """ - If set, the annotator can view model predictions + Allow annotators to submit empty annotations """ - show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) + color: typing.Optional[str] = None + start_training_on_annotation_update: bool = pydantic.Field() """ - Show annotation history to annotator + Start model training after any annotations are submitted or updated """ - id: int - assignment_settings: AssignmentSettings - workspace_title: str + queue_left: str + description_short: str + duplication_done: typing.Optional[bool] = None + members: str + pause_on_failed_annotator_evaluation: typing.Optional[bool] = None has_blueprints: str - workspace: str - show_instruction: typing.Optional[bool] = pydantic.Field(default=None) + show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) """ - Show instructions to the annotator before they start + If set, the annotator can view model predictions """ - maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) + title: typing.Optional[str] = pydantic.Field(default=None) """ - Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) + Project name. Must be between 3 and 50 characters long. """ - require_comment_on_skip: typing.Optional[bool] = None + total_predictions_number: int review_total_tasks: str - created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) + expert_instruction: typing.Optional[str] = pydantic.Field(default=None) """ - Project owner + Labeling instructions in HTML format """ - queue_done: str + num_tasks_with_annotations: str + annotator_evaluation_minimum_score: typing.Optional[str] = None + finished_task_number: int task_number: int = pydantic.Field() """ Total task number in project """ - blueprints: typing.List[BlueprintList] - show_overlap_first: typing.Optional[bool] = None - queue_total: str - evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) - """ - Retrieve and display predictions when loading a task - """ - - prompts: str - review_settings: ReviewSettings - show_skip_button: typing.Optional[bool] = pydantic.Field(default=None) - """ - Show a skip button in interface and allow annotators to skip the task - """ - - data_types: typing.Optional[typing.Any] = None - enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) + control_weights: typing.Optional[typing.Optional[typing.Any]] = None + queue_done: str + show_ground_truth_first: typing.Optional[bool] = None + assignment_settings: AssignmentSettings + require_comment_on_skip: typing.Optional[bool] = None + ground_truth_number: int = pydantic.Field() """ - Allow annotators to submit empty annotations + Honeypot annotation number in project """ - is_draft: typing.Optional[bool] = pydantic.Field(default=None) + skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None + workspace_title: str + sampling: typing.Optional[AllRolesProjectListSampling] = None + queue_total: str + is_published: typing.Optional[bool] = pydantic.Field(default=None) """ - Whether or not the project is in the middle of being created + Whether or not the project is published to annotators """ - start_training_on_annotation_update: bool = pydantic.Field() + description: typing.Optional[str] = pydantic.Field(default=None) """ - Start model training after any annotations are submitted or updated + Project description """ if IS_PYDANTIC_V2: diff --git a/src/label_studio_sdk/types/billing_checks.py b/src/label_studio_sdk/types/billing_checks.py new file mode 100644 index 000000000..a45a8a158 --- /dev/null +++ b/src/label_studio_sdk/types/billing_checks.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .count_limit import CountLimit +import typing +from .prompts_status_enum import PromptsStatusEnum +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BillingChecks(UncheckedBaseModel): + users: CountLimit + projects: CountLimit + results: CountLimit + trial_days: int + organization_is_active: bool + license_issued: typing.Optional[str] = None + license_warning: typing.Optional[str] = None + is_license_warning: bool + license_expires: typing.Optional[str] = None + is_license_expired: bool + prompts_enabled: bool + prompts_status: PromptsStatusEnum + prompts_warning: typing.Optional[str] = None + is_prompts_warning: bool + prompts_expire: typing.Optional[str] = None + is_prompts_expire: bool + prompts_api_keys_enabled: bool + import_storages: CountLimit + export_storages: CountLimit + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/billing_flags.py b/src/label_studio_sdk/types/billing_flags.py new file mode 100644 index 000000000..980902f5e --- /dev/null +++ b/src/label_studio_sdk/types/billing_flags.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BillingFlags(UncheckedBaseModel): + activated_at: typing.Optional[dt.datetime] = None + cloud_instance: bool + allow_activity_log: bool + allow_invite_project_experts: bool + allow_sso: bool + white_label_id: typing.Optional[str] = None + allow_data_credentials: bool + allow_organization_webhooks: bool + disable_members_page: bool + secure_mode: bool + manual_workspace_management: bool + manual_role_management: bool + hide_storage_settings_for_manager: bool + disable_project_imports: bool + automax_token_exists: bool + automax_enabled: bool + storage_persistence: bool + allow_ai: bool + early_adopter: bool + allow_ask_ai: bool + allow_invite_people: bool + allow_storage_proxy: bool + embed_enabled: bool + embed_domains: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None + embed_settings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/billing_info_response.py b/src/label_studio_sdk/types/billing_info_response.py new file mode 100644 index 000000000..0bfaf5523 --- /dev/null +++ b/src/label_studio_sdk/types/billing_info_response.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .billing_checks import BillingChecks +from .billing_flags import BillingFlags +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class BillingInfoResponse(UncheckedBaseModel): + billing_checks: BillingChecks + billing_flags: BillingFlags + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/count_limit.py b/src/label_studio_sdk/types/count_limit.py new file mode 100644 index 000000000..26a6050fd --- /dev/null +++ b/src/label_studio_sdk/types/count_limit.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CountLimit(UncheckedBaseModel): + count: int + limit: int + reached: bool + total: typing.Optional[int] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/lse_organization_member_list.py b/src/label_studio_sdk/types/lse_organization_member_list.py new file mode 100644 index 000000000..bce1303bb --- /dev/null +++ b/src/label_studio_sdk/types/lse_organization_member_list.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from .lse_user_organization_member_list import LseUserOrganizationMemberList +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class LseOrganizationMemberList(UncheckedBaseModel): + """ + A serializer mixin that takes an additional `fields` argument that controls + which fields should be displayed. + """ + + id: int + organization: int = pydantic.Field() + """ + Organization ID + """ + + user: LseUserOrganizationMemberList + role: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/lse_user_organization_member_list.py b/src/label_studio_sdk/types/lse_user_organization_member_list.py new file mode 100644 index 000000000..7699d06a8 --- /dev/null +++ b/src/label_studio_sdk/types/lse_user_organization_member_list.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import datetime as dt +import pydantic +from .lse_fields import LseFields +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class LseUserOrganizationMemberList(UncheckedBaseModel): + """ + A ModelSerializer that takes additional arguments for + "fields", "omit" and "expand" in order to + control which fields are displayed, and whether to replace simple + values with complex, nested serializations + """ + + id: int + first_name: typing.Optional[str] = None + last_name: typing.Optional[str] = None + username: str + email: typing.Optional[str] = None + last_activity: dt.datetime + custom_hotkeys: typing.Optional[typing.Optional[typing.Any]] = None + avatar: str + initials: str + phone: typing.Optional[str] = None + active_organization: typing.Optional[int] = None + allow_newsletters: typing.Optional[bool] = pydantic.Field(default=None) + """ + Allow sending newsletters to user + """ + + date_joined: typing.Optional[dt.datetime] = None + lse_fields: LseFields + pause: str + created_projects: str + contributed_to_projects: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py b/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py new file mode 100644 index 000000000..4b51fb3fd --- /dev/null +++ b/src/label_studio_sdk/types/paginated_lse_organization_member_list_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .lse_organization_member_list import LseOrganizationMemberList +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class PaginatedLseOrganizationMemberListList(UncheckedBaseModel): + count: int + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.List[LseOrganizationMemberList] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/label_studio_sdk/types/prompts_status_enum.py b/src/label_studio_sdk/types/prompts_status_enum.py new file mode 100644 index 000000000..b38ee4b50 --- /dev/null +++ b/src/label_studio_sdk/types/prompts_status_enum.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PromptsStatusEnum = typing.Union[ + typing.Literal[ + "Enabled", + "Cloud license per organization disabled", + "On-premise global license disabled", + "Expired", + "Adala not connected", + "Disabled for this organization [FF]", + "unknown", + ], + typing.Any, +] diff --git a/src/label_studio_sdk/types/role9e7enum.py b/src/label_studio_sdk/types/role9e7enum.py new file mode 100644 index 000000000..d70569fb2 --- /dev/null +++ b/src/label_studio_sdk/types/role9e7enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +Role9E7Enum = typing.Union[typing.Literal["OW", "AD", "MA", "RE", "AN", "DI", "NO"], typing.Any] diff --git a/tests/organizations/test_members.py b/tests/organizations/test_members.py index 658901506..604e81da4 100644 --- a/tests/organizations/test_members.py +++ b/tests/organizations/test_members.py @@ -6,6 +6,155 @@ from ..utilities import validate_response +async def test_list_(client: LabelStudio, async_client: AsyncLabelStudio) -> None: + expected_response: typing.Any = { + "count": 123, + "next": "http://api.example.org/accounts/?page=4", + "previous": "http://api.example.org/accounts/?page=2", + "results": [ + { + "id": 1, + "organization": 1, + "user": { + "id": 1, + "username": "username", + "last_activity": "2024-01-15T09:30:00Z", + "avatar": "avatar", + "initials": "initials", + "lse_fields": { + "invite_expired": "invite_expired", + "invite_expired_at": "invite_expired_at", + "email_notification_settings": "email_notification_settings", + }, + "pause": "pause", + "created_projects": "created_projects", + "contributed_to_projects": "contributed_to_projects", + }, + "role": "role", + } + ], + } + expected_types: typing.Any = { + "count": "integer", + "next": None, + "previous": None, + "results": ( + "list", + { + 0: { + "id": "integer", + "organization": "integer", + "user": { + "id": "integer", + "username": None, + "last_activity": "datetime", + "avatar": None, + "initials": None, + "lse_fields": { + "invite_expired": None, + "invite_expired_at": None, + "email_notification_settings": None, + }, + "pause": None, + "created_projects": None, + "contributed_to_projects": None, + }, + "role": None, + } + }, + ), + } + response = client.organizations.members.list(id=1) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.organizations.members.list(id=1) + validate_response(async_response, expected_response, expected_types) + + +async def test_update(client: LabelStudio, async_client: AsyncLabelStudio) -> None: + expected_response: typing.Any = { + "id": 1, + "organization": 1, + "user": { + "id": 1, + "first_name": "first_name", + "last_name": "last_name", + "username": "username", + "email": "email", + "last_activity": "2024-01-15T09:30:00Z", + "custom_hotkeys": {"key": "value"}, + "avatar": "avatar", + "initials": "initials", + "phone": "phone", + "active_organization": 1, + "allow_newsletters": True, + "date_joined": "2024-01-15T09:30:00Z", + "lse_fields": { + "invite_expired": "invite_expired", + "invite_expired_at": "invite_expired_at", + "invited_at": "2024-01-15T09:30:00Z", + "invite_activated": True, + "trial_company": "trial_company", + "trial_role": "annotator", + "trial_models_in_production": "trial_models_in_production", + "trial_experience_labeling": "trial_experience_labeling", + "trial_license_enterprise": True, + "social_auth_finished": True, + "invited_by": 1, + "onboarding_state": "not_started", + "email_notification_settings": "email_notification_settings", + }, + "pause": "pause", + "created_projects": "created_projects", + "contributed_to_projects": "contributed_to_projects", + }, + "role": "role", + } + expected_types: typing.Any = { + "id": "integer", + "organization": "integer", + "user": { + "id": "integer", + "first_name": None, + "last_name": None, + "username": None, + "email": None, + "last_activity": "datetime", + "custom_hotkeys": None, + "avatar": None, + "initials": None, + "phone": None, + "active_organization": "integer", + "allow_newsletters": None, + "date_joined": "datetime", + "lse_fields": { + "invite_expired": None, + "invite_expired_at": None, + "invited_at": "datetime", + "invite_activated": None, + "trial_company": None, + "trial_role": None, + "trial_models_in_production": None, + "trial_experience_labeling": None, + "trial_license_enterprise": None, + "social_auth_finished": None, + "invited_by": "integer", + "onboarding_state": None, + "email_notification_settings": None, + }, + "pause": None, + "created_projects": None, + "contributed_to_projects": None, + }, + "role": None, + } + response = client.organizations.members.update(id=1) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.organizations.members.update(id=1) + validate_response(async_response, expected_response, expected_types) + + async def test_get(client: LabelStudio, async_client: AsyncLabelStudio) -> None: expected_response: typing.Any = { "user": 1, diff --git a/tests/test_billing.py b/tests/test_billing.py new file mode 100644 index 000000000..dbec9138c --- /dev/null +++ b/tests/test_billing.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +from label_studio_sdk import LabelStudio +from label_studio_sdk import AsyncLabelStudio +import typing +from .utilities import validate_response + + +async def test_info(client: LabelStudio, async_client: AsyncLabelStudio) -> None: + expected_response: typing.Any = { + "billing_checks": { + "users": {"count": 110, "limit": 1000, "reached": False, "total": 221}, + "projects": {"count": 2044, "limit": 1000000, "reached": False, "total": 1}, + "results": {"count": 42949, "limit": 1000000000, "reached": False, "total": 1}, + "trial_days": 0, + "organization_is_active": True, + "license_issued": "2000-01-01", + "license_warning": "2030-01-01", + "is_license_warning": False, + "license_expires": "2030-01-02", + "is_license_expired": False, + "prompts_enabled": True, + "prompts_status": "Enabled", + "prompts_warning": "prompts_warning", + "is_prompts_warning": False, + "prompts_expire": "prompts_expire", + "is_prompts_expire": False, + "prompts_api_keys_enabled": True, + "import_storages": {"count": 0, "limit": 0, "reached": False, "total": 1}, + "export_storages": {"count": 0, "limit": 0, "reached": False, "total": 1}, + }, + "billing_flags": { + "activated_at": "2024-01-15T09:30:00Z", + "cloud_instance": True, + "allow_activity_log": True, + "allow_invite_project_experts": True, + "allow_sso": True, + "white_label_id": "white_label_id", + "allow_data_credentials": False, + "allow_organization_webhooks": False, + "disable_members_page": False, + "secure_mode": False, + "manual_workspace_management": True, + "manual_role_management": True, + "hide_storage_settings_for_manager": False, + "disable_project_imports": False, + "automax_token_exists": True, + "automax_enabled": True, + "storage_persistence": True, + "allow_ai": True, + "early_adopter": True, + "allow_ask_ai": True, + "allow_invite_people": True, + "allow_storage_proxy": True, + "embed_enabled": True, + "embed_domains": [{"domain": "http://localhost:3000"}, {"domain": "https://purple-zoos-flash.loca.lt"}], + "embed_settings": {"public_verify_alg": ["RS256"], "public_verify_key": "...."}, + }, + } + expected_types: typing.Any = { + "billing_checks": { + "users": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, + "projects": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, + "results": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, + "trial_days": "integer", + "organization_is_active": None, + "license_issued": None, + "license_warning": None, + "is_license_warning": None, + "license_expires": None, + "is_license_expired": None, + "prompts_enabled": None, + "prompts_status": None, + "prompts_warning": None, + "is_prompts_warning": None, + "prompts_expire": None, + "is_prompts_expire": None, + "prompts_api_keys_enabled": None, + "import_storages": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, + "export_storages": {"count": "integer", "limit": "integer", "reached": None, "total": "integer"}, + }, + "billing_flags": { + "activated_at": "datetime", + "cloud_instance": None, + "allow_activity_log": None, + "allow_invite_project_experts": None, + "allow_sso": None, + "white_label_id": None, + "allow_data_credentials": None, + "allow_organization_webhooks": None, + "disable_members_page": None, + "secure_mode": None, + "manual_workspace_management": None, + "manual_role_management": None, + "hide_storage_settings_for_manager": None, + "disable_project_imports": None, + "automax_token_exists": None, + "automax_enabled": None, + "storage_persistence": None, + "allow_ai": None, + "early_adopter": None, + "allow_ask_ai": None, + "allow_invite_people": None, + "allow_storage_proxy": None, + "embed_enabled": None, + "embed_domains": ("list", {0: ("dict", {0: (None, None)}), 1: ("dict", {0: (None, None)})}), + "embed_settings": ("dict", {0: (None, None), 1: (None, None)}), + }, + } + response = client.billing.info() + validate_response(response, expected_response, expected_types) + + async_response = await async_client.billing.info() + validate_response(async_response, expected_response, expected_types) diff --git a/tests/test_prompts.py b/tests/test_prompts.py index 2406c51ae..f700e15a4 100644 --- a/tests/test_prompts.py +++ b/tests/test_prompts.py @@ -213,79 +213,79 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "previous": "http://api.example.org/accounts/?page=2", "results": [ { + "model_version": "model_version", "reveal_preannotations_interactively": True, - "organization": 1, - "annotation_limit_percent": "annotation_limit_percent", - "color": "color", - "show_ground_truth_first": True, - "overlap_cohort_percentage": 1, - "custom_script": "custom_script", - "reviewer_queue_total": "reviewer_queue_total", - "members_count": "members_count", - "custom_task_lock_ttl": 1, - "annotator_evaluation_minimum_tasks": 1, - "members": "members", - "finished_task_number": 1, - "pinned_at": "2024-01-15T09:30:00Z", - "duplication_done": True, - "num_tasks_with_annotations": "num_tasks_with_annotations", "config_suitable_for_bulk_annotation": True, - "created_at": "2024-01-15T09:30:00Z", - "pause_on_failed_annotator_evaluation": True, + "custom_script": "custom_script", "reviewed_number": "reviewed_number", - "label_config": "label_config", - "skip_queue": "REQUEUE_FOR_ME", - "skipped_annotations_number": "skipped_annotations_number", - "annotator_evaluation_minimum_score": "annotator_evaluation_minimum_score", - "title": "title", - "useful_annotation_number": "useful_annotation_number", - "total_annotations_number": "total_annotations_number", - "allow_stream": "allow_stream", - "sampling": "Sequential sampling", - "annotation_limit_count": 1, - "control_weights": {"key": "value"}, - "ground_truth_number": 1, - "expert_instruction": "expert_instruction", - "parsed_label_config": {"key": "value"}, - "ready": "ready", - "comment_classification_config": "comment_classification_config", - "description_short": "description_short", - "config_has_control_tags": True, - "model_version": "model_version", - "is_published": True, - "rejected": "rejected", - "min_annotations_to_start_training": 1, - "description": "description", - "queue_left": "queue_left", - "total_predictions_number": 1, - "duplication_status": "duplication_status", - "show_collab_predictions": True, - "show_annotation_history": True, - "id": 1, - "assignment_settings": {"id": 1}, - "workspace_title": "workspace_title", - "has_blueprints": "has_blueprints", + "show_skip_button": True, "workspace": "workspace", - "show_instruction": True, - "maximum_annotations": 1, - "require_comment_on_skip": True, - "review_total_tasks": "review_total_tasks", + "rejected": "rejected", "created_by": {"id": 1, "avatar": "avatar"}, - "queue_done": "queue_done", - "task_number": 1, + "is_draft": True, + "parsed_label_config": {"key": "value"}, "blueprints": [ {"id": 1, "share_id": "share_id", "short_url": "short_url", "created_at": "2024-01-15T09:30:00Z"} ], + "allow_stream": "allow_stream", + "members_count": 1, + "label_config": "label_config", + "maximum_annotations": 1, + "show_instruction": True, + "total_annotations_number": "total_annotations_number", + "reviewer_queue_total": "reviewer_queue_total", "show_overlap_first": True, - "queue_total": "queue_total", - "evaluate_predictions_automatically": True, - "prompts": "prompts", + "comment_classification_config": "comment_classification_config", + "created_at": "2024-01-15T09:30:00Z", + "useful_annotation_number": "useful_annotation_number", + "min_annotations_to_start_training": 1, + "organization": 1, + "overlap_cohort_percentage": 1, + "show_annotation_history": True, + "config_has_control_tags": True, + "id": 1, + "pinned_at": "2024-01-15T09:30:00Z", "review_settings": {"id": 1, "requeue_rejected_tasks_to_annotator": True}, - "show_skip_button": True, "data_types": {"key": "value"}, + "custom_task_lock_ttl": 1, + "annotator_evaluation_minimum_tasks": 1, + "annotation_limit_percent": "annotation_limit_percent", + "annotation_limit_count": 1, + "ready": "ready", + "evaluate_predictions_automatically": True, + "duplication_status": "duplication_status", + "prompts": "prompts", + "skipped_annotations_number": "skipped_annotations_number", "enable_empty_annotation": True, - "is_draft": True, + "color": "color", "start_training_on_annotation_update": True, + "queue_left": "queue_left", + "description_short": "description_short", + "duplication_done": True, + "members": "members", + "pause_on_failed_annotator_evaluation": True, + "has_blueprints": "has_blueprints", + "show_collab_predictions": True, + "title": "title", + "total_predictions_number": 1, + "review_total_tasks": "review_total_tasks", + "expert_instruction": "expert_instruction", + "num_tasks_with_annotations": "num_tasks_with_annotations", + "annotator_evaluation_minimum_score": "annotator_evaluation_minimum_score", + "finished_task_number": 1, + "task_number": 1, + "control_weights": {"key": "value"}, + "queue_done": "queue_done", + "show_ground_truth_first": True, + "assignment_settings": {"id": 1}, + "require_comment_on_skip": True, + "ground_truth_number": 1, + "skip_queue": "REQUEUE_FOR_ME", + "workspace_title": "workspace_title", + "sampling": "Sequential sampling", + "queue_total": "queue_total", + "is_published": True, + "description": "description", } ], } @@ -297,80 +297,80 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "list", { 0: { + "model_version": None, "reveal_preannotations_interactively": None, - "organization": "integer", - "annotation_limit_percent": None, - "color": None, - "show_ground_truth_first": None, - "overlap_cohort_percentage": "integer", - "custom_script": None, - "reviewer_queue_total": None, - "members_count": None, - "custom_task_lock_ttl": "integer", - "annotator_evaluation_minimum_tasks": "integer", - "members": None, - "finished_task_number": "integer", - "pinned_at": "datetime", - "duplication_done": None, - "num_tasks_with_annotations": None, "config_suitable_for_bulk_annotation": None, - "created_at": "datetime", - "pause_on_failed_annotator_evaluation": None, + "custom_script": None, "reviewed_number": None, - "label_config": None, - "skip_queue": None, - "skipped_annotations_number": None, - "annotator_evaluation_minimum_score": None, - "title": None, - "useful_annotation_number": None, - "total_annotations_number": None, - "allow_stream": None, - "sampling": None, - "annotation_limit_count": "integer", - "control_weights": None, - "ground_truth_number": "integer", - "expert_instruction": None, - "parsed_label_config": None, - "ready": None, - "comment_classification_config": None, - "description_short": None, - "config_has_control_tags": None, - "model_version": None, - "is_published": None, - "rejected": None, - "min_annotations_to_start_training": "integer", - "description": None, - "queue_left": None, - "total_predictions_number": "integer", - "duplication_status": None, - "show_collab_predictions": None, - "show_annotation_history": None, - "id": "integer", - "assignment_settings": {"id": "integer"}, - "workspace_title": None, - "has_blueprints": None, + "show_skip_button": None, "workspace": None, - "show_instruction": None, - "maximum_annotations": "integer", - "require_comment_on_skip": None, - "review_total_tasks": None, + "rejected": None, "created_by": {"id": "integer", "avatar": None}, - "queue_done": None, - "task_number": "integer", + "is_draft": None, + "parsed_label_config": None, "blueprints": ( "list", {0: {"id": "integer", "share_id": None, "short_url": None, "created_at": "datetime"}}, ), + "allow_stream": None, + "members_count": "integer", + "label_config": None, + "maximum_annotations": "integer", + "show_instruction": None, + "total_annotations_number": None, + "reviewer_queue_total": None, "show_overlap_first": None, - "queue_total": None, - "evaluate_predictions_automatically": None, - "prompts": None, + "comment_classification_config": None, + "created_at": "datetime", + "useful_annotation_number": None, + "min_annotations_to_start_training": "integer", + "organization": "integer", + "overlap_cohort_percentage": "integer", + "show_annotation_history": None, + "config_has_control_tags": None, + "id": "integer", + "pinned_at": "datetime", "review_settings": {"id": "integer", "requeue_rejected_tasks_to_annotator": None}, - "show_skip_button": None, "data_types": None, + "custom_task_lock_ttl": "integer", + "annotator_evaluation_minimum_tasks": "integer", + "annotation_limit_percent": None, + "annotation_limit_count": "integer", + "ready": None, + "evaluate_predictions_automatically": None, + "duplication_status": None, + "prompts": None, + "skipped_annotations_number": None, "enable_empty_annotation": None, - "is_draft": None, + "color": None, "start_training_on_annotation_update": None, + "queue_left": None, + "description_short": None, + "duplication_done": None, + "members": None, + "pause_on_failed_annotator_evaluation": None, + "has_blueprints": None, + "show_collab_predictions": None, + "title": None, + "total_predictions_number": "integer", + "review_total_tasks": None, + "expert_instruction": None, + "num_tasks_with_annotations": None, + "annotator_evaluation_minimum_score": None, + "finished_task_number": "integer", + "task_number": "integer", + "control_weights": None, + "queue_done": None, + "show_ground_truth_first": None, + "assignment_settings": {"id": "integer"}, + "require_comment_on_skip": None, + "ground_truth_number": "integer", + "skip_queue": None, + "workspace_title": None, + "sampling": None, + "queue_total": None, + "is_published": None, + "description": None, } }, ),