"""cellpointapi.

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

# ruff: noqa: E501

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

    The type of line item.
    Note that while in [Create Order](#tag/Orders/operation/create-order), there are
    additional fields with certain types of line items, on fulfillment -- as this
    data is
    already known from [Create Order](#tag/Orders/operation/create-order), it is
    unnecessary.
    Anything other than a `Discount`, just requires the level of details of a normal
    `Product` type.
    <table>
      <thead>
        <tr>
          <th>Line Item Type</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>ACTIVITY</td>
          <td>Activities, such as tours, museum tickets, etc.</td>
        </tr>
        <tr>
          <td>AIRLINE_ANCILLARY</td>
          <td>Ancillary services offered by airlines, such as baggage fees, seat
    upgrades, etc.</td>
        </tr>
        <tr>
          <td>AIRLINE_FARE</td>
          <td>Fares for a flight.</td>
        </tr>
        <tr>
          <td>AUTO_RENTAL</td>
          <td>Auto rental</td>
        </tr>
        <tr>
          <td>BUNDLE</td>
          <td>A collection of line items and products have been packaged together
    into a single unit.</td>
        </tr>
        <tr>
          <td>DISCOUNT</td>
          <td>Discount</td>
        </tr>
        <tr>
          <td>LODGING_RESERVATION</td>
          <td>Bookings of a room at a hotel, hostel, etc.</td>
        </tr>
        <tr>
          <td>PRODUCT</td>
          <td>Product is a catch-all for any other line item type not listed
    here.</td>
        </tr>
      </tbody>
    </table>

    Attributes:
        ACTIVITY: The enum member of type str.
        AIRLINE_ANCILLARY: The enum member of type str.
        AIRLINE_FARE: The enum member of type str.
        AUTO_RENTAL: The enum member of type str.
        BUNDLE: The enum member of type str.
        DISCOUNT: The enum member of type str.
        LODGING_RESERVATION: The enum member of type str.
        PRODUCT: The enum member of type str.

    """

    ACTIVITY = "ACTIVITY"

    AIRLINE_ANCILLARY = "AIRLINE_ANCILLARY"

    AIRLINE_FARE = "AIRLINE_FARE"

    AUTO_RENTAL = "AUTO_RENTAL"

    BUNDLE = "BUNDLE"

    DISCOUNT = "DISCOUNT"

    LODGING_RESERVATION = "LODGING_RESERVATION"

    PRODUCT = "PRODUCT"

    @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
