UNPKG

wallee

Version:
54 lines (53 loc) 2.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfBillingCycleModel = instanceOfBillingCycleModel; exports.BillingCycleModelFromJSON = BillingCycleModelFromJSON; exports.BillingCycleModelFromJSONTyped = BillingCycleModelFromJSONTyped; exports.BillingCycleModelToJSON = BillingCycleModelToJSON; exports.BillingCycleModelToJSONTyped = BillingCycleModelToJSONTyped; const BillingDayCustomization_1 = require("./BillingDayCustomization"); const BillingCycleType_1 = require("./BillingCycleType"); const DisplayableDayOfWeek_1 = require("./DisplayableDayOfWeek"); const DisplayableMonth_1 = require("./DisplayableMonth"); /** * Check if a given object implements the BillingCycleModel interface. */ function instanceOfBillingCycleModel(value) { if (!('numberOfPeriods' in value) || value['numberOfPeriods'] === undefined) return false; if (!('billingCycleType' in value) || value['billingCycleType'] === undefined) return false; return true; } function BillingCycleModelFromJSON(json) { return BillingCycleModelFromJSONTyped(json, false); } function BillingCycleModelFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'month': json['month'] == null ? undefined : (0, DisplayableMonth_1.DisplayableMonthFromJSON)(json['month']), 'customization': json['customization'] == null ? undefined : (0, BillingDayCustomization_1.BillingDayCustomizationFromJSON)(json['customization']), 'dayOfMonth': json['dayOfMonth'] == null ? undefined : json['dayOfMonth'], 'weeklyDay': json['weeklyDay'] == null ? undefined : (0, DisplayableDayOfWeek_1.DisplayableDayOfWeekFromJSON)(json['weeklyDay']), 'numberOfPeriods': json['numberOfPeriods'], 'billingCycleType': (0, BillingCycleType_1.BillingCycleTypeFromJSON)(json['billingCycleType']), }; } function BillingCycleModelToJSON(json) { return BillingCycleModelToJSONTyped(json, false); } function BillingCycleModelToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'month': (0, DisplayableMonth_1.DisplayableMonthToJSON)(value['month']), 'customization': (0, BillingDayCustomization_1.BillingDayCustomizationToJSON)(value['customization']), 'dayOfMonth': value['dayOfMonth'], 'weeklyDay': (0, DisplayableDayOfWeek_1.DisplayableDayOfWeekToJSON)(value['weeklyDay']), 'numberOfPeriods': value['numberOfPeriods'], 'billingCycleType': (0, BillingCycleType_1.BillingCycleTypeToJSON)(value['billingCycleType']), }; }