# coding: utf-8

"""
    Mixpeek API

    This is the Mixpeek API, providing access to various endpoints for data processing and retrieval.

    The version of the OpenAPI document: 1.3.0
    Contact: info@mixpeek.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class TaskStatusEnum(str, Enum):
    """
    Enumeration of task statuses for tracking asynchronous operations.  Task statuses indicate the current state of asynchronous operations like batch processing, object ingestion, clustering, and taxonomy execution.  Status Categories:     Operation Statuses: Track progress of async operations     Lifecycle Statuses: Track entity state (buckets, collections, namespaces)  Values:     PENDING: Task is queued but has not started processing yet     IN_PROGRESS: Task is currently being executed     PROCESSING: Task is actively processing data (similar to IN_PROGRESS)     COMPLETED: Task finished successfully with no errors     COMPLETED_WITH_ERRORS: Task finished but some items failed (partial success)     FAILED: Task encountered an error and could not complete     CANCELED: Task was manually canceled by a user or system     UNKNOWN: Task status could not be determined     SKIPPED: Task was intentionally skipped     DRAFT: Task is in draft state and not yet submitted      ACTIVE: Entity is active and operational (for buckets, collections, etc.)     ARCHIVED: Entity has been archived     SUSPENDED: Entity has been temporarily suspended  Terminal Statuses:     COMPLETED, COMPLETED_WITH_ERRORS, FAILED, CANCELED are terminal statuses.     Once a task reaches these states, it will not transition to another state.  Partial Success Handling:     COMPLETED_WITH_ERRORS indicates that the operation completed but some     documents/items failed. The task result includes:     - List of successful items     - List of failed items with error details     - Success rate percentage     This allows clients to handle partial success scenarios appropriately.  Polling Guidance:     - Poll tasks in PENDING, IN_PROGRESS, or PROCESSING states     - Stop polling when task reaches COMPLETED, COMPLETED_WITH_ERRORS, FAILED, or CANCELED     - Use exponential backoff (1s → 30s) when polling
    """

    """
    allowed enum values
    """
    PENDING = 'PENDING'
    IN_PROGRESS = 'IN_PROGRESS'
    PROCESSING = 'PROCESSING'
    COMPLETED = 'COMPLETED'
    COMPLETED_WITH_ERRORS = 'COMPLETED_WITH_ERRORS'
    FAILED = 'FAILED'
    CANCELED = 'CANCELED'
    UNKNOWN = 'UNKNOWN'
    SKIPPED = 'SKIPPED'
    DRAFT = 'DRAFT'
    ACTIVE = 'ACTIVE'
    ARCHIVED = 'ARCHIVED'
    SUSPENDED = 'SUSPENDED'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of TaskStatusEnum from a JSON string"""
        return cls(json.loads(json_str))


