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

from __future__ import annotations
import dataclasses
from .addresscompletecreaterequest import AddressCompleteCreateRequest
from .lineitem import LineItem
from .parcel import Parcel
from dataclasses_json import Undefined, dataclass_json
from shippo import utils
from typing import List, Optional, Union


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class LiveRateCreateRequest:
    address_to: Union[str, AddressCompleteCreateRequest] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('address_to') }})
    r"""The recipient address, which includes the recipient's name, company name, street address, city, state, zip code,
    country, phone number, and email address (strings). Special characters should not be included in 
    any address element, especially name, company, and email.
    """
    line_items: List[LineItem] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line_items') }})
    r"""Array of Line Item objects"""
    address_from: Optional[Union[str, AddressCompleteCreateRequest]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('address_from'), 'exclude': lambda f: f is None }})
    r"""The sender address, which includes your name, company name, street address, city, state, zip code,
    country, phone number, and email address (strings). Special characters should not be included in 
    any address element, especially name, company, and email.
    """
    parcel: Optional[Union[str, Parcel]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parcel'), 'exclude': lambda f: f is None }})
    r"""Object ID for an existing User Parcel Template OR a fully formed Parcel object."""
    

