"""cellpointapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501

class OrderStatusType(object):
    """Implementation of the 'OrderStatusType' enum.

    Status of the order.
    <table>
      <thead>
        <tr>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>ACTIVE</td>
          <td>Order is currently active and is pending payment.</td>
        </tr>
        <tr>
          <td>CANCELED</td>
          <td>Order has been canceled. See `reason` for why order has been
    canceled.</td>
        </tr>
        <tr>
          <td>PAID</td>
          <td>Order has been fully paid for by the buyer. There are now transactions
    associated with the order.</td>
        </tr>
        <tr>
          <td>FULFILLED</td>
          <td>Order has been fulfilled by the merchant.</td>
        </tr>
        <tr>
          <td>COMPLETED</td>
          <td>Order has been marked as complete and all transactions have been
    captured.</td>
        </tr>
      </tbody>
    </table>

    Attributes:
        ACTIVE: The enum member of type str.
        CANCELED: The enum member of type str.
        PAID: The enum member of type str.
        FULFILLED: The enum member of type str.
        COMPLETED: The enum member of type str.

    """

    _all_values = ["ACTIVE", "CANCELED", "PAID", "FULFILLED", "COMPLETED"]
    ACTIVE = "ACTIVE"

    CANCELED = "CANCELED"

    PAID = "PAID"

    FULFILLED = "FULFILLED"

    COMPLETED = "COMPLETED"

    @classmethod
    def validate(cls, value):
        """Validate value contains in enum

        Args:
            value: the value to be validated

        Returns:
            boolean : if value is valid enum values.

        """
        return value in cls._all_values

    @classmethod
    def from_value(cls, value, default=None):
        """Return the matching enum value for the given input."""
        if value is None:
            return default

        # If numeric and matches directly
        if isinstance(value, int):
            for name, val in cls.__dict__.items():
                if not name.startswith("_") and val == value:
                    return val

        # If string, perform case-insensitive match
        if isinstance(value, str):
            value_lower = value.lower()
            for name, val in cls.__dict__.items():
                if not name.startswith("_") and (
                    name.lower() == value_lower or str(val).lower() == value_lower
                ):
                    return val

        # Fallback to default
        return default
