UNPKG

wallee

Version:
47 lines (46 loc) 2.19 kB
import { BillingDayCustomizationFromJSON, BillingDayCustomizationToJSON, } from './BillingDayCustomization'; import { BillingCycleTypeFromJSON, BillingCycleTypeToJSON, } from './BillingCycleType'; import { DisplayableDayOfWeekFromJSON, DisplayableDayOfWeekToJSON, } from './DisplayableDayOfWeek'; import { DisplayableMonthFromJSON, DisplayableMonthToJSON, } from './DisplayableMonth'; /** * Check if a given object implements the BillingCycleModel interface. */ export function instanceOfBillingCycleModel(value) { if (!('numberOfPeriods' in value) || value['numberOfPeriods'] === undefined) return false; if (!('billingCycleType' in value) || value['billingCycleType'] === undefined) return false; return true; } export function BillingCycleModelFromJSON(json) { return BillingCycleModelFromJSONTyped(json, false); } export function BillingCycleModelFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'month': json['month'] == null ? undefined : DisplayableMonthFromJSON(json['month']), 'customization': json['customization'] == null ? undefined : BillingDayCustomizationFromJSON(json['customization']), 'dayOfMonth': json['dayOfMonth'] == null ? undefined : json['dayOfMonth'], 'weeklyDay': json['weeklyDay'] == null ? undefined : DisplayableDayOfWeekFromJSON(json['weeklyDay']), 'numberOfPeriods': json['numberOfPeriods'], 'billingCycleType': BillingCycleTypeFromJSON(json['billingCycleType']), }; } export function BillingCycleModelToJSON(json) { return BillingCycleModelToJSONTyped(json, false); } export function BillingCycleModelToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'month': DisplayableMonthToJSON(value['month']), 'customization': BillingDayCustomizationToJSON(value['customization']), 'dayOfMonth': value['dayOfMonth'], 'weeklyDay': DisplayableDayOfWeekToJSON(value['weeklyDay']), 'numberOfPeriods': value['numberOfPeriods'], 'billingCycleType': BillingCycleTypeToJSON(value['billingCycleType']), }; }