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

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import amendedusage as shared_amendedusage
from ..shared import updateevent as shared_updateevent
from billing import utils
from dataclasses_json import Undefined, dataclass_json
from datetime import datetime
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class AmendUsageExternalCustomerIDRequestBody:
    events: Optional[list[shared_updateevent.UpdateEvent]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('events'), 'exclude': lambda f: f is None }})
    r"""Events to update"""
    




@dataclasses.dataclass
class AmendUsageExternalCustomerIDRequest:
    external_customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'external_customer_id', 'style': 'simple', 'explode': False }})
    request_body: AmendUsageExternalCustomerIDRequestBody = dataclasses.field(metadata={'request': { 'media_type': 'application/json' }})
    timeframe_end: datetime = dataclasses.field(metadata={'query_param': { 'field_name': 'timeframe_end', 'style': 'form', 'explode': True }})
    r"""This bound is exclusive (i.e. events before this timestamp will be updated)"""
    timeframe_start: datetime = dataclasses.field(metadata={'query_param': { 'field_name': 'timeframe_start', 'style': 'form', 'explode': True }})
    r"""This bound is inclusive (i.e. events with this timestamp onward, inclusive will be updated)"""
    




@dataclasses.dataclass
class AmendUsageExternalCustomerIDResponse:
    content_type: str = dataclasses.field()
    r"""HTTP response content type for this operation"""
    status_code: int = dataclasses.field()
    r"""HTTP response status code for this operation"""
    amended_usage: Optional[shared_amendedusage.AmendedUsage] = dataclasses.field(default=None)
    r"""OK"""
    raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)
    r"""Raw HTTP response; suitable for custom response parsing"""
    

