# All files / codegen/models SelfServeSettings.ts

67.96% Statements 70/103
100% Branches 0/0
0% Functions 0/3
67.96% Lines 70/103

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
    1051x
    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 SelfServeSettings
     */
    export interface SelfServeSettings {
        /**
         * True if the customer can purchase credits via self serve. Defaults to False.
         * @type {boolean}
         * @memberof SelfServeSettings
         */
        purchaseCredits: boolean;
        /**
         * Time length of the default expiration for credits bought in the customer portal.
         * @type {number}
         * @memberof SelfServeSettings
         */
        creditsExpirationLength?: number | null;
        /**
         * Time length unit for the default expiration for credits bought in the customer portal.
         * @type {string}
         * @memberof SelfServeSettings
         */
        creditsExpirationUnit?: string | null;
        /**
         * Price per credit, in cents, that the customer is charged for buying credits through the customer portal
         * @type {number}
         * @memberof SelfServeSettings
         */
        pricePerCreditCents?: number | null;
        /**
         * True if the customer can switch their current price plan via self serve. Defaults to False.
         * @type {boolean}
         * @memberof SelfServeSettings
         */
        switchPricePlans: boolean;
        /**
         * True if payment form should have fields for shipping address info. Defaults to False.
         * @type {boolean}
         * @memberof SelfServeSettings
         */
        enableAddressFields?: boolean;
        /**
         * True if the vendor has enabled customization for their customer portal.
         * @type {boolean}
         * @memberof SelfServeSettings
         */
        customization?: boolean;
    }

    export function SelfServeSettingsFromJSON(json: any): SelfServeSettings {
        return SelfServeSettingsFromJSONTyped(json, false);
    }

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

            'purchaseCredits': json['purchase_credits'],
            'creditsExpirationLength': !exists(json, 'credits_expiration_length') ? undefined : json['credits_expiration_length'],
            'creditsExpirationUnit': !exists(json, 'credits_expiration_unit') ? undefined : json['credits_expiration_unit'],
            'pricePerCreditCents': !exists(json, 'price_per_credit_cents') ? undefined : json['price_per_credit_cents'],
            'switchPricePlans': json['switch_price_plans'],
            'enableAddressFields': !exists(json, 'enable_address_fields') ? undefined : json['enable_address_fields'],
            'customization': !exists(json, 'customization') ? undefined : json['customization'],
        };
    }

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

            'purchase_credits': value.purchaseCredits,
            'credits_expiration_length': value.creditsExpirationLength,
            'credits_expiration_unit': value.creditsExpirationUnit,
            'price_per_credit_cents': value.pricePerCreditCents,
            'switch_price_plans': value.switchPricePlans,
            'enable_address_fields': value.enableAddressFields,
            'customization': value.customization,
        };
    }