wallee
Version:
TypeScript/JavaScript client for wallee
57 lines (56 loc) • 2.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfAccount = instanceOfAccount;
exports.AccountFromJSON = AccountFromJSON;
exports.AccountFromJSONTyped = AccountFromJSONTyped;
exports.AccountToJSON = AccountToJSON;
exports.AccountToJSONTyped = AccountToJSONTyped;
const Scope_1 = require("./Scope");
const AccountState_1 = require("./AccountState");
const AccountType_1 = require("./AccountType");
/**
* Check if a given object implements the Account interface.
*/
function instanceOfAccount(value) {
return true;
}
function AccountFromJSON(json) {
return AccountFromJSONTyped(json, false);
}
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 : (0, AccountType_1.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 : (0, Scope_1.ScopeFromJSON)(json['scope']),
'name': json['name'] == null ? undefined : json['name'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, AccountState_1.AccountStateFromJSON)(json['state']),
'subaccountLimit': json['subaccountLimit'] == null ? undefined : json['subaccountLimit'],
};
}
function AccountToJSON(json) {
return AccountToJSONTyped(json, false);
}
function AccountToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'parentAccount': AccountToJSON(value['parentAccount']),
'type': (0, AccountType_1.AccountTypeToJSON)(value['type']),
'scope': (0, Scope_1.ScopeToJSON)(value['scope']),
'state': (0, AccountState_1.AccountStateToJSON)(value['state']),
};
}