UNPKG

wallee

Version:
55 lines (54 loc) 3.52 kB
import { SubscriptionVersionStateFromJSON, SubscriptionVersionStateToJSON, } from './SubscriptionVersionState'; import { BillingCycleModelFromJSON, BillingCycleModelToJSON, } from './BillingCycleModel'; import { SubscriptionComponentConfigurationFromJSON, } from './SubscriptionComponentConfiguration'; import { SubscriptionFromJSON, SubscriptionToJSON, } from './Subscription'; import { SubscriptionProductVersionFromJSON, SubscriptionProductVersionToJSON, } from './SubscriptionProductVersion'; /** * Check if a given object implements the SubscriptionVersion interface. */ export function instanceOfSubscriptionVersion(value) { return true; } export function SubscriptionVersionFromJSON(json) { return SubscriptionVersionFromJSONTyped(json, false); } export function SubscriptionVersionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'language': json['language'] == null ? undefined : json['language'], 'subscription': json['subscription'] == null ? undefined : SubscriptionFromJSON(json['subscription']), 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'version': json['version'] == null ? undefined : json['version'], 'terminatedOn': json['terminatedOn'] == null ? undefined : (new Date(json['terminatedOn'])), 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'terminationIssuedOn': json['terminationIssuedOn'] == null ? undefined : (new Date(json['terminationIssuedOn'])), 'componentConfigurations': json['componentConfigurations'] == null ? undefined : (new Set(json['componentConfigurations'].map(SubscriptionComponentConfigurationFromJSON))), 'productVersion': json['productVersion'] == null ? undefined : SubscriptionProductVersionFromJSON(json['productVersion']), 'activatedOn': json['activatedOn'] == null ? undefined : (new Date(json['activatedOn'])), 'terminatingOn': json['terminatingOn'] == null ? undefined : (new Date(json['terminatingOn'])), 'billingCurrency': json['billingCurrency'] == null ? undefined : json['billingCurrency'], 'expectedLastPeriodEnd': json['expectedLastPeriodEnd'] == null ? undefined : (new Date(json['expectedLastPeriodEnd'])), 'billingCycleModel': json['billingCycleModel'] == null ? undefined : BillingCycleModelFromJSON(json['billingCycleModel']), 'plannedTerminationDate': json['plannedTerminationDate'] == null ? undefined : (new Date(json['plannedTerminationDate'])), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : SubscriptionVersionStateFromJSON(json['state']), 'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])), }; } export function SubscriptionVersionToJSON(json) { return SubscriptionVersionToJSONTyped(json, false); } export function SubscriptionVersionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'subscription': SubscriptionToJSON(value['subscription']), 'productVersion': SubscriptionProductVersionToJSON(value['productVersion']), 'billingCycleModel': BillingCycleModelToJSON(value['billingCycleModel']), 'state': SubscriptionVersionStateToJSON(value['state']), }; }