wallee
Version:
TypeScript/JavaScript client for wallee
39 lines (38 loc) • 1.69 kB
JavaScript
import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState';
import { SubscriptionMetricTypeFromJSON, SubscriptionMetricTypeToJSON, } from './SubscriptionMetricType';
/**
* Check if a given object implements the SubscriptionMetric interface.
*/
export function instanceOfSubscriptionMetric(value) {
return true;
}
export function SubscriptionMetricFromJSON(json) {
return SubscriptionMetricFromJSONTyped(json, false);
}
export function SubscriptionMetricFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'name': json['name'] == null ? undefined : json['name'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'description': json['description'] == null ? undefined : json['description'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : CreationEntityStateFromJSON(json['state']),
'type': json['type'] == null ? undefined : SubscriptionMetricTypeFromJSON(json['type']),
'version': json['version'] == null ? undefined : json['version'],
};
}
export function SubscriptionMetricToJSON(json) {
return SubscriptionMetricToJSONTyped(json, false);
}
export function SubscriptionMetricToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'state': CreationEntityStateToJSON(value['state']),
'type': SubscriptionMetricTypeToJSON(value['type']),
};
}