import * as Schema from "effect/Schema";
import { API } from "../client";
import * as T from "../traits";
// Input Schema
export const PostCustomersCustomerInput = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    customer: Schema.String.pipe(T.PathParam()),
    address: Schema.optional(Schema.Unknown),
    balance: Schema.optional(Schema.Number),
    business_name: Schema.optional(Schema.Unknown),
    cash_balance: Schema.optional(Schema.Struct({
        settings: Schema.optional(Schema.Struct({
            reconciliation_mode: Schema.optional(Schema.Literals(["automatic", "manual", "merchant_default"])),
        })),
    })),
    default_source: Schema.optional(Schema.String),
    description: Schema.optional(Schema.String),
    email: Schema.optional(Schema.String),
    expand: Schema.optional(Schema.Array(Schema.String)),
    individual_name: Schema.optional(Schema.Unknown),
    invoice_prefix: Schema.optional(Schema.String),
    invoice_settings: Schema.optional(Schema.Struct({
        custom_fields: Schema.optional(Schema.Unknown),
        default_payment_method: Schema.optional(Schema.String),
        footer: Schema.optional(Schema.String),
        rendering_options: Schema.optional(Schema.Unknown),
    })),
    metadata: Schema.optional(Schema.Unknown),
    name: Schema.optional(Schema.String),
    next_invoice_sequence: Schema.optional(Schema.Number),
    phone: Schema.optional(Schema.String),
    preferred_locales: Schema.optional(Schema.Array(Schema.String)),
    shipping: Schema.optional(Schema.Unknown),
    source: Schema.optional(Schema.String),
    tax: Schema.optional(Schema.Struct({
        ip_address: Schema.optional(Schema.Unknown),
        validate_location: Schema.optional(Schema.Literals(["auto", "deferred", "immediately"])),
    })),
    tax_exempt: Schema.optional(Schema.Literals(["", "exempt", "none", "reverse"])),
    validate: Schema.optional(Schema.Boolean),
}).pipe(T.Http({
    method: "POST",
    path: "/v1/customers/{customer}",
    contentType: "form-urlencoded",
}));
// Output Schema
export const PostCustomersCustomerOutput = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    address: Schema.optional(Schema.Unknown),
    balance: Schema.optional(Schema.Number),
    business_name: Schema.optional(Schema.String),
    cash_balance: Schema.optional(Schema.Unknown),
    created: Schema.Number,
    currency: Schema.optional(Schema.NullOr(Schema.String)),
    customer_account: Schema.optional(Schema.NullOr(Schema.String)),
    default_source: Schema.Unknown,
    delinquent: Schema.optional(Schema.NullOr(Schema.Boolean)),
    description: Schema.NullOr(Schema.String),
    discount: Schema.optional(Schema.Unknown),
    email: Schema.NullOr(Schema.String),
    id: Schema.String,
    individual_name: Schema.optional(Schema.String),
    invoice_credit_balance: Schema.optional(Schema.Record(Schema.String, Schema.Number)),
    invoice_prefix: Schema.optional(Schema.NullOr(Schema.String)),
    invoice_settings: Schema.optional(Schema.Struct({
        custom_fields: Schema.NullOr(Schema.Array(Schema.Struct({
            name: Schema.String,
            value: Schema.String,
        }))),
        default_payment_method: Schema.Unknown,
        footer: Schema.NullOr(Schema.String),
        rendering_options: Schema.Unknown,
    })),
    livemode: Schema.Boolean,
    metadata: Schema.optional(Schema.Record(Schema.String, Schema.String)),
    name: Schema.optional(Schema.NullOr(Schema.String)),
    next_invoice_sequence: Schema.optional(Schema.Number),
    object: Schema.Literals(["customer"]),
    phone: Schema.optional(Schema.NullOr(Schema.String)),
    preferred_locales: Schema.optional(Schema.NullOr(Schema.Array(Schema.String))),
    shipping: Schema.Unknown,
    sources: Schema.optional(Schema.Struct({
        data: Schema.Array(Schema.Unknown),
        has_more: Schema.Boolean,
        object: Schema.Literals(["list"]),
        url: Schema.String,
    })),
    subscriptions: Schema.optional(Schema.Struct({
        data: Schema.Array(Schema.Struct({
            application: Schema.Unknown,
            application_fee_percent: Schema.NullOr(Schema.Number),
            automatic_tax: Schema.Struct({
                disabled_reason: Schema.NullOr(Schema.Literals(["requires_location_inputs"])),
                enabled: Schema.Boolean,
                liability: Schema.Unknown,
            }),
            billing_cycle_anchor: Schema.Number,
            billing_cycle_anchor_config: Schema.Unknown,
            billing_mode: Schema.Struct({
                flexible: Schema.Unknown,
                type: Schema.Literals(["classic", "flexible"]),
                updated_at: Schema.optional(Schema.Number),
            }),
            billing_thresholds: Schema.Unknown,
            cancel_at: Schema.NullOr(Schema.Number),
            cancel_at_period_end: Schema.Boolean,
            canceled_at: Schema.NullOr(Schema.Number),
            cancellation_details: Schema.Unknown,
            collection_method: Schema.Literals([
                "charge_automatically",
                "send_invoice",
            ]),
            created: Schema.Number,
            currency: Schema.String,
            customer: Schema.Unknown,
            customer_account: Schema.NullOr(Schema.String),
            days_until_due: Schema.NullOr(Schema.Number),
            default_payment_method: Schema.Unknown,
            default_source: Schema.Unknown,
            default_tax_rates: Schema.optional(Schema.NullOr(Schema.Array(Schema.Struct({
                active: Schema.Boolean,
                country: Schema.NullOr(Schema.String),
                created: Schema.Number,
                description: Schema.NullOr(Schema.String),
                display_name: Schema.String,
                effective_percentage: Schema.NullOr(Schema.Number),
                flat_amount: Schema.Unknown,
                id: Schema.String,
                inclusive: Schema.Boolean,
                jurisdiction: Schema.NullOr(Schema.String),
                jurisdiction_level: Schema.NullOr(Schema.Literals([
                    "city",
                    "country",
                    "county",
                    "district",
                    "multiple",
                    "state",
                ])),
                livemode: Schema.Boolean,
                metadata: Schema.NullOr(Schema.Record(Schema.String, Schema.String)),
                object: Schema.Literals(["tax_rate"]),
                percentage: Schema.Number,
                rate_type: Schema.NullOr(Schema.Literals(["flat_amount", "percentage"])),
                state: Schema.NullOr(Schema.String),
                tax_type: Schema.NullOr(Schema.Literals([
                    "amusement_tax",
                    "communications_tax",
                    "gst",
                    "hst",
                    "igst",
                    "jct",
                    "lease_tax",
                    "pst",
                    "qst",
                    "retail_delivery_fee",
                    "rst",
                    "sales_tax",
                    "service_tax",
                    "vat",
                ])),
            })))),
            description: Schema.NullOr(Schema.String),
            discounts: Schema.Array(Schema.Unknown),
            ended_at: Schema.NullOr(Schema.Number),
            id: Schema.String,
            invoice_settings: Schema.Struct({
                account_tax_ids: Schema.NullOr(Schema.Array(Schema.Unknown)),
                issuer: Schema.Struct({
                    account: Schema.optional(Schema.Unknown),
                    type: Schema.Literals(["account", "self"]),
                }),
            }),
            items: Schema.Struct({
                data: Schema.Array(Schema.Struct({
                    billing_thresholds: Schema.Unknown,
                    created: Schema.Number,
                    current_period_end: Schema.Number,
                    current_period_start: Schema.Number,
                    discounts: Schema.Array(Schema.Unknown),
                    id: Schema.String,
                    metadata: Schema.Record(Schema.String, Schema.String),
                    object: Schema.Literals(["subscription_item"]),
                    plan: Schema.Struct({
                        active: Schema.Boolean,
                        amount: Schema.NullOr(Schema.Number),
                        amount_decimal: Schema.NullOr(Schema.String),
                        billing_scheme: Schema.Literals(["per_unit", "tiered"]),
                        created: Schema.Number,
                        currency: Schema.String,
                        id: Schema.String,
                        interval: Schema.Literals(["day", "month", "week", "year"]),
                        interval_count: Schema.Number,
                        livemode: Schema.Boolean,
                        metadata: Schema.NullOr(Schema.Record(Schema.String, Schema.String)),
                        meter: Schema.NullOr(Schema.String),
                        nickname: Schema.NullOr(Schema.String),
                        object: Schema.Literals(["plan"]),
                        product: Schema.Unknown,
                        tiers: Schema.optional(Schema.Array(Schema.Struct({
                            flat_amount: Schema.NullOr(Schema.Number),
                            flat_amount_decimal: Schema.NullOr(Schema.String),
                            unit_amount: Schema.NullOr(Schema.Number),
                            unit_amount_decimal: Schema.NullOr(Schema.String),
                            up_to: Schema.NullOr(Schema.Number),
                        }))),
                        tiers_mode: Schema.NullOr(Schema.Literals(["graduated", "volume"])),
                        transform_usage: Schema.Unknown,
                        trial_period_days: Schema.NullOr(Schema.Number),
                        usage_type: Schema.Literals(["licensed", "metered"]),
                    }),
                    price: Schema.Struct({
                        active: Schema.Boolean,
                        billing_scheme: Schema.Literals(["per_unit", "tiered"]),
                        created: Schema.Number,
                        currency: Schema.String,
                        currency_options: Schema.optional(Schema.Record(Schema.String, Schema.Struct({
                            custom_unit_amount: Schema.Unknown,
                            tax_behavior: Schema.NullOr(Schema.Literals([
                                "exclusive",
                                "inclusive",
                                "unspecified",
                            ])),
                            tiers: Schema.optional(Schema.Array(Schema.Struct({
                                flat_amount: Schema.NullOr(Schema.Number),
                                flat_amount_decimal: Schema.NullOr(Schema.String),
                                unit_amount: Schema.NullOr(Schema.Number),
                                unit_amount_decimal: Schema.NullOr(Schema.String),
                                up_to: Schema.NullOr(Schema.Number),
                            }))),
                            unit_amount: Schema.NullOr(Schema.Number),
                            unit_amount_decimal: Schema.NullOr(Schema.String),
                        }))),
                        custom_unit_amount: Schema.Unknown,
                        id: Schema.String,
                        livemode: Schema.Boolean,
                        lookup_key: Schema.NullOr(Schema.String),
                        metadata: Schema.Record(Schema.String, Schema.String),
                        nickname: Schema.NullOr(Schema.String),
                        object: Schema.Literals(["price"]),
                        product: Schema.Unknown,
                        recurring: Schema.Unknown,
                        tax_behavior: Schema.NullOr(Schema.Literals([
                            "exclusive",
                            "inclusive",
                            "unspecified",
                        ])),
                        tiers: Schema.optional(Schema.Array(Schema.Struct({
                            flat_amount: Schema.NullOr(Schema.Number),
                            flat_amount_decimal: Schema.NullOr(Schema.String),
                            unit_amount: Schema.NullOr(Schema.Number),
                            unit_amount_decimal: Schema.NullOr(Schema.String),
                            up_to: Schema.NullOr(Schema.Number),
                        }))),
                        tiers_mode: Schema.NullOr(Schema.Literals(["graduated", "volume"])),
                        transform_quantity: Schema.Unknown,
                        type: Schema.Literals(["one_time", "recurring"]),
                        unit_amount: Schema.NullOr(Schema.Number),
                        unit_amount_decimal: Schema.NullOr(Schema.String),
                    }),
                    quantity: Schema.optional(Schema.Number),
                    subscription: Schema.String,
                    tax_rates: Schema.NullOr(Schema.Array(Schema.Struct({
                        active: Schema.Boolean,
                        country: Schema.NullOr(Schema.String),
                        created: Schema.Number,
                        description: Schema.NullOr(Schema.String),
                        display_name: Schema.String,
                        effective_percentage: Schema.NullOr(Schema.Number),
                        flat_amount: Schema.Unknown,
                        id: Schema.String,
                        inclusive: Schema.Boolean,
                        jurisdiction: Schema.NullOr(Schema.String),
                        jurisdiction_level: Schema.NullOr(Schema.Literals([
                            "city",
                            "country",
                            "county",
                            "district",
                            "multiple",
                            "state",
                        ])),
                        livemode: Schema.Boolean,
                        metadata: Schema.NullOr(Schema.Record(Schema.String, Schema.String)),
                        object: Schema.Literals(["tax_rate"]),
                        percentage: Schema.Number,
                        rate_type: Schema.NullOr(Schema.Literals(["flat_amount", "percentage"])),
                        state: Schema.NullOr(Schema.String),
                        tax_type: Schema.NullOr(Schema.Literals([
                            "amusement_tax",
                            "communications_tax",
                            "gst",
                            "hst",
                            "igst",
                            "jct",
                            "lease_tax",
                            "pst",
                            "qst",
                            "retail_delivery_fee",
                            "rst",
                            "sales_tax",
                            "service_tax",
                            "vat",
                        ])),
                    }))),
                })),
                has_more: Schema.Boolean,
                object: Schema.Literals(["list"]),
                url: Schema.String,
            }),
            latest_invoice: Schema.Unknown,
            livemode: Schema.Boolean,
            metadata: Schema.Record(Schema.String, Schema.String),
            next_pending_invoice_item_invoice: Schema.NullOr(Schema.Number),
            object: Schema.Literals(["subscription"]),
            on_behalf_of: Schema.Unknown,
            pause_collection: Schema.Unknown,
            payment_settings: Schema.Unknown,
            pending_invoice_item_interval: Schema.Unknown,
            pending_setup_intent: Schema.Unknown,
            pending_update: Schema.Unknown,
            presentment_details: Schema.optional(Schema.Struct({
                presentment_currency: Schema.String,
            })),
            schedule: Schema.Unknown,
            start_date: Schema.Number,
            status: Schema.Literals([
                "active",
                "canceled",
                "incomplete",
                "incomplete_expired",
                "past_due",
                "paused",
                "trialing",
                "unpaid",
            ]),
            test_clock: Schema.Unknown,
            transfer_data: Schema.Unknown,
            trial_end: Schema.NullOr(Schema.Number),
            trial_settings: Schema.Unknown,
            trial_start: Schema.NullOr(Schema.Number),
        })),
        has_more: Schema.Boolean,
        object: Schema.Literals(["list"]),
        url: Schema.String,
    })),
    tax: Schema.optional(Schema.Struct({
        automatic_tax: Schema.Literals([
            "failed",
            "not_collecting",
            "supported",
            "unrecognized_location",
        ]),
        ip_address: Schema.NullOr(Schema.String),
        location: Schema.Unknown,
        provider: Schema.Literals(["anrok", "avalara", "sphere", "stripe"]),
    })),
    tax_exempt: Schema.optional(Schema.NullOr(Schema.Literals(["exempt", "none", "reverse"]))),
    tax_ids: Schema.optional(Schema.Struct({
        data: Schema.Array(Schema.Struct({
            country: Schema.NullOr(Schema.String),
            created: Schema.Number,
            customer: Schema.Unknown,
            customer_account: Schema.NullOr(Schema.String),
            id: Schema.String,
            livemode: Schema.Boolean,
            object: Schema.Literals(["tax_id"]),
            owner: Schema.Unknown,
            type: Schema.Literals([
                "ad_nrt",
                "ae_trn",
                "al_tin",
                "am_tin",
                "ao_tin",
                "ar_cuit",
                "au_abn",
                "au_arn",
                "aw_tin",
                "az_tin",
                "ba_tin",
                "bb_tin",
                "bd_bin",
                "bf_ifu",
                "bg_uic",
                "bh_vat",
                "bj_ifu",
                "bo_tin",
                "br_cnpj",
                "br_cpf",
                "bs_tin",
                "by_tin",
                "ca_bn",
                "ca_gst_hst",
                "ca_pst_bc",
                "ca_pst_mb",
                "ca_pst_sk",
                "ca_qst",
                "cd_nif",
                "ch_uid",
                "ch_vat",
                "cl_tin",
                "cm_niu",
                "cn_tin",
                "co_nit",
                "cr_tin",
                "cv_nif",
                "de_stn",
                "do_rcn",
                "ec_ruc",
                "eg_tin",
                "es_cif",
                "et_tin",
                "eu_oss_vat",
                "eu_vat",
                "gb_vat",
                "ge_vat",
                "gn_nif",
                "hk_br",
                "hr_oib",
                "hu_tin",
                "id_npwp",
                "il_vat",
                "in_gst",
                "is_vat",
                "jp_cn",
                "jp_rn",
                "jp_trn",
                "ke_pin",
                "kg_tin",
                "kh_tin",
                "kr_brn",
                "kz_bin",
                "la_tin",
                "li_uid",
                "li_vat",
                "lk_vat",
                "ma_vat",
                "md_vat",
                "me_pib",
                "mk_vat",
                "mr_nif",
                "mx_rfc",
                "my_frp",
                "my_itn",
                "my_sst",
                "ng_tin",
                "no_vat",
                "no_voec",
                "np_pan",
                "nz_gst",
                "om_vat",
                "pe_ruc",
                "ph_tin",
                "pl_nip",
                "ro_tin",
                "rs_pib",
                "ru_inn",
                "ru_kpp",
                "sa_vat",
                "sg_gst",
                "sg_uen",
                "si_tin",
                "sn_ninea",
                "sr_fin",
                "sv_nit",
                "th_vat",
                "tj_tin",
                "tr_tin",
                "tw_vat",
                "tz_vat",
                "ua_vat",
                "ug_tin",
                "unknown",
                "us_ein",
                "uy_ruc",
                "uz_tin",
                "uz_vat",
                "ve_rif",
                "vn_tin",
                "za_vat",
                "zm_tin",
                "zw_tin",
            ]),
            value: Schema.String,
            verification: Schema.Unknown,
        })),
        has_more: Schema.Boolean,
        object: Schema.Literals(["list"]),
        url: Schema.String,
    })),
    test_clock: Schema.optional(Schema.Unknown),
});
// The operation
/**
 * Update a customer
 *
 * <p>Updates the specified customer by setting the values of the parameters passed. Any parameters not provided are left unchanged. For example, if you pass the <strong>source</strong> parameter, that becomes the customer’s active source (such as a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the <strong>source</strong> parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the <code>past_due</code> state, then the latest open invoice for the subscription with automatic collection enabled is retried. This retry doesn’t count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the invoice. Changing the <strong>default_source</strong> for a customer doesn’t trigger this behavior.</p>
 * <p>This request accepts mostly the same arguments as the customer creation call.</p>
 */
export const PostCustomersCustomer = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    inputSchema: PostCustomersCustomerInput,
    outputSchema: PostCustomersCustomerOutput,
}));
//# sourceMappingURL=PostCustomersCustomer.js.map