All files / codegen/models CreditPlanInputArgs.ts

68.46% Statements 76/111
100% Branches 0/0
0% Functions 0/3
68.46% Lines 76/111

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 1131x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 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 CreditPlanInputArgs
 */
export interface CreditPlanInputArgs {
    /**
     * Billing cycles between payments. Null for grants paid in a single payment. If this plan has recurring grants (i.e `interval_between_grants` is not null), then this field must be a factor of `interval_between_grants`.
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    intervalBetweenPayments?: number;
    /**
     * Amount of credits that are granted in a single grant.
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    amount: number;
    /**
     * Price for the grant, in lowest denomination (i.e cents). Defaults to $1 (100 cents) per credit if not specified
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    price?: number;
    /**
     * Duration length before each credit grant expires. Null for no expiration.
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    grantExpirationLength?: number;
    /**
     * Interval, in billing cycles, between each credit grant. Null for single grant plans.
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    intervalBetweenGrants?: number;
    /**
     * How many payments each credit grant will have. Defaults to 1 for single payment grants. If this plan has has recurring grants (i.e `interval_between_grants` is not null), then this field must be a factor of `interval_between_grants`.
     * @type {number}
     * @memberof CreditPlanInputArgs
     */
    paymentsPerGrant?: number;
    /**
     * Duration unit before each credit grant expires. Null for no expiration.
     * @type {string}
     * @memberof CreditPlanInputArgs
     */
    grantExpirationUnit?: string;
    /**
     * A description that will be used on the invoice line items.
     * @type {string}
     * @memberof CreditPlanInputArgs
     */
    description?: string;
}
 
export function CreditPlanInputArgsFromJSON(json: any): CreditPlanInputArgs {
    return CreditPlanInputArgsFromJSONTyped(json, false);
}
 
export function CreditPlanInputArgsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreditPlanInputArgs {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'intervalBetweenPayments': !exists(json, 'interval_between_payments') ? undefined : json['interval_between_payments'],
        'amount': json['amount'],
        'price': !exists(json, 'price') ? undefined : json['price'],
        'grantExpirationLength': !exists(json, 'grant_expiration_length') ? undefined : json['grant_expiration_length'],
        'intervalBetweenGrants': !exists(json, 'interval_between_grants') ? undefined : json['interval_between_grants'],
        'paymentsPerGrant': !exists(json, 'payments_per_grant') ? undefined : json['payments_per_grant'],
        'grantExpirationUnit': !exists(json, 'grant_expiration_unit') ? undefined : json['grant_expiration_unit'],
        'description': !exists(json, 'description') ? undefined : json['description'],
    };
}
 
export function CreditPlanInputArgsToJSON(value?: CreditPlanInputArgs | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'interval_between_payments': value.intervalBetweenPayments,
        'amount': value.amount,
        'price': value.price,
        'grant_expiration_length': value.grantExpirationLength,
        'interval_between_grants': value.intervalBetweenGrants,
        'payments_per_grant': value.paymentsPerGrant,
        'grant_expiration_unit': value.grantExpirationUnit,
        'description': value.description,
    };
}