"use strict";
/* 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddOnToJSON = exports.AddOnFromJSONTyped = exports.AddOnFromJSON = void 0;
const runtime_1 = require("../runtime");
const Feature_1 = require("./Feature");
const PriceTier_1 = require("./PriceTier");
function AddOnFromJSON(json) {
    return AddOnFromJSONTyped(json, false);
}
exports.AddOnFromJSON = AddOnFromJSON;
function AddOnFromJSONTyped(json, ignoreDiscriminator) {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        'feature': (0, Feature_1.FeatureFromJSON)(json['feature']),
        'price': json['price'],
        'prices': !(0, runtime_1.exists)(json, 'prices') ? undefined : (json['prices'].map(PriceTier_1.PriceTierFromJSON)),
        'priceSchemeType': json['price_scheme_type'],
        'singleUse': json['single_use'],
        'quantityEnabled': json['quantity_enabled'],
        'immediatelyCharge': !(0, runtime_1.exists)(json, 'immediately_charge') ? undefined : json['immediately_charge'],
        'limit': !(0, runtime_1.exists)(json, 'limit') ? undefined : json['limit'],
        'priceFrequency': !(0, runtime_1.exists)(json, 'price_frequency') ? undefined : json['price_frequency'],
        'chargeFrequency': !(0, runtime_1.exists)(json, 'charge_frequency') ? undefined : json['charge_frequency'],
    };
}
exports.AddOnFromJSONTyped = AddOnFromJSONTyped;
function AddOnToJSON(value) {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        'feature': (0, Feature_1.FeatureToJSON)(value.feature),
        'price': value.price,
        'prices': value.prices === undefined ? undefined : (value.prices.map(PriceTier_1.PriceTierToJSON)),
        'price_scheme_type': value.priceSchemeType,
        'single_use': value.singleUse,
        'quantity_enabled': value.quantityEnabled,
        'immediately_charge': value.immediatelyCharge,
        'limit': value.limit,
        'price_frequency': value.priceFrequency,
        'charge_frequency': value.chargeFrequency,
    };
}
exports.AddOnToJSON = AddOnToJSON;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQWRkT24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29kZWdlbi9tb2RlbHMvQWRkT24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9CQUFvQjtBQUNwQixvQkFBb0I7QUFDcEI7Ozs7Ozs7Ozs7R0FVRzs7O0FBRUgsd0NBQStDO0FBQy9DLHVDQUttQjtBQUNuQiwyQ0FLcUI7QUFzRXJCLFNBQWdCLGFBQWEsQ0FBQyxJQUFTO0lBQ25DLE9BQU8sa0JBQWtCLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQzNDLENBQUM7QUFGRCxzQ0FFQztBQUVELFNBQWdCLGtCQUFrQixDQUFDLElBQVMsRUFBRSxtQkFBNEI7SUFDdEUsSUFBSSxDQUFDLElBQUksS0FBSyxTQUFTLENBQUMsSUFBSSxDQUFDLElBQUksS0FBSyxJQUFJLENBQUMsRUFBRTtRQUN6QyxPQUFPLElBQUksQ0FBQztLQUNmO0lBQ0QsT0FBTztRQUVILFNBQVMsRUFBRSxJQUFBLHlCQUFlLEVBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQzNDLE9BQU8sRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDO1FBQ3RCLFFBQVEsRUFBRSxDQUFDLElBQUEsZ0JBQU0sRUFBQyxJQUFJLEVBQUUsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxJQUFJLENBQUMsUUFBUSxDQUFnQixDQUFDLEdBQUcsQ0FBQyw2QkFBaUIsQ0FBQyxDQUFDO1FBQ3ZHLGlCQUFpQixFQUFFL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