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

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import customercosts as shared_customercosts
from ..shared import duplicateconstraintviolationerror as shared_duplicateconstraintviolationerror
from ..shared import duplicateresourcecreationerror as shared_duplicateresourcecreationerror
from ..shared import featurenotavailableerror as shared_featurenotavailableerror
from ..shared import five_hundrederror as shared_five_hundrederror
from ..shared import four_hundred_and_oneerror as shared_four_hundred_and_oneerror
from ..shared import four_hundred_and_twenty_nineerror as shared_four_hundred_and_twenty_nineerror
from ..shared import idempotencyconflict as shared_idempotencyconflict
from ..shared import idempotencykeyvalidationerror as shared_idempotencykeyvalidationerror
from ..shared import idempotencyrequestmismatch as shared_idempotencyrequestmismatch
from ..shared import requesttoolargeerror as shared_requesttoolargeerror
from ..shared import requestvalidationerror as shared_requestvalidationerror
from ..shared import resourcenotfounderror as shared_resourcenotfounderror
from ..shared import resourcetoolargeerror as shared_resourcetoolargeerror
from ..shared import urlnotfound as shared_urlnotfound
from datetime import datetime
from enum import Enum
from typing import Optional, Union

class FetchCustomerCostsViewModeViewMode(str, Enum):
    r"""Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior."""
    PERIODIC = 'periodic'
    CUMULATIVE = 'cumulative'



@dataclasses.dataclass
class FetchCustomerCostsRequest:
    customer_id: Optional[str] = dataclasses.field(metadata={'path_param': { 'field_name': 'customer_id', 'style': 'simple', 'explode': False }})
    group_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'group_by', 'style': 'form', 'explode': True }})
    timeframe_end: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeframe_end', 'style': 'form', 'explode': True }})
    timeframe_start: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeframe_start', 'style': 'form', 'explode': True }})
    view_mode: Optional[FetchCustomerCostsViewModeViewMode] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'view_mode', 'style': 'form', 'explode': True }})
    r"""Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior."""
    




@dataclasses.dataclass
class FetchCustomerCostsResponse:
    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"""
    four_hundred_error: Optional[Union[shared_duplicateconstraintviolationerror.DuplicateConstraintViolationError, shared_duplicateresourcecreationerror.DuplicateResourceCreationError, shared_requestvalidationerror.RequestValidationError]] = dataclasses.field(default=None)
    r"""Bad Request"""
    four_hundred_and_one_error: Optional[shared_four_hundred_and_oneerror.FourHundredAndOneError] = dataclasses.field(default=None)
    r"""Unauthorized"""
    four_hundred_and_four_error: Optional[Union[shared_featurenotavailableerror.FeatureNotAvailableError, shared_resourcenotfounderror.ResourceNotFoundError, shared_urlnotfound.URLNotFound]] = dataclasses.field(default=None)
    r"""Not Found"""
    four_hundred_and_nine_error: Optional[Union[shared_idempotencyconflict.IdempotencyConflict, shared_idempotencykeyvalidationerror.IdempotencyKeyValidationError, shared_idempotencyrequestmismatch.IdempotencyRequestMismatch]] = dataclasses.field(default=None)
    r"""Conflict"""
    four_hundred_and_thirteen_error: Optional[Union[shared_requesttoolargeerror.RequestTooLargeError, shared_resourcetoolargeerror.ResourceTooLargeError]] = dataclasses.field(default=None)
    r"""Request Entity Too Large"""
    four_hundred_and_twenty_nine_error: Optional[shared_four_hundred_and_twenty_nineerror.FourHundredAndTwentyNineError] = dataclasses.field(default=None)
    r"""Too Many Requests"""
    five_hundred_error: Optional[shared_five_hundrederror.FiveHundredError] = dataclasses.field(default=None)
    r"""Internal Server Error"""
    customer_costs: Optional[shared_customercosts.CustomerCosts] = 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"""
    

