"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from ..shared import item as shared_item
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from orb import utils
from typing import Optional

class BillableMetricStatus(str, Enum):
    ACTIVE = 'active'
    DRAFT = 'draft'
    ARCHIVED = 'archived'


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class BillableMetric:
    r"""The Metric resource represents a calculation of a quantity based on events.
    Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.
    """
    description: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }})
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    item: shared_item.Item = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('item') }})
    r"""The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
    and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
    """
    metadata: dict[str, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata') }})
    name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }})
    status: BillableMetricStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }})
    

