wallee
Version:
TypeScript/JavaScript client for wallee
50 lines (49 loc) • 2.42 kB
JavaScript
import { ScopeFromJSON, ScopeToJSON, } from './Scope';
import { AccountStateFromJSON, AccountStateToJSON, } from './AccountState';
import { AccountTypeFromJSON, AccountTypeToJSON, } from './AccountType';
/**
* Check if a given object implements the Account interface.
*/
export function instanceOfAccount(value) {
return true;
}
export function AccountFromJSON(json) {
return AccountFromJSONTyped(json, false);
}
export function AccountFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'activeOrRestrictedActive': json['activeOrRestrictedActive'] == null ? undefined : json['activeOrRestrictedActive'],
'deletedOn': json['deletedOn'] == null ? undefined : (new Date(json['deletedOn'])),
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'active': json['active'] == null ? undefined : json['active'],
'parentAccount': json['parentAccount'] == null ? undefined : AccountFromJSON(json['parentAccount']),
'type': json['type'] == null ? undefined : AccountTypeFromJSON(json['type']),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'deletedBy': json['deletedBy'] == null ? undefined : json['deletedBy'],
'restrictedActive': json['restrictedActive'] == null ? undefined : json['restrictedActive'],
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
'scope': json['scope'] == null ? undefined : ScopeFromJSON(json['scope']),
'name': json['name'] == null ? undefined : json['name'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : AccountStateFromJSON(json['state']),
'subaccountLimit': json['subaccountLimit'] == null ? undefined : json['subaccountLimit'],
};
}
export function AccountToJSON(json) {
return AccountToJSONTyped(json, false);
}
export function AccountToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'parentAccount': AccountToJSON(value['parentAccount']),
'type': AccountTypeToJSON(value['type']),
'scope': ScopeToJSON(value['scope']),
'state': AccountStateToJSON(value['state']),
};
}