UNPKG

wallee

Version:
64 lines (63 loc) 3.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfSubscription = instanceOfSubscription; exports.SubscriptionFromJSON = SubscriptionFromJSON; exports.SubscriptionFromJSONTyped = SubscriptionFromJSONTyped; exports.SubscriptionToJSON = SubscriptionToJSON; exports.SubscriptionToJSONTyped = SubscriptionToJSONTyped; const SubscriptionAffiliate_1 = require("./SubscriptionAffiliate"); const Subscriber_1 = require("./Subscriber"); const SubscriptionState_1 = require("./SubscriptionState"); const Token_1 = require("./Token"); const SubscriptionProductVersion_1 = require("./SubscriptionProductVersion"); /** * Check if a given object implements the Subscription interface. */ function instanceOfSubscription(value) { return true; } function SubscriptionFromJSON(json) { return SubscriptionFromJSONTyped(json, false); } function SubscriptionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'subscriber': json['subscriber'] == null ? undefined : (0, Subscriber_1.SubscriberFromJSON)(json['subscriber']), 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'terminatedBy': json['terminatedBy'] == null ? undefined : json['terminatedBy'], 'description': json['description'] == null ? undefined : json['description'], 'language': json['language'] == null ? undefined : json['language'], 'initializedOn': json['initializedOn'] == null ? undefined : (new Date(json['initializedOn'])), 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'version': json['version'] == null ? undefined : json['version'], 'token': json['token'] == null ? undefined : (0, Token_1.TokenFromJSON)(json['token']), 'reference': json['reference'] == null ? undefined : json['reference'], 'terminatedOn': json['terminatedOn'] == null ? undefined : (new Date(json['terminatedOn'])), 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'activatedOn': json['activatedOn'] == null ? undefined : (new Date(json['activatedOn'])), 'terminatingOn': json['terminatingOn'] == null ? undefined : (new Date(json['terminatingOn'])), 'currentProductVersion': json['currentProductVersion'] == null ? undefined : (0, SubscriptionProductVersion_1.SubscriptionProductVersionFromJSON)(json['currentProductVersion']), 'plannedTerminationDate': json['plannedTerminationDate'] == null ? undefined : (new Date(json['plannedTerminationDate'])), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : (0, SubscriptionState_1.SubscriptionStateFromJSON)(json['state']), 'affiliate': json['affiliate'] == null ? undefined : (0, SubscriptionAffiliate_1.SubscriptionAffiliateFromJSON)(json['affiliate']), 'terminationScheduledOn': json['terminationScheduledOn'] == null ? undefined : (new Date(json['terminationScheduledOn'])), }; } function SubscriptionToJSON(json) { return SubscriptionToJSONTyped(json, false); } function SubscriptionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'subscriber': (0, Subscriber_1.SubscriberToJSON)(value['subscriber']), 'token': (0, Token_1.TokenToJSON)(value['token']), 'currentProductVersion': (0, SubscriptionProductVersion_1.SubscriptionProductVersionToJSON)(value['currentProductVersion']), 'state': (0, SubscriptionState_1.SubscriptionStateToJSON)(value['state']), 'affiliate': (0, SubscriptionAffiliate_1.SubscriptionAffiliateToJSON)(value['affiliate']), }; }