wallee
Version:
TypeScript/JavaScript client for wallee
37 lines (36 loc) • 1.8 kB
JavaScript
import { SubscriptionComponentReferenceConfigurationFromJSON, SubscriptionComponentReferenceConfigurationToJSON, } from './SubscriptionComponentReferenceConfiguration';
import { SubscriptionPendingFromJSON, SubscriptionPendingToJSON, } from './SubscriptionPending';
/**
* Check if a given object implements the SubscriptionCreateRequest interface.
*/
export function instanceOfSubscriptionCreateRequest(value) {
return true;
}
export function SubscriptionCreateRequestFromJSON(json) {
return SubscriptionCreateRequestFromJSONTyped(json, false);
}
export function SubscriptionCreateRequestFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'componentConfigurations': json['componentConfigurations'] == null ? undefined : (new Set(json['componentConfigurations'].map(SubscriptionComponentReferenceConfigurationFromJSON))),
'product': json['product'] == null ? undefined : json['product'],
'currency': json['currency'] == null ? undefined : json['currency'],
'subscription': json['subscription'] == null ? undefined : SubscriptionPendingFromJSON(json['subscription']),
};
}
export function SubscriptionCreateRequestToJSON(json) {
return SubscriptionCreateRequestToJSONTyped(json, false);
}
export function SubscriptionCreateRequestToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'componentConfigurations': value['componentConfigurations'] == null ? undefined : (Array.from(value['componentConfigurations']).map(SubscriptionComponentReferenceConfigurationToJSON)),
'product': value['product'],
'currency': value['currency'],
'subscription': SubscriptionPendingToJSON(value['subscription']),
};
}