# All files / codegen/models DiscountInputArgs.ts

72.5% Statements 87/120
100% Branches 2/2
0% Functions 0/3
72.5% Lines 87/120

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
    1221x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 DiscountInputArgs
     */
    export interface DiscountInputArgs {
        /**
         * The scope that this discount covers. One of 'INVOICE_TOTAL', 'ADD_ON', 'METERED_COMPONENT'.
         * @type {string}
         * @memberof DiscountInputArgs
         */
        scope?: DiscountInputArgsScopeEnum;
        /**
         * For ADD_ON scoped discounts: the name of the add on that the discount covers.
         * @type {string}
         * @memberof DiscountInputArgs
         */
        addOnName?: string;
        /**
         *
         * @type {string}
         * @memberof DiscountInputArgs
         */
        discountType?: DiscountInputArgsDiscountTypeEnum;
        /**
         *
         * @type {number}
         * @memberof DiscountInputArgs
         */
        amount?: number;
        /**
         * Length, in billing cycles, that this discount will be active.
         * @type {number}
         * @memberof DiscountInputArgs
         */
        billingCycleDuration?: number;
        /**
         * For METERED_COMPONENT scoped discounts: Dictionary of labels (key: value) that the discount covers. The entire set of labels must be provided.
         * @type {{ [key: string]: string; }}
         * @memberof DiscountInputArgs
         */
        labels?: { [key: string]: string; };
        /**
         * For METERED_COMPONENT scoped discounts: the UUID of the metered component that the discount covers.
         * @type {string}
         * @memberof DiscountInputArgs
         */
        meteredComponentUuid?: string;
    }

    /**
    * @export
    * @enum {string}
    */
    export enum DiscountInputArgsScopeEnum {
        InvoiceTotal = 'INVOICE_TOTAL',
        AddOn = 'ADD_ON',
        MeteredComponent = 'METERED_COMPONENT'
    }/**
    * @export
    * @enum {string}
    */
    export enum DiscountInputArgsDiscountTypeEnum {
        Flat = 'FLAT',
        Percent = 'PERCENT'
    }

    export function DiscountInputArgsFromJSON(json: any): DiscountInputArgs {
        return DiscountInputArgsFromJSONTyped(json, false);
    }

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

            'scope': !exists(json, 'scope') ? undefined : json['scope'],
            'addOnName': !exists(json, 'add_on_name') ? undefined : json['add_on_name'],
            'discountType': !exists(json, 'discount_type') ? undefined : json['discount_type'],
            'amount': !exists(json, 'amount') ? undefined : json['amount'],
            'billingCycleDuration': !exists(json, 'billing_cycle_duration') ? undefined : json['billing_cycle_duration'],
            'labels': !exists(json, 'labels') ? undefined : json['labels'],
            'meteredComponentUuid': !exists(json, 'metered_component_uuid') ? undefined : json['metered_component_uuid'],
        };
    }

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

            'scope': value.scope,
            'add_on_name': value.addOnName,
            'discount_type': value.discountType,
            'amount': value.amount,
            'billing_cycle_duration': value.billingCycleDuration,
            'labels': value.labels,
            'metered_component_uuid': value.meteredComponentUuid,
        };
    }