wallee
Version:
TypeScript/JavaScript client for wallee
41 lines (40 loc) • 1.99 kB
JavaScript
import { SubscriptionProductStateFromJSON, SubscriptionProductStateToJSON, } from './SubscriptionProductState';
/**
* Check if a given object implements the SubscriptionProduct interface.
*/
export function instanceOfSubscriptionProduct(value) {
return true;
}
export function SubscriptionProductFromJSON(json) {
return SubscriptionProductFromJSONTyped(json, false);
}
export function SubscriptionProductFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'reference': json['reference'] == null ? undefined : json['reference'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'spaceId': json['spaceId'] == null ? undefined : json['spaceId'],
'sortOrder': json['sortOrder'] == null ? undefined : json['sortOrder'],
'name': json['name'] == null ? undefined : json['name'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'productLocked': json['productLocked'] == null ? undefined : json['productLocked'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : SubscriptionProductStateFromJSON(json['state']),
'failedPaymentSuspensionPeriod': json['failedPaymentSuspensionPeriod'] == null ? undefined : json['failedPaymentSuspensionPeriod'],
'version': json['version'] == null ? undefined : json['version'],
'allowedPaymentMethodConfigurations': json['allowedPaymentMethodConfigurations'] == null ? undefined : json['allowedPaymentMethodConfigurations'],
};
}
export function SubscriptionProductToJSON(json) {
return SubscriptionProductToJSONTyped(json, false);
}
export function SubscriptionProductToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'state': SubscriptionProductStateToJSON(value['state']),
};
}