# All files / codegen/models CreateSubscriptionArgs.ts

76.06% Statements 143/188
100% Branches 0/0
0% Functions 0/3
76.06% Lines 143/188

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
    1901x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 {
        CreditPlanInputArgs,
        CreditPlanInputArgsFromJSON,
        CreditPlanInputArgsFromJSONTyped,
        CreditPlanInputArgsToJSON,
    } from './CreditPlanInputArgs';
    import {
        DiscountInputArgs,
        DiscountInputArgsFromJSON,
        DiscountInputArgsFromJSONTyped,
        DiscountInputArgsToJSON,
    } from './DiscountInputArgs';
    import {
        FeatureInputArgs,
        FeatureInputArgsFromJSON,
        FeatureInputArgsFromJSONTyped,
        FeatureInputArgsToJSON,
    } from './FeatureInputArgs';
    import {
        LimitInputArgs,
        LimitInputArgsFromJSON,
        LimitInputArgsFromJSONTyped,
        LimitInputArgsToJSON,
    } from './LimitInputArgs';
    import {
        SubscriptionAddOnInput,
        SubscriptionAddOnInputFromJSON,
        SubscriptionAddOnInputFromJSONTyped,
        SubscriptionAddOnInputToJSON,
    } from './SubscriptionAddOnInput';
    import {
        TrialInputArgs,
        TrialInputArgsFromJSON,
        TrialInputArgsFromJSONTyped,
        TrialInputArgsToJSON,
    } from './TrialInputArgs';

    /**
     *
     * @export
     * @interface CreateSubscriptionArgs
     */
    export interface CreateSubscriptionArgs {
        /**
         * DEPRECATED - use discounts field
         * @type {DiscountInputArgs}
         * @memberof CreateSubscriptionArgs
         */
        discountOverride?: DiscountInputArgs | null;
        /**
         *
         * @type {Date}
         * @memberof CreateSubscriptionArgs
         */
        effectiveAt?: Date;
        /**
         *
         * @type {TrialInputArgs}
         * @memberof CreateSubscriptionArgs
         */
        trialOverride?: TrialInputArgs;
        /**
         * The name of the price plan to subscribe customer to. Either provide price plan UUID or name/tag but not both.
         * @type {string}
         * @memberof CreateSubscriptionArgs
         */
        pricePlanName?: string;
        /**
         * The tag of the specific price plan version for the given price_plan_name. Should only be set if identifying price plan by name.
         * @type {string}
         * @memberof CreateSubscriptionArgs
         */
        pricePlanTag?: string;
        /**
         *
         * @type {Array<LimitInputArgs>}
         * @memberof CreateSubscriptionArgs
         */
        limitsOverride?: Array<LimitInputArgs>;
        /**
         * Whether to align this subscripton's billing cycles to calendar boundaries (e.g., begining of every month). If the subscripiton is effective as of the middle of the month, the first cycle will be prorated appropriately.
         * @type {boolean}
         * @memberof CreateSubscriptionArgs
         */
        alignToCalendar?: boolean;
        /**
         *
         * @type {Array<DiscountInputArgs>}
         * @memberof CreateSubscriptionArgs
         */
        discounts?: Array<DiscountInputArgs>;
        /**
         *
         * @type {string}
         * @memberof CreateSubscriptionArgs
         */
        couponOverrideName?: string;
        /**
         *
         * @type {Array<SubscriptionAddOnInput>}
         * @memberof CreateSubscriptionArgs
         */
        addOns?: Array<SubscriptionAddOnInput>;
        /**
         * The UUID of the specific price plan version to subscribe customer to. Either provide price plan UUID or name/tag but not both.
         * @type {string}
         * @memberof CreateSubscriptionArgs
         */
        pricePlanUuid?: string;
        /**
         * Credit plan associated with this subscription.
         * @type {CreditPlanInputArgs}
         * @memberof CreateSubscriptionArgs
         */
        creditPlan?: CreditPlanInputArgs | null;
        /**
         *
         * @type {Array<FeatureInputArgs>}
         * @memberof CreateSubscriptionArgs
         */
        featuresOverride?: Array<FeatureInputArgs>;
    }

    export function CreateSubscriptionArgsFromJSON(json: any): CreateSubscriptionArgs {
        return CreateSubscriptionArgsFromJSONTyped(json, false);
    }

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

            'discountOverride': !exists(json, 'discount_override') ? undefined : DiscountInputArgsFromJSON(json['discount_override']),
            'effectiveAt': !exists(json, 'effective_at') ? undefined : (new Date(json['effective_at'])),
            'trialOverride': !exists(json, 'trial_override') ? undefined : TrialInputArgsFromJSON(json['trial_override']),
            'pricePlanName': !exists(json, 'price_plan_name') ? undefined : json['price_plan_name'],
            'pricePlanTag': !exists(json, 'price_plan_tag') ? undefined : json['price_plan_tag'],
            'limitsOverride': !exists(json, 'limits_override') ? undefined : ((json['limits_override'] as Array<any>).map(LimitInputArgsFromJSON)),
            'alignToCalendar': !exists(json, 'align_to_calendar') ? undefined : json['align_to_calendar'],
            'discounts': !exists(json, 'discounts') ? undefined : ((json['discounts'] as Array<any>).map(DiscountInputArgsFromJSON)),
            'couponOverrideName': !exists(json, 'coupon_override_name') ? undefined : json['coupon_override_name'],
            'addOns': !exists(json, 'add_ons') ? undefined : ((json['add_ons'] as Array<any>).map(SubscriptionAddOnInputFromJSON)),
            'pricePlanUuid': !exists(json, 'price_plan_uuid') ? undefined : json['price_plan_uuid'],
            'creditPlan': !exists(json, 'credit_plan') ? undefined : CreditPlanInputArgsFromJSON(json['credit_plan']),
            'featuresOverride': !exists(json, 'features_override') ? undefined : ((json['features_override'] as Array<any>).map(FeatureInputArgsFromJSON)),
        };
    }

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

            'discount_override': DiscountInputArgsToJSON(value.discountOverride),
            'effective_at': value.effectiveAt === undefined ? undefined : (value.effectiveAt.toISOString()),
            'trial_override': TrialInputArgsToJSON(value.trialOverride),
            'price_plan_name': value.pricePlanName,
            'price_plan_tag': value.pricePlanTag,
            'limits_override': value.limitsOverride === undefined ? undefined : ((value.limitsOverride as Array<any>).map(LimitInputArgsToJSON)),
            'align_to_calendar': value.alignToCalendar,
            'discounts': value.discounts === undefined ? undefined : ((value.discounts as Array<any>).map(DiscountInputArgsToJSON)),
            'coupon_override_name': value.couponOverrideName,
            'add_ons': value.addOns === undefined ? undefined : ((value.addOns as Array<any>).map(SubscriptionAddOnInputToJSON)),
            'price_plan_uuid': value.pricePlanUuid,
            'credit_plan': CreditPlanInputArgsToJSON(value.creditPlan),
            'features_override': value.featuresOverride === undefined ? undefined : ((value.featuresOverride as Array<any>).map(FeatureInputArgsToJSON)),
        };
    }