# All files / codegen/models CreditPlan.ts

68.9% Statements 82/119
100% Branches 0/0
0% Functions 0/3
68.9% Lines 82/119

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
    1211x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 CreditPlan
     */
    export interface CreditPlan {
        /**
         * Unique identifier of this credit plan.
         * @type {string}
         * @memberof CreditPlan
         */
        uuid?: string;
        /**
         * Amount of credits that are granted in a single grant.
         * @type {number}
         * @memberof CreditPlan
         */
        amount: number;
        /**
         * Price for the grant, in lowest denomination (i.e cents).
         * @type {number}
         * @memberof CreditPlan
         */
        price: number;
        /**
         * A description that will be used on the invoice line items.
         * @type {string}
         * @memberof CreditPlan
         */
        description?: string | null;
        /**
         * Duration length before each credit grant expires. Null for no expiration.
         * @type {number}
         * @memberof CreditPlan
         */
        grantExpirationLength?: number | null;
        /**
         * Duration unit before each credit grant expires. Null for no expiration.
         * @type {string}
         * @memberof CreditPlan
         */
        grantExpirationUnit?: string | null;
        /**
         * Interval, in billing cycles, between each credit grant. Null for single grant plans.
         * @type {number}
         * @memberof CreditPlan
         */
        intervalBetweenGrants?: number | null;
        /**
         * Billing cycles between payments. Null for grants paid in a single payment. If this plan has recurring grants (i.e `interval_between_grants` is not null), then this field must be a factor of `interval_between_grants`.
         * @type {number}
         * @memberof CreditPlan
         */
        intervalBetweenPayments?: number | null;
        /**
         * How many payments each credit grant will have. 1 for single payment grants. If this plan has has recurring grants (i.e `interval_between_grants` is not null), then this field must be a factor of `interval_between_grants`.
         * @type {number}
         * @memberof CreditPlan
         */
        paymentsPerGrant: number;
    }

    export function CreditPlanFromJSON(json: any): CreditPlan {
        return CreditPlanFromJSONTyped(json, false);
    }

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

            'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
            'amount': json['amount'],
            'price': json['price'],
            'description': !exists(json, 'description') ? undefined : json['description'],
            'grantExpirationLength': !exists(json, 'grant_expiration_length') ? undefined : json['grant_expiration_length'],
            'grantExpirationUnit': !exists(json, 'grant_expiration_unit') ? undefined : json['grant_expiration_unit'],
            'intervalBetweenGrants': !exists(json, 'interval_between_grants') ? undefined : json['interval_between_grants'],
            'intervalBetweenPayments': !exists(json, 'interval_between_payments') ? undefined : json['interval_between_payments'],
            'paymentsPerGrant': json['payments_per_grant'],
        };
    }

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

            'uuid': value.uuid,
            'amount': value.amount,
            'price': value.price,
            'description': value.description,
            'grant_expiration_length': value.grantExpirationLength,
            'grant_expiration_unit': value.grantExpirationUnit,
            'interval_between_grants': value.intervalBetweenGrants,
            'interval_between_payments': value.intervalBetweenPayments,
            'payments_per_grant': value.paymentsPerGrant,
        };
    }