# All files / codegen/models PricePlan.ts

75.9% Statements 167/220
100% Branches 0/0
0% Functions 0/3
75.9% Lines 167/220

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
    2221x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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';
    import {
        AddOn,
        AddOnFromJSON,
        AddOnFromJSONTyped,
        AddOnToJSON,
    } from './AddOn';
    import {
        Feature,
        FeatureFromJSON,
        FeatureFromJSONTyped,
        FeatureToJSON,
    } from './Feature';
    import {
        Limit,
        LimitFromJSON,
        LimitFromJSONTyped,
        LimitToJSON,
    } from './Limit';
    import {
        MeteredComponent,
        MeteredComponentFromJSON,
        MeteredComponentFromJSONTyped,
        MeteredComponentToJSON,
    } from './MeteredComponent';
    import {
        PricePlanTag,
        PricePlanTagFromJSON,
        PricePlanTagFromJSONTyped,
        PricePlanTagToJSON,
    } from './PricePlanTag';
    import {
        Trial,
        TrialFromJSON,
        TrialFromJSONTyped,
        TrialToJSON,
    } from './Trial';

    /**
     *
     * @export
     * @interface PricePlan
     */
    export interface PricePlan {
        /**
         * External facing unique identifier of a price plan
         * @type {string}
         * @memberof PricePlan
         */
        externalUuid?: string;
        /**
         * Unique name indentifier of a price plan
         * @type {string}
         * @memberof PricePlan
         */
        name: string;
        /**
         * UI-friendly name used for data display. Defaults to `name`.
         * @type {string}
         * @memberof PricePlan
         */
        displayName?: string;
        /**
         *
         * @type {string}
         * @memberof PricePlan
         */
        description?: string | null;
        /**
         * Lowest denomination of currency. e.g. USD is represented as cents.
         * @type {number}
         * @memberof PricePlan
         */
        basePrice?: number | null;
        /**
         *
         * @type {number}
         * @memberof PricePlan
         */
        basePriceFrequency?: number | null;
        /**
         * Custom invoice description for the base price line item.
         * @type {string}
         * @memberof PricePlan
         */
        basePriceDescription?: string | null;
        /**
         * Time period that defines the length of a price plan cycle. One of `day`, `week`, `month`, `quarter`, or `year`.
         * @type {string}
         * @memberof PricePlan
         */
        period: string;
        /**
         *
         * @type {Array<MeteredComponent>}
         * @memberof PricePlan
         */
        meteredComponents: Array<MeteredComponent>;
        /**
         * Minimum amount to charge every 'period'
         * @type {number}
         * @memberof PricePlan
         */
        minimumCharge?: number | null;
        /**
         * The frequency (as a an integer multiple of the period) at which to charge the minimum charge.
         * @type {number}
         * @memberof PricePlan
         */
        minimumChargeFrequency?: number | null;
        /**
         *
         * @type {Array<Feature>}
         * @memberof PricePlan
         */
        features?: Array<Feature>;
        /**
         *
         * @type {Array<AddOn>}
         * @memberof PricePlan
         */
        addOns?: Array<AddOn>;
        /**
         *
         * @type {Array<Limit>}
         * @memberof PricePlan
         */
        limits?: Array<Limit>;
        /**
         *
         * @type {Array<PricePlanTag>}
         * @memberof PricePlan
         */
        tags?: Array<PricePlanTag>;
        /**
         *
         * @type {Trial}
         * @memberof PricePlan
         */
        trial?: Trial;
        /**
         * ISO-8601 formatted creation timestamp of price plan version
         * @type {Date}
         * @memberof PricePlan
         */
        createdAt?: Date;
    }

    export function PricePlanFromJSON(json: any): PricePlan {
        return PricePlanFromJSONTyped(json, false);
    }

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

            'externalUuid': !exists(json, 'external_uuid') ? undefined : json['external_uuid'],
            'name': json['name'],
            'displayName': !exists(json, 'display_name') ? undefined : json['display_name'],
            'description': !exists(json, 'description') ? undefined : json['description'],
            'basePrice': !exists(json, 'base_price') ? undefined : json['base_price'],
            'basePriceFrequency': !exists(json, 'base_price_frequency') ? undefined : json['base_price_frequency'],
            'basePriceDescription': !exists(json, 'base_price_description') ? undefined : json['base_price_description'],
            'period': json['period'],
            'meteredComponents': ((json['metered_components'] as Array<any>).map(MeteredComponentFromJSON)),
            'minimumCharge': !exists(json, 'minimum_charge') ? undefined : json['minimum_charge'],
            'minimumChargeFrequency': !exists(json, 'minimum_charge_frequency') ? undefined : json['minimum_charge_frequency'],
            'features': !exists(json, 'features') ? undefined : ((json['features'] as Array<any>).map(FeatureFromJSON)),
            'addOns': !exists(json, 'add_ons') ? undefined : ((json['add_ons'] as Array<any>).map(AddOnFromJSON)),
            'limits': !exists(json, 'limits') ? undefined : ((json['limits'] as Array<any>).map(LimitFromJSON)),
            'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array<any>).map(PricePlanTagFromJSON)),
            'trial': !exists(json, 'trial') ? undefined : TrialFromJSON(json['trial']),
            'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
        };
    }

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

            'external_uuid': value.externalUuid,
            'name': value.name,
            'display_name': value.displayName,
            'description': value.description,
            'base_price': value.basePrice,
            'base_price_frequency': value.basePriceFrequency,
            'base_price_description': value.basePriceDescription,
            'period': value.period,
            'metered_components': ((value.meteredComponents as Array<any>).map(MeteredComponentToJSON)),
            'minimum_charge': value.minimumCharge,
            'minimum_charge_frequency': value.minimumChargeFrequency,
            'features': value.features === undefined ? undefined : ((value.features as Array<any>).map(FeatureToJSON)),
            'add_ons': value.addOns === undefined ? undefined : ((value.addOns as Array<any>).map(AddOnToJSON)),
            'limits': value.limits === undefined ? undefined : ((value.limits as Array<any>).map(LimitToJSON)),
            'tags': value.tags === undefined ? undefined : ((value.tags as Array<any>).map(PricePlanTagToJSON)),
            'trial': TrialToJSON(value.trial),
            'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
        };
    }