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

from __future__ import annotations
import dataclasses
from ..shared import billablemetricminified as shared_billablemetricminified
from ..shared import usageitem as shared_usageitem
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from orb import utils
from typing import Optional

class UsageViewMode(str, Enum):
    PERIODIC = 'periodic'
    CUMULATIVE = 'cumulative'


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class Usage:
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    usage: list[shared_usageitem.UsageItem] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usage') }})
    billable_metric: Optional[shared_billablemetricminified.BillableMetricMinified] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billable_metric'), 'exclude': lambda f: f is None }})
    view_mode: Optional[UsageViewMode] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('view_mode'), 'exclude': lambda f: f is None }})
    

