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

from __future__ import annotations
import dataclasses
from ..shared import addressinput as shared_addressinput
from ..shared import customertaxid as shared_customertaxid
from ..shared import newaccountingsyncconfiguration as shared_newaccountingsyncconfiguration
from ..shared import newreportingconfiguration as shared_newreportingconfiguration
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from orb import utils
from typing import Optional



@dataclasses.dataclass
class NewCustomerMetadata:
    r"""User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource."""
    


class NewCustomerPaymentProvider(str, Enum):
    r"""This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp."""
    QUICKBOOKS = 'quickbooks'
    BILL_COM = 'bill.com'
    STRIPE_CHARGE = 'stripe_charge'
    STRIPE_INVOICE = 'stripe_invoice'
    NETSUITE = 'netsuite'


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class NewCustomer:
    email: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('email') }})
    r"""A valid customer email, to be used for notifications. When Orb triggers payment through a payment gateway, this email will be used for any automatically issued receipts."""
    name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }})
    r"""The full name of the customer"""
    accounting_sync_configuration: Optional[shared_newaccountingsyncconfiguration.NewAccountingSyncConfiguration] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accounting_sync_configuration') }})
    additional_emails: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('additional_emails') }})
    r"""Additional email addresses for this customer. If populated, these email addresses will be CC'd for customer communications."""
    auto_collection: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('auto_collection') }})
    r"""Used to determine if invoices for this customer will automatically attempt to charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation."""
    billing_address: Optional[shared_addressinput.AddressInput] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billing_address') }})
    currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency') }})
    r"""An ISO 4217 currency string used for the customer's invoices and balance. If not set at creation time, will be set at subscription creation time."""
    email_delivery: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('email_delivery') }})
    external_customer_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_customer_id') }})
    r"""An optional user-defined ID for this customer resource, used throughout the system as an alias for this Customer. Use this field to identify a customer by an existing identifier in your system."""
    metadata: Optional[NewCustomerMetadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata') }})
    r"""User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource."""
    payment_provider: Optional[NewCustomerPaymentProvider] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payment_provider') }})
    r"""This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp."""
    payment_provider_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payment_provider_id') }})
    r"""The ID of this customer in an external payments solution, such as Stripe. This is used for creating charges or invoices in the external system via Orb."""
    reporting_configuration: Optional[shared_newreportingconfiguration.NewReportingConfiguration] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reporting_configuration') }})
    shipping_address: Optional[shared_addressinput.AddressInput] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('shipping_address') }})
    tax_id: Optional[shared_customertaxid.CustomerTaxID] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tax_id') }})
    timezone: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timezone') }})
    r"""A timezone identifier from the IANA timezone database, such as `\\"America/Los_Angeles\\"`. This defaults to your account's timezone if not set. This cannot be changed after customer creation."""
    

