# All files / codegen/models BillingSettings.ts

73.18% Statements 262/358
100% Branches 0/0
0% Functions 0/3
73.18% Lines 262/358

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    3601x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x
    1x

    1x
    1x

     /* tslint:disable */
    /* eslint-disable */
    /**
     * Octane API
     * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     *
     * The version of the OpenAPI document: 1.0.0
     *
     *
     * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
     * https://openapi-generator.tech
     * Do not edit the class manually.
     */

    import { exists, mapValues } from '../runtime';
    /**
     *
     * @export
     * @interface BillingSettings
     */
    export interface BillingSettings {
        /**
         * Time length of the grace period between the end of a billing cycle and invoice generation in days.
         * @type {number}
         * @memberof BillingSettings
         */
        invoiceGracePeriodLength?: number | null;
        /**
         * Time length unit of the grace period between the end of a billing cycle and invoice generation. Must be `day`.
         * @type {string}
         * @memberof BillingSettings
         */
        invoiceGracePeriodUnit?: string | null;
        /**
         * Time length of the grace period between the end of invoice generation and the actual charge. *NOTE*: The specified length is unitless. Unit is designated with the `payment_grace_period_unit` field.
         * @type {number}
         * @memberof BillingSettings
         */
        paymentGracePeriodLength?: number | null;
        /**
         * Time length unit of the grace period between the end of invoice generation and actual charge. One of `minute`, `hour`, `day`.
         * @type {string}
         * @memberof BillingSettings
         */
        paymentGracePeriodUnit?: string | null;
        /**
         * Flag that controls whether or not invoices should be sent to customers.
         * @type {boolean}
         * @memberof BillingSettings
         */
        shouldSendInvoiceToCustomers?: boolean | null;
        /**
         * Flag that controls whether to invoice through Octane or through payment provider
         * @type {boolean}
         * @memberof BillingSettings
         */
        invoiceViaOctane?: boolean | null;
        /**
         * Flag that controls whether invoices are auto-approved or require manual approval
         * @type {boolean}
         * @memberof BillingSettings
         */
        autoApproveInvoices?: boolean | null;
        /**
         *
         * @type {any}
         * @memberof BillingSettings
         */
        readonly customerInvoiceDetailLevel?: any | null;
        /**
         * Flag that controls whether or not to auto-charge the customer based on the invoice.
         * @type {boolean}
         * @memberof BillingSettings
         */
        chargesEnabled?: boolean | null;
        /**
         * Flag that controls whether or not to invoice/charge the base rate, add ons and other fixed price plan components at the beginning of the billing cycle.
         * @type {boolean}
         * @memberof BillingSettings
         */
        invoiceFixedComponentsAtStart?: boolean | null;
        /**
         * Flag that controls the number of retry attempts for invoicing/payments.
         * @type {number}
         * @memberof BillingSettings
         */
        retryAttempts?: number | null;
        /**
         * Time length after which to attempt invoice/payment retry.
         * @type {number}
         * @memberof BillingSettings
         */
        retryFrequencyLength?: number | null;
        /**
         * Time length unit after which to attempt invoice/payment retry.
         * @type {string}
         * @memberof BillingSettings
         */
        retryFrequencyUnit?: string | null;
        /**
         * The percentage tax rate to apply to invoices.
         * @type {number}
         * @memberof BillingSettings
         */
        taxRate?: number | null;
        /**
         * Flag that controls whether to do automated taxes via payment provider
         * @type {boolean}
         * @memberof BillingSettings
         */
        taxViaPaymentProvider?: boolean | null;
        /**
         * Flag that controls whether or not to invoice/charge gauge meters upfront according to their value at start of cycle. Only applies if invoice_fixed_components_at_start is enabled.
         * @type {boolean}
         * @memberof BillingSettings
         */
        invoiceMeteredComponentsAtStart?: boolean | null;
        /**
         * Flag that controls whether or not to invoice/charge a true up for a billing cycle on the following invoice. Only applies if invoice_fixed_components_at_start is enabled.
         * @type {boolean}
         * @memberof BillingSettings
         */
        invoiceOverages?: boolean | null;
        /**
         * Optional description attached to the invoice
         * @type {string}
         * @memberof BillingSettings
         */
        invoiceMemo?: string | null;
        /**
         * Sets the due date on invoices to the number of days after the invoice is sent
         * @type {number}
         * @memberof BillingSettings
         */
        daysUntilDue?: number | null;
        /**
         * If using stripe, this field can be used to configure whether invoices should be auto advanced for collection
         * @type {boolean}
         * @memberof BillingSettings
         */
        stripeAutoAdvance?: boolean | null;
        /**
         * Default value for whether to align billing cycles to calendar on subscriptions
         * @type {boolean}
         * @memberof BillingSettings
         */
        alignBillingCyclesToCalendar?: boolean | null;
        /**
         * Optional url of a custom image to include on invoices.
         * @type {string}
         * @memberof BillingSettings
         */
        invoiceLogoUrl?: string | null;
        /**
         * Flag determining whether ACH/Wire instructions should be included on invoices.
         * @type {boolean}
         * @memberof BillingSettings
         */
        includeAchInstructions?: boolean | null;
        /**
         * Account name for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achAccountName?: string | null;
        /**
         * ABA/Routing number for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achRoutingNumber?: string | null;
        /**
         * Account number for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achAccountNumber?: string | null;
        /**
         * Swift code for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achSwiftCode?: string | null;
        /**
         * Bank name for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achBankName?: string | null;
        /**
         * First line of bank address for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achBankAddress1?: string | null;
        /**
         * Second line of bank address for ACH/Wire transfer instructions
         * @type {string}
         * @memberof BillingSettings
         */
        achBankAddress2?: string | null;
        /**
         * True if customer updates should be synced to Stripe.
         * @type {boolean}
         * @memberof BillingSettings
         */
        syncCustomerDataToPaymentGateway?: boolean | null;
        /**
         * If using Stripe, this field can be used to configure whether invoices should be finalized immediately when they are created.
         * @type {boolean}
         * @memberof BillingSettings
         */
        stripeImmediateFinalization?: boolean | null;
        /**
         * If set, we will use this template id for our emails instead of our default one
         * @type {string}
         * @memberof BillingSettings
         */
        alternateSendgridTemplateId?: string | null;
        /**
         * If set, a minimum charge line item will override any line items that contribute to the minimum (i.e., the minimum charge line item would be the only line item).
         * @type {boolean}
         * @memberof BillingSettings
         */
        shouldMinimumChargeOverrideLineItems?: boolean | null;
        /**
         * Flag that controls whether to send receipts for paid invoices.
         * @type {boolean}
         * @memberof BillingSettings
         */
        sendReceipts?: boolean | null;
        /**
         * Flag that controls whether to communicate payment failures.
         * @type {boolean}
         * @memberof BillingSettings
         */
        communicatePaymentFailures?: boolean | null;
        /**
         * List of days before an invoice is due to communicate upcoming due notices.
         * @type {any}
         * @memberof BillingSettings
         */
        upcomingReminderDaysArray?: any | null;
        /**
         * List of days after an invoice is due to communicate past due notices.
         * @type {any}
         * @memberof BillingSettings
         */
        pastDueReminderDaysArray?: any | null;
        /**
         * Whether newly attached Stripe payment methods should be made the default for customers.
         * @type {boolean}
         * @memberof BillingSettings
         */
        autoUpdateStripeDefaultPaymentMethod?: boolean | null;
    }

    export function BillingSettingsFromJSON(json: any): BillingSettings {
        return BillingSettingsFromJSONTyped(json, false);
    }

    export function BillingSettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingSettings {
        if ((json === undefined) || (json === null)) {
            return json;
        }
        return {

            'invoiceGracePeriodLength': !exists(json, 'invoice_grace_period_length') ? undefined : json['invoice_grace_period_length'],
            'invoiceGracePeriodUnit': !exists(json, 'invoice_grace_period_unit') ? undefined : json['invoice_grace_period_unit'],
            'paymentGracePeriodLength': !exists(json, 'payment_grace_period_length') ? undefined : json['payment_grace_period_length'],
            'paymentGracePeriodUnit': !exists(json, 'payment_grace_period_unit') ? undefined : json['payment_grace_period_unit'],
            'shouldSendInvoiceToCustomers': !exists(json, 'should_send_invoice_to_customers') ? undefined : json['should_send_invoice_to_customers'],
            'invoiceViaOctane': !exists(json, 'invoice_via_octane') ? undefined : json['invoice_via_octane'],
            'autoApproveInvoices': !exists(json, 'auto_approve_invoices') ? undefined : json['auto_approve_invoices'],
            'customerInvoiceDetailLevel': !exists(json, 'customer_invoice_detail_level') ? undefined : json['customer_invoice_detail_level'],
            'chargesEnabled': !exists(json, 'charges_enabled') ? undefined : json['charges_enabled'],
            'invoiceFixedComponentsAtStart': !exists(json, 'invoice_fixed_components_at_start') ? undefined : json['invoice_fixed_components_at_start'],
            'retryAttempts': !exists(json, 'retry_attempts') ? undefined : json['retry_attempts'],
            'retryFrequencyLength': !exists(json, 'retry_frequency_length') ? undefined : json['retry_frequency_length'],
            'retryFrequencyUnit': !exists(json, 'retry_frequency_unit') ? undefined : json['retry_frequency_unit'],
            'taxRate': !exists(json, 'tax_rate') ? undefined : json['tax_rate'],
            'taxViaPaymentProvider': !exists(json, 'tax_via_payment_provider') ? undefined : json['tax_via_payment_provider'],
            'invoiceMeteredComponentsAtStart': !exists(json, 'invoice_metered_components_at_start') ? undefined : json['invoice_metered_components_at_start'],
            'invoiceOverages': !exists(json, 'invoice_overages') ? undefined : json['invoice_overages'],
            'invoiceMemo': !exists(json, 'invoice_memo') ? undefined : json['invoice_memo'],
            'daysUntilDue': !exists(json, 'days_until_due') ? undefined : json['days_until_due'],
            'stripeAutoAdvance': !exists(json, 'stripe_auto_advance') ? undefined : json['stripe_auto_advance'],
            'alignBillingCyclesToCalendar': !exists(json, 'align_billing_cycles_to_calendar') ? undefined : json['align_billing_cycles_to_calendar'],
            'invoiceLogoUrl': !exists(json, 'invoice_logo_url') ? undefined : json['invoice_logo_url'],
            'includeAchInstructions': !exists(json, 'include_ach_instructions') ? undefined : json['include_ach_instructions'],
            'achAccountName': !exists(json, 'ach_account_name') ? undefined : json['ach_account_name'],
            'achRoutingNumber': !exists(json, 'ach_routing_number') ? undefined : json['ach_routing_number'],
            'achAccountNumber': !exists(json, 'ach_account_number') ? undefined : json['ach_account_number'],
            'achSwiftCode': !exists(json, 'ach_swift_code') ? undefined : json['ach_swift_code'],
            'achBankName': !exists(json, 'ach_bank_name') ? undefined : json['ach_bank_name'],
            'achBankAddress1': !exists(json, 'ach_bank_address_1') ? undefined : json['ach_bank_address_1'],
            'achBankAddress2': !exists(json, 'ach_bank_address_2') ? undefined : json['ach_bank_address_2'],
            'syncCustomerDataToPaymentGateway': !exists(json, 'sync_customer_data_to_payment_gateway') ? undefined : json['sync_customer_data_to_payment_gateway'],
            'stripeImmediateFinalization': !exists(json, 'stripe_immediate_finalization') ? undefined : json['stripe_immediate_finalization'],
            'alternateSendgridTemplateId': !exists(json, 'alternate_sendgrid_template_id') ? undefined : json['alternate_sendgrid_template_id'],
            'shouldMinimumChargeOverrideLineItems': !exists(json, 'should_minimum_charge_override_line_items') ? undefined : json['should_minimum_charge_override_line_items'],
            'sendReceipts': !exists(json, 'send_receipts') ? undefined : json['send_receipts'],
            'communicatePaymentFailures': !exists(json, 'communicate_payment_failures') ? undefined : json['communicate_payment_failures'],
            'upcomingReminderDaysArray': !exists(json, 'upcoming_reminder_days_array') ? undefined : json['upcoming_reminder_days_array'],
            'pastDueReminderDaysArray': !exists(json, 'past_due_reminder_days_array') ? undefined : json['past_due_reminder_days_array'],
            'autoUpdateStripeDefaultPaymentMethod': !exists(json, 'auto_update_stripe_default_payment_method') ? undefined : json['auto_update_stripe_default_payment_method'],
        };
    }

    export function BillingSettingsToJSON(value?: BillingSettings | null): any {
        if (value === undefined) {
            return undefined;
        }
        if (value === null) {
            return null;
        }
        return {

            'invoice_grace_period_length': value.invoiceGracePeriodLength,
            'invoice_grace_period_unit': value.invoiceGracePeriodUnit,
            'payment_grace_period_length': value.paymentGracePeriodLength,
            'payment_grace_period_unit': value.paymentGracePeriodUnit,
            'should_send_invoice_to_customers': value.shouldSendInvoiceToCustomers,
            'invoice_via_octane': value.invoiceViaOctane,
            'auto_approve_invoices': value.autoApproveInvoices,
            'charges_enabled': value.chargesEnabled,
            'invoice_fixed_components_at_start': value.invoiceFixedComponentsAtStart,
            'retry_attempts': value.retryAttempts,
            'retry_frequency_length': value.retryFrequencyLength,
            'retry_frequency_unit': value.retryFrequencyUnit,
            'tax_rate': value.taxRate,
            'tax_via_payment_provider': value.taxViaPaymentProvider,
            'invoice_metered_components_at_start': value.invoiceMeteredComponentsAtStart,
            'invoice_overages': value.invoiceOverages,
            'invoice_memo': value.invoiceMemo,
            'days_until_due': value.daysUntilDue,
            'stripe_auto_advance': value.stripeAutoAdvance,
            'align_billing_cycles_to_calendar': value.alignBillingCyclesToCalendar,
            'invoice_logo_url': value.invoiceLogoUrl,
            'include_ach_instructions': value.includeAchInstructions,
            'ach_account_name': value.achAccountName,
            'ach_routing_number': value.achRoutingNumber,
            'ach_account_number': value.achAccountNumber,
            'ach_swift_code': value.achSwiftCode,
            'ach_bank_name': value.achBankName,
            'ach_bank_address_1': value.achBankAddress1,
            'ach_bank_address_2': value.achBankAddress2,
            'sync_customer_data_to_payment_gateway': value.syncCustomerDataToPaymentGateway,
            'stripe_immediate_finalization': value.stripeImmediateFinalization,
            'alternate_sendgrid_template_id': value.alternateSendgridTemplateId,
            'should_minimum_charge_override_line_items': value.shouldMinimumChargeOverrideLineItems,
            'send_receipts': value.sendReceipts,
            'communicate_payment_failures': value.communicatePaymentFailures,
            'upcoming_reminder_days_array': value.upcomingReminderDaysArray,
            'past_due_reminder_days_array': value.pastDueReminderDaysArray,
            'auto_update_stripe_default_payment_method': value.autoUpdateStripeDefaultPaymentMethod,
        };
    }