# All files / codegen/models DiscountInputArgs.ts

72.65% Statements 93/128
100% Branches 2/2
0% Functions 0/3
72.65% Lines 93/128

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
    1301x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    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 {
        /**
         *
         * @type {number}
         * @memberof DiscountInputArgs
         */
        amount?: number;
        /**
         *
         * @type {string}
         * @memberof DiscountInputArgs
         */
        discountType?: DiscountInputArgsDiscountTypeEnum;
        /**
         * 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; };
        /**
         * Offset, in number of billing cycles, for when this discount will apply. If set to 0, the discount will start applying from the current billing cycle. If set to 1, the discount will start applying from the next billing cycle, etc. For scheduled subscriptions, the offset starts from the initial billing cycle.
         * @type {number}
         * @memberof DiscountInputArgs
         */
        billingCycleStartOffset?: number;
        /**
         * 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;
        /**
         * Length, in billing cycles, that this discount will be active.
         * @type {number}
         * @memberof DiscountInputArgs
         */
        billingCycleDuration?: number;
        /**
         * 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 DiscountInputArgsDiscountTypeEnum {
        Flat = 'FLAT',
        Percent = 'PERCENT'
    }/**
    * @export
    * @enum {string}
    */
    export enum DiscountInputArgsScopeEnum {
        InvoiceTotal = 'INVOICE_TOTAL',
        AddOn = 'ADD_ON',
        MeteredComponent = 'METERED_COMPONENT'
    }

    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 {

            'amount': !exists(json, 'amount') ? undefined : json['amount'],
            'discountType': !exists(json, 'discount_type') ? undefined : json['discount_type'],
            'labels': !exists(json, 'labels') ? undefined : json['labels'],
            'billingCycleStartOffset': !exists(json, 'billing_cycle_start_offset') ? undefined : json['billing_cycle_start_offset'],
            'scope': !exists(json, 'scope') ? undefined : json['scope'],
            'addOnName': !exists(json, 'add_on_name') ? undefined : json['add_on_name'],
            'billingCycleDuration': !exists(json, 'billing_cycle_duration') ? undefined : json['billing_cycle_duration'],
            '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 {

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