# All files / codegen/models CouponInputArgs.ts

73.05% Statements 122/167
100% Branches 2/2
0% Functions 0/3
73.05% Lines 122/167

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
    1691x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 CouponInputArgs
     */
    export interface CouponInputArgs {
        /**
         *
         * @type {number}
         * @memberof CouponInputArgs
         */
        vendorId?: number;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        name: string;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        displayName?: string;
        /**
         *
         * @type {Date}
         * @memberof CouponInputArgs
         */
        expirationTime?: Date;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        frequency: CouponInputArgsFrequencyEnum;
        /**
         *
         * @type {number}
         * @memberof CouponInputArgs
         */
        durationLength?: number;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        durationUnit?: string;
        /**
         *
         * @type {number}
         * @memberof CouponInputArgs
         */
        maxUses?: number;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        code?: string;
        /**
         *
         * @type {Array<string>}
         * @memberof CouponInputArgs
         */
        excludedCustomers?: Array<string>;
        /**
         *
         * @type {Array<string>}
         * @memberof CouponInputArgs
         */
        excludedPricePlans?: Array<string>;
        /**
         *
         * @type {string}
         * @memberof CouponInputArgs
         */
        discountType: CouponInputArgsDiscountTypeEnum;
        /**
         *
         * @type {number}
         * @memberof CouponInputArgs
         */
        discountAmount: number;
    }

    /**
    * @export
    * @enum {string}
    */
    export enum CouponInputArgsFrequencyEnum {
        Once = 'ONCE',
        Recurring = 'RECURRING'
    }/**
    * @export
    * @enum {string}
    */
    export enum CouponInputArgsDiscountTypeEnum {
        Flat = 'FLAT',
        Percent = 'PERCENT'
    }

    export function CouponInputArgsFromJSON(json: any): CouponInputArgs {
        return CouponInputArgsFromJSONTyped(json, false);
    }

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

            'vendorId': !exists(json, 'vendor_id') ? undefined : json['vendor_id'],
            'name': json['name'],
            'displayName': !exists(json, 'display_name') ? undefined : json['display_name'],
            'expirationTime': !exists(json, 'expiration_time') ? undefined : (new Date(json['expiration_time'])),
            'frequency': json['frequency'],
            'durationLength': !exists(json, 'duration_length') ? undefined : json['duration_length'],
            'durationUnit': !exists(json, 'duration_unit') ? undefined : json['duration_unit'],
            'maxUses': !exists(json, 'max_uses') ? undefined : json['max_uses'],
            'code': !exists(json, 'code') ? undefined : json['code'],
            'excludedCustomers': !exists(json, 'excluded_customers') ? undefined : json['excluded_customers'],
            'excludedPricePlans': !exists(json, 'excluded_price_plans') ? undefined : json['excluded_price_plans'],
            'discountType': json['discount_type'],
            'discountAmount': json['discount_amount'],
        };
    }

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

            'vendor_id': value.vendorId,
            'name': value.name,
            'display_name': value.displayName,
            'expiration_time': value.expirationTime === undefined ? undefined : (value.expirationTime.toISOString()),
            'frequency': value.frequency,
            'duration_length': value.durationLength,
            'duration_unit': value.durationUnit,
            'max_uses': value.maxUses,
            'code': value.code,
            'excluded_customers': value.excludedCustomers,
            'excluded_price_plans': value.excludedPricePlans,
            'discount_type': value.discountType,
            'discount_amount': value.discountAmount,
        };
    }