"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.CreateSubscriptionArgsToJSON = exports.CreateSubscriptionArgsFromJSONTyped = exports.CreateSubscriptionArgsFromJSON = void 0;
const runtime_1 = require("../runtime");
const CreditPlanInputArgs_1 = require("./CreditPlanInputArgs");
const DiscountInputArgs_1 = require("./DiscountInputArgs");
const FeatureInputArgs_1 = require("./FeatureInputArgs");
const LimitInputArgs_1 = require("./LimitInputArgs");
const SubscriptionAddOnInput_1 = require("./SubscriptionAddOnInput");
const TrialInputArgs_1 = require("./TrialInputArgs");
function CreateSubscriptionArgsFromJSON(json) {
    return CreateSubscriptionArgsFromJSONTyped(json, false);
}
exports.CreateSubscriptionArgsFromJSON = CreateSubscriptionArgsFromJSON;
function CreateSubscriptionArgsFromJSONTyped(json, ignoreDiscriminator) {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        'discountOverride': !(0, runtime_1.exists)(json, 'discount_override') ? undefined : (0, DiscountInputArgs_1.DiscountInputArgsFromJSON)(json['discount_override']),
        'effectiveAt': !(0, runtime_1.exists)(json, 'effective_at') ? undefined : (new Date(json['effective_at'])),
        'trialOverride': !(0, runtime_1.exists)(json, 'trial_override') ? undefined : (0, TrialInputArgs_1.TrialInputArgsFromJSON)(json['trial_override']),
        'pricePlanName': !(0, runtime_1.exists)(json, 'price_plan_name') ? undefined : json['price_plan_name'],
        'pricePlanTag': !(0, runtime_1.exists)(json, 'price_plan_tag') ? undefined : json['price_plan_tag'],
        'limitsOverride': !(0, runtime_1.exists)(json, 'limits_override') ? undefined : (json['limits_override'].map(LimitInputArgs_1.LimitInputArgsFromJSON)),
        'alignToCalendar': !(0, runtime_1.exists)(json, 'align_to_calendar') ? undefined : json['align_to_calendar'],
        'discounts': !(0, runtime_1.exists)(json, 'discounts') ? undefined : (json['discounts'].map(DiscountInputArgs_1.DiscountInputArgsFromJSON)),
        'couponOverrideName': !(0, runtime_1.exists)(json, 'coupon_override_name') ? undefined : json['coupon_override_name'],
        'addOns': !(0, runtime_1.exists)(json, 'add_ons') ? undefined : (json['add_ons'].map(SubscriptionAddOnInput_1.SubscriptionAddOnInputFromJSON)),
        'pricePlanUuid': !(0, runtime_1.exists)(json, 'price_plan_uuid') ? undefined : json['price_plan_uuid'],
        'creditPlan': !(0, runtime_1.exists)(json, 'credit_plan') ? undefined : (0, CreditPlanInputArgs_1.CreditPlanInputArgsFromJSON)(json['credit_plan']),
        'featuresOverride': !(0, runtime_1.exists)(json, 'features_override') ? undefined : (json['features_override'].map(FeatureInputArgs_1.FeatureInputArgsFromJSON)),
    };
}
exports.CreateSubscriptionArgsFromJSONTyped = CreateSubscriptionArgsFromJSONTyped;
function CreateSubscriptionArgsToJSON(value) {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        'discount_override': (0, DiscountInputArgs_1.DiscountInputArgsToJSON)(value.discountOverride),
        'effective_at': value.effectiveAt === undefined ? undefined : (value.effectiveAt.toISOString()),
        'trial_override': (0, TrialInputArgs_1.TrialInputArgsToJSON)(value.trialOverride),
        'price_plan_name': value.pricePlanName,
        'price_plan_tag': value.pricePlanTag,
        'limits_override': value.limitsOverride === undefined ? undefined : (value.limitsOverride.map(LimitInputArgs_1.LimitInputArgsToJSON)),
        'align_to_calendar': value.alignToCalendar,
        'discounts': value.discounts === undefined ? undefined : (value.discounts.map(DiscountInputArgs_1.DiscountInputArgsToJSON)),
        'coupon_override_name': value.couponOverrideName,
        'add_ons': value.addOns === undefined ? undefined : (value.addOns.map(SubscriptionAddOnInput_1.SubscriptionAddOnInputToJSON)),
        'price_plan_uuid': value.pricePlanUuid,
        'credit_plan': (0, CreditPlanInputArgs_1.CreditPlanInputArgsToJSON)(value.creditPlan),
        'features_override': value.featuresOverride === undefined ? undefined : (value.featuresOverride.map(FeatureInputArgs_1.FeatureInputArgsToJSON)),
    };
}
exports.CreateSubscriptionArgsToJSON = CreateSubscriptionArgsToJSON;
//# sourceMappingURL=data:application/json;base64, 