# All files / codegen/models ActiveSubscription.ts

77.48% Statements 179/231
100% Branches 0/0
0% Functions 0/3
77.48% Lines 179/231

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
    2331x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 {
        BillingCycleDate,
        BillingCycleDateFromJSON,
        BillingCycleDateFromJSONTyped,
        BillingCycleDateToJSON,
    } from './BillingCycleDate';
    import {
        CreditPlan,
        CreditPlanFromJSON,
        CreditPlanFromJSONTyped,
        CreditPlanToJSON,
    } from './CreditPlan';
    import {
        Discount,
        DiscountFromJSON,
        DiscountFromJSONTyped,
        DiscountToJSON,
    } from './Discount';
    import {
        Feature,
        FeatureFromJSON,
        FeatureFromJSONTyped,
        FeatureToJSON,
    } from './Feature';
    import {
        Limit,
        LimitFromJSON,
        LimitFromJSONTyped,
        LimitToJSON,
    } from './Limit';
    import {
        PricePlan,
        PricePlanFromJSON,
        PricePlanFromJSONTyped,
        PricePlanToJSON,
    } from './PricePlan';
    import {
        Trial,
        TrialFromJSON,
        TrialFromJSONTyped,
        TrialToJSON,
    } from './Trial';

    /**
     *
     * @export
     * @interface ActiveSubscription
     */
    export interface ActiveSubscription {
        /**
         *
         * @type {string}
         * @memberof ActiveSubscription
         */
        uuid: string;
        /**
         * Unique name identifier of a customer
         * @type {any}
         * @memberof ActiveSubscription
         */
        customerName: any | null;
        /**
         * Unique name indentifier of a price plan
         * @type {any}
         * @memberof ActiveSubscription
         */
        readonly pricePlanName: any | null;
        /**
         * External facing unique identifier of a price plan
         * @type {any}
         * @memberof ActiveSubscription
         */
        readonly pricePlanUuid: any | null;
        /**
         * Price plan associated with this subscription.
         * @type {PricePlan}
         * @memberof ActiveSubscription
         */
        pricePlan?: PricePlan | null;
        /**
         *
         * @type {Array<Discount>}
         * @memberof ActiveSubscription
         */
        discounts?: Array<Discount>;
        /**
         *
         * @type {any}
         * @memberof ActiveSubscription
         */
        readonly addOns?: any | null;
        /**
         * Optional trial override for the associated subscription.
         * @type {Trial}
         * @memberof ActiveSubscription
         */
        trialOverride?: Trial | null;
        /**
         *
         * @type {Array<Feature>}
         * @memberof ActiveSubscription
         */
        featuresOverride?: Array<Feature>;
        /**
         *
         * @type {Array<Limit>}
         * @memberof ActiveSubscription
         */
        limitsOverride?: Array<Limit>;
        /**
         * ISO-8601 formatted timestamp that defines when the subscription should take effect. If this field is omitted, the subscription is effective upon creation.
         * @type {Date}
         * @memberof ActiveSubscription
         */
        effectiveAt?: Date;
        /**
         * ISO-8601 formatted timestamp that defines when the subscription will expire.
         * @type {Date}
         * @memberof ActiveSubscription
         */
        expiredAt?: Date | null;
        /**
         * Credit plan associated with this subscription.
         * @type {CreditPlan}
         * @memberof ActiveSubscription
         */
        creditPlan?: CreditPlan | null;
        /**
         * Align billing cycles to a calendar unit if true. For example if the period is month, cycles will end on the first of every month.
         * @type {boolean}
         * @memberof ActiveSubscription
         */
        alignToCalendar?: boolean;
        /**
         * Optional base price override for the associated subscription.
         * @type {number}
         * @memberof ActiveSubscription
         */
        basePriceOverride?: number | null;
        /**
         *
         * @type {BillingCycleDate}
         * @memberof ActiveSubscription
         */
        currentBillingCycle?: BillingCycleDate;
        /**
         *
         * @type {number}
         * @memberof ActiveSubscription
         */
        totalFixedPrice?: number;
        /**
         *
         * @type {number}
         * @memberof ActiveSubscription
         */
        discountedFixedPrice?: number;
    }

    export function ActiveSubscriptionFromJSON(json: any): ActiveSubscription {
        return ActiveSubscriptionFromJSONTyped(json, false);
    }

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

            'uuid': json['uuid'],
            'customerName': json['customer_name'],
            'pricePlanName': json['price_plan_name'],
            'pricePlanUuid': json['price_plan_uuid'],
            'pricePlan': !exists(json, 'price_plan') ? undefined : PricePlanFromJSON(json['price_plan']),
            'discounts': !exists(json, 'discounts') ? undefined : ((json['discounts'] as Array<any>).map(DiscountFromJSON)),
            'addOns': !exists(json, 'add_ons') ? undefined : json['add_ons'],
            'trialOverride': !exists(json, 'trial_override') ? undefined : TrialFromJSON(json['trial_override']),
            'featuresOverride': !exists(json, 'features_override') ? undefined : ((json['features_override'] as Array<any>).map(FeatureFromJSON)),
            'limitsOverride': !exists(json, 'limits_override') ? undefined : ((json['limits_override'] as Array<any>).map(LimitFromJSON)),
            'effectiveAt': !exists(json, 'effective_at') ? undefined : (new Date(json['effective_at'])),
            'expiredAt': !exists(json, 'expired_at') ? undefined : (json['expired_at'] === null ? null : new Date(json['expired_at'])),
            'creditPlan': !exists(json, 'credit_plan') ? undefined : CreditPlanFromJSON(json['credit_plan']),
            'alignToCalendar': !exists(json, 'align_to_calendar') ? undefined : json['align_to_calendar'],
            'basePriceOverride': !exists(json, 'base_price_override') ? undefined : json['base_price_override'],
            'currentBillingCycle': !exists(json, 'current_billing_cycle') ? undefined : BillingCycleDateFromJSON(json['current_billing_cycle']),
            'totalFixedPrice': !exists(json, 'total_fixed_price') ? undefined : json['total_fixed_price'],
            'discountedFixedPrice': !exists(json, 'discounted_fixed_price') ? undefined : json['discounted_fixed_price'],
        };
    }

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

            'uuid': value.uuid,
            'customer_name': value.customerName,
            'price_plan': PricePlanToJSON(value.pricePlan),
            'discounts': value.discounts === undefined ? undefined : ((value.discounts as Array<any>).map(DiscountToJSON)),
            'trial_override': TrialToJSON(value.trialOverride),
            'features_override': value.featuresOverride === undefined ? undefined : ((value.featuresOverride as Array<any>).map(FeatureToJSON)),
            'limits_override': value.limitsOverride === undefined ? undefined : ((value.limitsOverride as Array<any>).map(LimitToJSON)),
            'effective_at': value.effectiveAt === undefined ? undefined : (value.effectiveAt.toISOString()),
            'expired_at': value.expiredAt === undefined ? undefined : (value.expiredAt === null ? null : value.expiredAt.toISOString()),
            'credit_plan': CreditPlanToJSON(value.creditPlan),
            'align_to_calendar': value.alignToCalendar,
            'base_price_override': value.basePriceOverride,
            'current_billing_cycle': BillingCycleDateToJSON(value.currentBillingCycle),
            'total_fixed_price': value.totalFixedPrice,
            'discounted_fixed_price': value.discountedFixedPrice,
        };
    }