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

from __future__ import annotations
import dataclasses
from ..shared import billablemetricgroup as shared_billablemetricgroup
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from sdk import utils
from typing import Optional

class BillableMetricInputBillableMetricAggregationTypeEnum(str, Enum):
    r"""Aggregation type"""
    COUNT_AGG = 'count_agg'
    SUM_AGG = 'sum_agg'
    MAX_AGG = 'max_agg'
    UNIQUE_COUNT_AGG = 'unique_count_agg'
    RECURRING_COUNT_AGG = 'recurring_count_agg'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class BillableMetricInputBillableMetric:
    
    aggregation_type: Optional[BillableMetricInputBillableMetricAggregationTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('aggregation_type'), 'exclude': lambda f: f is None }})
    r"""Aggregation type"""  
    code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('code'), 'exclude': lambda f: f is None }})  
    description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }})  
    field_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('field_name'), 'exclude': lambda f: f is None }})  
    group: Optional[shared_billablemetricgroup.BillableMetricGroup] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('group'), 'exclude': lambda f: f is None }})  
    name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class BillableMetricInput:
    r"""Billable metric payload"""
    
    billable_metric: BillableMetricInputBillableMetric = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billable_metric') }})  
    