//
// Autogenerated by Thrift Compiler (0.22.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;
var Int64 = require('node-int64');
var Types_ttypes = require('./Types_types.js');
var Errors_ttypes = require('./Errors_types.js');
var ttypes = require('./UserStore_types');
//HELPER FUNCTIONS AND STRUCTURES
var UserStore_checkVersion_args = function(args) {
this.clientName = null;
this.edamVersionMajor = 1;
this.edamVersionMinor = 28;
if (args) {
if (args.clientName !== undefined && args.clientName !== null) {
this.clientName = args.clientName;
}
if (args.edamVersionMajor !== undefined && args.edamVersionMajor !== null) {
this.edamVersionMajor = args.edamVersionMajor;
}
if (args.edamVersionMinor !== undefined && args.edamVersionMinor !== null) {
this.edamVersionMinor = args.edamVersionMinor;
}
}
};
UserStore_checkVersion_args.prototype = {};
UserStore_checkVersion_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.clientName = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I16) {
this.edamVersionMajor = input.readI16();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.edamVersionMinor = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_checkVersion_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_checkVersion_args');
if (this.clientName !== null && this.clientName !== undefined) {
output.writeFieldBegin('clientName', Thrift.Type.STRING, 1);
output.writeString(this.clientName);
output.writeFieldEnd();
}
if (this.edamVersionMajor !== null && this.edamVersionMajor !== undefined) {
output.writeFieldBegin('edamVersionMajor', Thrift.Type.I16, 2);
output.writeI16(this.edamVersionMajor);
output.writeFieldEnd();
}
if (this.edamVersionMinor !== null && this.edamVersionMinor !== undefined) {
output.writeFieldBegin('edamVersionMinor', Thrift.Type.I16, 3);
output.writeI16(this.edamVersionMinor);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_checkVersion_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = args.success;
}
}
};
UserStore_checkVersion_result.prototype = {};
UserStore_checkVersion_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_checkVersion_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_checkVersion_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getBootstrapInfo_args = function(args) {
this.locale = null;
if (args) {
if (args.locale !== undefined && args.locale !== null) {
this.locale = args.locale;
}
}
};
UserStore_getBootstrapInfo_args.prototype = {};
UserStore_getBootstrapInfo_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.locale = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getBootstrapInfo_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getBootstrapInfo_args');
if (this.locale !== null && this.locale !== undefined) {
output.writeFieldBegin('locale', Thrift.Type.STRING, 1);
output.writeString(this.locale);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getBootstrapInfo_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.BootstrapInfo(args.success);
}
}
};
UserStore_getBootstrapInfo_result.prototype = {};
UserStore_getBootstrapInfo_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.BootstrapInfo();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getBootstrapInfo_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getBootstrapInfo_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_authenticateLongSession_args = function(args) {
this.username = null;
this.password = null;
this.consumerKey = null;
this.consumerSecret = null;
this.deviceIdentifier = null;
this.deviceDescription = null;
this.supportsTwoFactor = null;
if (args) {
if (args.username !== undefined && args.username !== null) {
this.username = args.username;
}
if (args.password !== undefined && args.password !== null) {
this.password = args.password;
}
if (args.consumerKey !== undefined && args.consumerKey !== null) {
this.consumerKey = args.consumerKey;
}
if (args.consumerSecret !== undefined && args.consumerSecret !== null) {
this.consumerSecret = args.consumerSecret;
}
if (args.deviceIdentifier !== undefined && args.deviceIdentifier !== null) {
this.deviceIdentifier = args.deviceIdentifier;
}
if (args.deviceDescription !== undefined && args.deviceDescription !== null) {
this.deviceDescription = args.deviceDescription;
}
if (args.supportsTwoFactor !== undefined && args.supportsTwoFactor !== null) {
this.supportsTwoFactor = args.supportsTwoFactor;
}
}
};
UserStore_authenticateLongSession_args.prototype = {};
UserStore_authenticateLongSession_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.username = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.password = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.consumerKey = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.consumerSecret = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.deviceIdentifier = input.readString();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.STRING) {
this.deviceDescription = input.readString();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.BOOL) {
this.supportsTwoFactor = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_authenticateLongSession_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_authenticateLongSession_args');
if (this.username !== null && this.username !== undefined) {
output.writeFieldBegin('username', Thrift.Type.STRING, 1);
output.writeString(this.username);
output.writeFieldEnd();
}
if (this.password !== null && this.password !== undefined) {
output.writeFieldBegin('password', Thrift.Type.STRING, 2);
output.writeString(this.password);
output.writeFieldEnd();
}
if (this.consumerKey !== null && this.consumerKey !== undefined) {
output.writeFieldBegin('consumerKey', Thrift.Type.STRING, 3);
output.writeString(this.consumerKey);
output.writeFieldEnd();
}
if (this.consumerSecret !== null && this.consumerSecret !== undefined) {
output.writeFieldBegin('consumerSecret', Thrift.Type.STRING, 4);
output.writeString(this.consumerSecret);
output.writeFieldEnd();
}
if (this.deviceIdentifier !== null && this.deviceIdentifier !== undefined) {
output.writeFieldBegin('deviceIdentifier', Thrift.Type.STRING, 5);
output.writeString(this.deviceIdentifier);
output.writeFieldEnd();
}
if (this.deviceDescription !== null && this.deviceDescription !== undefined) {
output.writeFieldBegin('deviceDescription', Thrift.Type.STRING, 6);
output.writeString(this.deviceDescription);
output.writeFieldEnd();
}
if (this.supportsTwoFactor !== null && this.supportsTwoFactor !== undefined) {
output.writeFieldBegin('supportsTwoFactor', Thrift.Type.BOOL, 7);
output.writeBool(this.supportsTwoFactor);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_authenticateLongSession_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.AuthenticationResult(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_authenticateLongSession_result.prototype = {};
UserStore_authenticateLongSession_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.AuthenticationResult();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_authenticateLongSession_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_authenticateLongSession_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_completeTwoFactorAuthentication_args = function(args) {
this.authenticationToken = null;
this.oneTimeCode = null;
this.deviceIdentifier = null;
this.deviceDescription = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
if (args.oneTimeCode !== undefined && args.oneTimeCode !== null) {
this.oneTimeCode = args.oneTimeCode;
}
if (args.deviceIdentifier !== undefined && args.deviceIdentifier !== null) {
this.deviceIdentifier = args.deviceIdentifier;
}
if (args.deviceDescription !== undefined && args.deviceDescription !== null) {
this.deviceDescription = args.deviceDescription;
}
}
};
UserStore_completeTwoFactorAuthentication_args.prototype = {};
UserStore_completeTwoFactorAuthentication_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.oneTimeCode = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.deviceIdentifier = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.deviceDescription = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_completeTwoFactorAuthentication_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_completeTwoFactorAuthentication_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
if (this.oneTimeCode !== null && this.oneTimeCode !== undefined) {
output.writeFieldBegin('oneTimeCode', Thrift.Type.STRING, 2);
output.writeString(this.oneTimeCode);
output.writeFieldEnd();
}
if (this.deviceIdentifier !== null && this.deviceIdentifier !== undefined) {
output.writeFieldBegin('deviceIdentifier', Thrift.Type.STRING, 3);
output.writeString(this.deviceIdentifier);
output.writeFieldEnd();
}
if (this.deviceDescription !== null && this.deviceDescription !== undefined) {
output.writeFieldBegin('deviceDescription', Thrift.Type.STRING, 4);
output.writeString(this.deviceDescription);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_completeTwoFactorAuthentication_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.AuthenticationResult(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_completeTwoFactorAuthentication_result.prototype = {};
UserStore_completeTwoFactorAuthentication_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.AuthenticationResult();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_completeTwoFactorAuthentication_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_completeTwoFactorAuthentication_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_revokeLongSession_args = function(args) {
this.authenticationToken = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
}
};
UserStore_revokeLongSession_args.prototype = {};
UserStore_revokeLongSession_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_revokeLongSession_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_revokeLongSession_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_revokeLongSession_result = function(args) {
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_revokeLongSession_result.prototype = {};
UserStore_revokeLongSession_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_revokeLongSession_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_revokeLongSession_result');
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_authenticateToBusiness_args = function(args) {
this.authenticationToken = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
}
};
UserStore_authenticateToBusiness_args.prototype = {};
UserStore_authenticateToBusiness_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_authenticateToBusiness_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_authenticateToBusiness_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_authenticateToBusiness_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.AuthenticationResult(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_authenticateToBusiness_result.prototype = {};
UserStore_authenticateToBusiness_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.AuthenticationResult();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_authenticateToBusiness_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_authenticateToBusiness_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getUser_args = function(args) {
this.authenticationToken = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
}
};
UserStore_getUser_args.prototype = {};
UserStore_getUser_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getUser_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getUser_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getUser_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new Types_ttypes.User(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_getUser_result.prototype = {};
UserStore_getUser_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new Types_ttypes.User();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getUser_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getUser_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getPublicUserInfo_args = function(args) {
this.username = null;
if (args) {
if (args.username !== undefined && args.username !== null) {
this.username = args.username;
}
}
};
UserStore_getPublicUserInfo_args.prototype = {};
UserStore_getPublicUserInfo_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.username = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getPublicUserInfo_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getPublicUserInfo_args');
if (this.username !== null && this.username !== undefined) {
output.writeFieldBegin('username', Thrift.Type.STRING, 1);
output.writeString(this.username);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getPublicUserInfo_result = function(args) {
this.success = null;
this.notFoundException = null;
this.systemException = null;
this.userException = null;
if (args instanceof Errors_ttypes.EDAMNotFoundException) {
this.notFoundException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.PublicUserInfo(args.success);
}
if (args.notFoundException !== undefined && args.notFoundException !== null) {
this.notFoundException = args.notFoundException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
}
};
UserStore_getPublicUserInfo_result.prototype = {};
UserStore_getPublicUserInfo_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.PublicUserInfo();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.notFoundException = new Errors_ttypes.EDAMNotFoundException();
this.notFoundException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getPublicUserInfo_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getPublicUserInfo_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.notFoundException !== null && this.notFoundException !== undefined) {
output.writeFieldBegin('notFoundException', Thrift.Type.STRUCT, 1);
this.notFoundException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 3);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getUserUrls_args = function(args) {
this.authenticationToken = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
}
};
UserStore_getUserUrls_args.prototype = {};
UserStore_getUserUrls_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getUserUrls_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getUserUrls_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getUserUrls_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new ttypes.UserUrls(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_getUserUrls_result.prototype = {};
UserStore_getUserUrls_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.UserUrls();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getUserUrls_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getUserUrls_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_inviteToBusiness_args = function(args) {
this.authenticationToken = null;
this.emailAddress = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
if (args.emailAddress !== undefined && args.emailAddress !== null) {
this.emailAddress = args.emailAddress;
}
}
};
UserStore_inviteToBusiness_args.prototype = {};
UserStore_inviteToBusiness_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.emailAddress = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_inviteToBusiness_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_inviteToBusiness_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
if (this.emailAddress !== null && this.emailAddress !== undefined) {
output.writeFieldBegin('emailAddress', Thrift.Type.STRING, 2);
output.writeString(this.emailAddress);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_inviteToBusiness_result = function(args) {
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_inviteToBusiness_result.prototype = {};
UserStore_inviteToBusiness_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_inviteToBusiness_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_inviteToBusiness_result');
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_removeFromBusiness_args = function(args) {
this.authenticationToken = null;
this.emailAddress = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
if (args.emailAddress !== undefined && args.emailAddress !== null) {
this.emailAddress = args.emailAddress;
}
}
};
UserStore_removeFromBusiness_args.prototype = {};
UserStore_removeFromBusiness_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.emailAddress = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_removeFromBusiness_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_removeFromBusiness_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
if (this.emailAddress !== null && this.emailAddress !== undefined) {
output.writeFieldBegin('emailAddress', Thrift.Type.STRING, 2);
output.writeString(this.emailAddress);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_removeFromBusiness_result = function(args) {
this.userException = null;
this.systemException = null;
this.notFoundException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMNotFoundException) {
this.notFoundException = args;
return;
}
if (args) {
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.notFoundException !== undefined && args.notFoundException !== null) {
this.notFoundException = args.notFoundException;
}
}
};
UserStore_removeFromBusiness_result.prototype = {};
UserStore_removeFromBusiness_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.notFoundException = new Errors_ttypes.EDAMNotFoundException();
this.notFoundException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_removeFromBusiness_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_removeFromBusiness_result');
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.notFoundException !== null && this.notFoundException !== undefined) {
output.writeFieldBegin('notFoundException', Thrift.Type.STRUCT, 3);
this.notFoundException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_updateBusinessUserIdentifier_args = function(args) {
this.authenticationToken = null;
this.oldEmailAddress = null;
this.newEmailAddress = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
if (args.oldEmailAddress !== undefined && args.oldEmailAddress !== null) {
this.oldEmailAddress = args.oldEmailAddress;
}
if (args.newEmailAddress !== undefined && args.newEmailAddress !== null) {
this.newEmailAddress = args.newEmailAddress;
}
}
};
UserStore_updateBusinessUserIdentifier_args.prototype = {};
UserStore_updateBusinessUserIdentifier_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.oldEmailAddress = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.newEmailAddress = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_updateBusinessUserIdentifier_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_updateBusinessUserIdentifier_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
if (this.oldEmailAddress !== null && this.oldEmailAddress !== undefined) {
output.writeFieldBegin('oldEmailAddress', Thrift.Type.STRING, 2);
output.writeString(this.oldEmailAddress);
output.writeFieldEnd();
}
if (this.newEmailAddress !== null && this.newEmailAddress !== undefined) {
output.writeFieldBegin('newEmailAddress', Thrift.Type.STRING, 3);
output.writeString(this.newEmailAddress);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_updateBusinessUserIdentifier_result = function(args) {
this.userException = null;
this.systemException = null;
this.notFoundException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMNotFoundException) {
this.notFoundException = args;
return;
}
if (args) {
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.notFoundException !== undefined && args.notFoundException !== null) {
this.notFoundException = args.notFoundException;
}
}
};
UserStore_updateBusinessUserIdentifier_result.prototype = {};
UserStore_updateBusinessUserIdentifier_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.notFoundException = new Errors_ttypes.EDAMNotFoundException();
this.notFoundException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_updateBusinessUserIdentifier_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_updateBusinessUserIdentifier_result');
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.notFoundException !== null && this.notFoundException !== undefined) {
output.writeFieldBegin('notFoundException', Thrift.Type.STRUCT, 3);
this.notFoundException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_listBusinessUsers_args = function(args) {
this.authenticationToken = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
}
};
UserStore_listBusinessUsers_args.prototype = {};
UserStore_listBusinessUsers_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_listBusinessUsers_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_listBusinessUsers_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_listBusinessUsers_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = Thrift.copyList(args.success, [Types_ttypes.UserProfile]);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_listBusinessUsers_result.prototype = {};
UserStore_listBusinessUsers_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.LIST) {
this.success = [];
var _rtmp36 = input.readListBegin();
var _size5 = _rtmp36.size || 0;
for (var _i7 = 0; _i7 < _size5; ++_i7) {
var elem8 = null;
elem8 = new Types_ttypes.UserProfile();
elem8[Symbol.for("read")](input);
this.success.push(elem8);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_listBusinessUsers_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_listBusinessUsers_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter9 in this.success) {
if (this.success.hasOwnProperty(iter9)) {
iter9 = this.success[iter9];
iter9[Symbol.for("write")](output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_listBusinessInvitations_args = function(args) {
this.authenticationToken = null;
this.includeRequestedInvitations = null;
if (args) {
if (args.authenticationToken !== undefined && args.authenticationToken !== null) {
this.authenticationToken = args.authenticationToken;
}
if (args.includeRequestedInvitations !== undefined && args.includeRequestedInvitations !== null) {
this.includeRequestedInvitations = args.includeRequestedInvitations;
}
}
};
UserStore_listBusinessInvitations_args.prototype = {};
UserStore_listBusinessInvitations_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.authenticationToken = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.includeRequestedInvitations = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_listBusinessInvitations_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_listBusinessInvitations_args');
if (this.authenticationToken !== null && this.authenticationToken !== undefined) {
output.writeFieldBegin('authenticationToken', Thrift.Type.STRING, 1);
output.writeString(this.authenticationToken);
output.writeFieldEnd();
}
if (this.includeRequestedInvitations !== null && this.includeRequestedInvitations !== undefined) {
output.writeFieldBegin('includeRequestedInvitations', Thrift.Type.BOOL, 2);
output.writeBool(this.includeRequestedInvitations);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_listBusinessInvitations_result = function(args) {
this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.EDAMSystemException) {
this.systemException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = Thrift.copyList(args.success, [Types_ttypes.BusinessInvitation]);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
}
};
UserStore_listBusinessInvitations_result.prototype = {};
UserStore_listBusinessInvitations_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.LIST) {
this.success = [];
var _rtmp311 = input.readListBegin();
var _size10 = _rtmp311.size || 0;
for (var _i12 = 0; _i12 < _size10; ++_i12) {
var elem13 = null;
elem13 = new Types_ttypes.BusinessInvitation();
elem13[Symbol.for("read")](input);
this.success.push(elem13);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.EDAMSystemException();
this.systemException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_listBusinessInvitations_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_listBusinessInvitations_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter14 in this.success) {
if (this.success.hasOwnProperty(iter14)) {
iter14 = this.success[iter14];
iter14[Symbol.for("write")](output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
this.systemException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getAccountLimits_args = function(args) {
this.serviceLevel = null;
if (args) {
if (args.serviceLevel !== undefined && args.serviceLevel !== null) {
this.serviceLevel = args.serviceLevel;
}
}
};
UserStore_getAccountLimits_args.prototype = {};
UserStore_getAccountLimits_args.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.I32) {
this.serviceLevel = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getAccountLimits_args.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getAccountLimits_args');
if (this.serviceLevel !== null && this.serviceLevel !== undefined) {
output.writeFieldBegin('serviceLevel', Thrift.Type.I32, 1);
output.writeI32(this.serviceLevel);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStore_getAccountLimits_result = function(args) {
this.success = null;
this.userException = null;
if (args instanceof Errors_ttypes.EDAMUserException) {
this.userException = args;
return;
}
if (args) {
if (args.success !== undefined && args.success !== null) {
this.success = new Types_ttypes.AccountLimits(args.success);
}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
}
};
UserStore_getAccountLimits_result.prototype = {};
UserStore_getAccountLimits_result.prototype[Symbol.for("read")] = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new Types_ttypes.AccountLimits();
this.success[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.EDAMUserException();
this.userException[Symbol.for("read")](input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UserStore_getAccountLimits_result.prototype[Symbol.for("write")] = function(output) {
output.writeStructBegin('UserStore_getAccountLimits_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success[Symbol.for("write")](output);
output.writeFieldEnd();
}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException[Symbol.for("write")](output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UserStoreClient = function(output, pClass) {
this.output = output;
this.pClass = pClass;
this._seqid = 0;
this._reqs = {};
};
UserStoreClient.prototype = {};
UserStoreClient.prototype.seqid = function() { return this._seqid; };
UserStoreClient.prototype.new_seqid = function() { return this._seqid += 1; };
UserStoreClient.prototype.checkVersion = function(clientName, edamVersionMajor, edamVersionMinor, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_checkVersion(clientName, edamVersionMajor, edamVersionMinor);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_checkVersion(clientName, edamVersionMajor, edamVersionMinor);
}
};
UserStoreClient.prototype.send_checkVersion = function(clientName, edamVersionMajor, edamVersionMinor) {
var output = new this.pClass(this.output);
var params = {
clientName: clientName,
edamVersionMajor: edamVersionMajor,
edamVersionMinor: edamVersionMinor
};
var args = new UserStore_checkVersion_args(params);
try {
output.writeMessageBegin('checkVersion', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_checkVersion = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_checkVersion_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('checkVersion failed: unknown result');
};
UserStoreClient.prototype.getBootstrapInfo = function(locale, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_getBootstrapInfo(locale);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_getBootstrapInfo(locale);
}
};
UserStoreClient.prototype.send_getBootstrapInfo = function(locale) {
var output = new this.pClass(this.output);
var params = {
locale: locale
};
var args = new UserStore_getBootstrapInfo_args(params);
try {
output.writeMessageBegin('getBootstrapInfo', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_getBootstrapInfo = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_getBootstrapInfo_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getBootstrapInfo failed: unknown result');
};
UserStoreClient.prototype.authenticateLongSession = function(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_authenticateLongSession(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_authenticateLongSession(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor);
}
};
UserStoreClient.prototype.send_authenticateLongSession = function(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor) {
var output = new this.pClass(this.output);
var params = {
username: username,
password: password,
consumerKey: consumerKey,
consumerSecret: consumerSecret,
deviceIdentifier: deviceIdentifier,
deviceDescription: deviceDescription,
supportsTwoFactor: supportsTwoFactor
};
var args = new UserStore_authenticateLongSession_args(params);
try {
output.writeMessageBegin('authenticateLongSession', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_authenticateLongSession = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_authenticateLongSession_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('authenticateLongSession failed: unknown result');
};
UserStoreClient.prototype.completeTwoFactorAuthentication = function(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_completeTwoFactorAuthentication(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_completeTwoFactorAuthentication(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription);
}
};
UserStoreClient.prototype.send_completeTwoFactorAuthentication = function(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken,
oneTimeCode: oneTimeCode,
deviceIdentifier: deviceIdentifier,
deviceDescription: deviceDescription
};
var args = new UserStore_completeTwoFactorAuthentication_args(params);
try {
output.writeMessageBegin('completeTwoFactorAuthentication', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_completeTwoFactorAuthentication = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_completeTwoFactorAuthentication_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('completeTwoFactorAuthentication failed: unknown result');
};
UserStoreClient.prototype.revokeLongSession = function(authenticationToken, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_revokeLongSession(authenticationToken);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_revokeLongSession(authenticationToken);
}
};
UserStoreClient.prototype.send_revokeLongSession = function(authenticationToken) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken
};
var args = new UserStore_revokeLongSession_args(params);
try {
output.writeMessageBegin('revokeLongSession', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_revokeLongSession = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_revokeLongSession_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
callback(null);
};
UserStoreClient.prototype.authenticateToBusiness = function(authenticationToken, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_authenticateToBusiness(authenticationToken);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_authenticateToBusiness(authenticationToken);
}
};
UserStoreClient.prototype.send_authenticateToBusiness = function(authenticationToken) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken
};
var args = new UserStore_authenticateToBusiness_args(params);
try {
output.writeMessageBegin('authenticateToBusiness', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_authenticateToBusiness = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_authenticateToBusiness_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('authenticateToBusiness failed: unknown result');
};
UserStoreClient.prototype.getUser = function(authenticationToken, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_getUser(authenticationToken);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_getUser(authenticationToken);
}
};
UserStoreClient.prototype.send_getUser = function(authenticationToken) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken
};
var args = new UserStore_getUser_args(params);
try {
output.writeMessageBegin('getUser', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_getUser = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_getUser_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getUser failed: unknown result');
};
UserStoreClient.prototype.getPublicUserInfo = function(username, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_getPublicUserInfo(username);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_getPublicUserInfo(username);
}
};
UserStoreClient.prototype.send_getPublicUserInfo = function(username) {
var output = new this.pClass(this.output);
var params = {
username: username
};
var args = new UserStore_getPublicUserInfo_args(params);
try {
output.writeMessageBegin('getPublicUserInfo', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_getPublicUserInfo = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_getPublicUserInfo_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.notFoundException) {
return callback(result.notFoundException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getPublicUserInfo failed: unknown result');
};
UserStoreClient.prototype.getUserUrls = function(authenticationToken, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_getUserUrls(authenticationToken);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_getUserUrls(authenticationToken);
}
};
UserStoreClient.prototype.send_getUserUrls = function(authenticationToken) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken
};
var args = new UserStore_getUserUrls_args(params);
try {
output.writeMessageBegin('getUserUrls', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_getUserUrls = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_getUserUrls_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getUserUrls failed: unknown result');
};
UserStoreClient.prototype.inviteToBusiness = function(authenticationToken, emailAddress, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_inviteToBusiness(authenticationToken, emailAddress);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_inviteToBusiness(authenticationToken, emailAddress);
}
};
UserStoreClient.prototype.send_inviteToBusiness = function(authenticationToken, emailAddress) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken,
emailAddress: emailAddress
};
var args = new UserStore_inviteToBusiness_args(params);
try {
output.writeMessageBegin('inviteToBusiness', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_inviteToBusiness = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_inviteToBusiness_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
callback(null);
};
UserStoreClient.prototype.removeFromBusiness = function(authenticationToken, emailAddress, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_removeFromBusiness(authenticationToken, emailAddress);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_removeFromBusiness(authenticationToken, emailAddress);
}
};
UserStoreClient.prototype.send_removeFromBusiness = function(authenticationToken, emailAddress) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken,
emailAddress: emailAddress
};
var args = new UserStore_removeFromBusiness_args(params);
try {
output.writeMessageBegin('removeFromBusiness', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_removeFromBusiness = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_removeFromBusiness_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.notFoundException) {
return callback(result.notFoundException);
}
callback(null);
};
UserStoreClient.prototype.updateBusinessUserIdentifier = function(authenticationToken, oldEmailAddress, newEmailAddress, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_updateBusinessUserIdentifier(authenticationToken, oldEmailAddress, newEmailAddress);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_updateBusinessUserIdentifier(authenticationToken, oldEmailAddress, newEmailAddress);
}
};
UserStoreClient.prototype.send_updateBusinessUserIdentifier = function(authenticationToken, oldEmailAddress, newEmailAddress) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken,
oldEmailAddress: oldEmailAddress,
newEmailAddress: newEmailAddress
};
var args = new UserStore_updateBusinessUserIdentifier_args(params);
try {
output.writeMessageBegin('updateBusinessUserIdentifier', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_updateBusinessUserIdentifier = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_updateBusinessUserIdentifier_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.notFoundException) {
return callback(result.notFoundException);
}
callback(null);
};
UserStoreClient.prototype.listBusinessUsers = function(authenticationToken, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_listBusinessUsers(authenticationToken);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_listBusinessUsers(authenticationToken);
}
};
UserStoreClient.prototype.send_listBusinessUsers = function(authenticationToken) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken
};
var args = new UserStore_listBusinessUsers_args(params);
try {
output.writeMessageBegin('listBusinessUsers', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_listBusinessUsers = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_listBusinessUsers_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('listBusinessUsers failed: unknown result');
};
UserStoreClient.prototype.listBusinessInvitations = function(authenticationToken, includeRequestedInvitations, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_listBusinessInvitations(authenticationToken, includeRequestedInvitations);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_listBusinessInvitations(authenticationToken, includeRequestedInvitations);
}
};
UserStoreClient.prototype.send_listBusinessInvitations = function(authenticationToken, includeRequestedInvitations) {
var output = new this.pClass(this.output);
var params = {
authenticationToken: authenticationToken,
includeRequestedInvitations: includeRequestedInvitations
};
var args = new UserStore_listBusinessInvitations_args(params);
try {
output.writeMessageBegin('listBusinessInvitations', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_listBusinessInvitations = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_listBusinessInvitations_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('listBusinessInvitations failed: unknown result');
};
UserStoreClient.prototype.getAccountLimits = function(serviceLevel, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_getAccountLimits(serviceLevel);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_getAccountLimits(serviceLevel);
}
};
UserStoreClient.prototype.send_getAccountLimits = function(serviceLevel) {
var output = new this.pClass(this.output);
var params = {
serviceLevel: serviceLevel
};
var args = new UserStore_getAccountLimits_args(params);
try {
output.writeMessageBegin('getAccountLimits', Thrift.MessageType.CALL, this.seqid());
args[Symbol.for("write")](output);
output.writeMessageEnd();
return this.output.flush();
}
catch (e) {
delete this._reqs[this.seqid()];
if (typeof output.reset === 'function') {
output.reset();
}
throw e;
}
};
UserStoreClient.prototype.recv_getAccountLimits = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x[Symbol.for("read")](input);
input.readMessageEnd();
return callback(x);
}
var result = new UserStore_getAccountLimits_result();
result[Symbol.for("read")](input);
input.readMessageEnd();
if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getAccountLimits failed: unknown result');
};
exports.Client = UserStoreClient;
var UserStoreProcessor = function(handler) {
this._handler = handler;
};
UserStoreProcessor.prototype.process = function(input, output) {
var r = input.readMessageBegin();
if (this['process_' + r.fname]) {
return this['process_' + r.fname].call(this, r.rseqid, input, output);
} else {
input.skip(Thrift.Type.STRUCT);
input.readMessageEnd();
var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);
output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);
x[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}
};
UserStoreProcessor.prototype.process_checkVersion = function(seqid, input, output) {
var args = new UserStore_checkVersion_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.checkVersion.length === 3) {
Q.fcall(this._handler.checkVersion.bind(this._handler),
args.clientName,
args.edamVersionMajor,
args.edamVersionMinor
).then(function(result) {
var result_obj = new UserStore_checkVersion_result({success: result});
output.writeMessageBegin("checkVersion", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("checkVersion", Thrift.MessageType.EXCEPTION, seqid);
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.checkVersion(args.clientName, args.edamVersionMajor, args.edamVersionMinor, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new UserStore_checkVersion_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("checkVersion", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("checkVersion", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_getBootstrapInfo = function(seqid, input, output) {
var args = new UserStore_getBootstrapInfo_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.getBootstrapInfo.length === 1) {
Q.fcall(this._handler.getBootstrapInfo.bind(this._handler),
args.locale
).then(function(result) {
var result_obj = new UserStore_getBootstrapInfo_result({success: result});
output.writeMessageBegin("getBootstrapInfo", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getBootstrapInfo", Thrift.MessageType.EXCEPTION, seqid);
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.getBootstrapInfo(args.locale, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new UserStore_getBootstrapInfo_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("getBootstrapInfo", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getBootstrapInfo", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_authenticateLongSession = function(seqid, input, output) {
var args = new UserStore_authenticateLongSession_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.authenticateLongSession.length === 7) {
Q.fcall(this._handler.authenticateLongSession.bind(this._handler),
args.username,
args.password,
args.consumerKey,
args.consumerSecret,
args.deviceIdentifier,
args.deviceDescription,
args.supportsTwoFactor
).then(function(result) {
var result_obj = new UserStore_authenticateLongSession_result({success: result});
output.writeMessageBegin("authenticateLongSession", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_authenticateLongSession_result(err);
output.writeMessageBegin("authenticateLongSession", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authenticateLongSession", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.authenticateLongSession(args.username, args.password, args.consumerKey, args.consumerSecret, args.deviceIdentifier, args.deviceDescription, args.supportsTwoFactor, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_authenticateLongSession_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("authenticateLongSession", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authenticateLongSession", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_completeTwoFactorAuthentication = function(seqid, input, output) {
var args = new UserStore_completeTwoFactorAuthentication_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.completeTwoFactorAuthentication.length === 4) {
Q.fcall(this._handler.completeTwoFactorAuthentication.bind(this._handler),
args.authenticationToken,
args.oneTimeCode,
args.deviceIdentifier,
args.deviceDescription
).then(function(result) {
var result_obj = new UserStore_completeTwoFactorAuthentication_result({success: result});
output.writeMessageBegin("completeTwoFactorAuthentication", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_completeTwoFactorAuthentication_result(err);
output.writeMessageBegin("completeTwoFactorAuthentication", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("completeTwoFactorAuthentication", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.completeTwoFactorAuthentication(args.authenticationToken, args.oneTimeCode, args.deviceIdentifier, args.deviceDescription, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_completeTwoFactorAuthentication_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("completeTwoFactorAuthentication", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("completeTwoFactorAuthentication", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_revokeLongSession = function(seqid, input, output) {
var args = new UserStore_revokeLongSession_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.revokeLongSession.length === 1) {
Q.fcall(this._handler.revokeLongSession.bind(this._handler),
args.authenticationToken
).then(function(result) {
var result_obj = new UserStore_revokeLongSession_result({success: result});
output.writeMessageBegin("revokeLongSession", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_revokeLongSession_result(err);
output.writeMessageBegin("revokeLongSession", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("revokeLongSession", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.revokeLongSession(args.authenticationToken, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_revokeLongSession_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("revokeLongSession", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("revokeLongSession", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_authenticateToBusiness = function(seqid, input, output) {
var args = new UserStore_authenticateToBusiness_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.authenticateToBusiness.length === 1) {
Q.fcall(this._handler.authenticateToBusiness.bind(this._handler),
args.authenticationToken
).then(function(result) {
var result_obj = new UserStore_authenticateToBusiness_result({success: result});
output.writeMessageBegin("authenticateToBusiness", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_authenticateToBusiness_result(err);
output.writeMessageBegin("authenticateToBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authenticateToBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.authenticateToBusiness(args.authenticationToken, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_authenticateToBusiness_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("authenticateToBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authenticateToBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_getUser = function(seqid, input, output) {
var args = new UserStore_getUser_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.getUser.length === 1) {
Q.fcall(this._handler.getUser.bind(this._handler),
args.authenticationToken
).then(function(result) {
var result_obj = new UserStore_getUser_result({success: result});
output.writeMessageBegin("getUser", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_getUser_result(err);
output.writeMessageBegin("getUser", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getUser", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.getUser(args.authenticationToken, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_getUser_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("getUser", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getUser", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_getPublicUserInfo = function(seqid, input, output) {
var args = new UserStore_getPublicUserInfo_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.getPublicUserInfo.length === 1) {
Q.fcall(this._handler.getPublicUserInfo.bind(this._handler),
args.username
).then(function(result) {
var result_obj = new UserStore_getPublicUserInfo_result({success: result});
output.writeMessageBegin("getPublicUserInfo", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMNotFoundException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMUserException) {
result = new UserStore_getPublicUserInfo_result(err);
output.writeMessageBegin("getPublicUserInfo", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getPublicUserInfo", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.getPublicUserInfo(args.username, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMNotFoundException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMUserException) {
result_obj = new UserStore_getPublicUserInfo_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("getPublicUserInfo", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getPublicUserInfo", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_getUserUrls = function(seqid, input, output) {
var args = new UserStore_getUserUrls_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.getUserUrls.length === 1) {
Q.fcall(this._handler.getUserUrls.bind(this._handler),
args.authenticationToken
).then(function(result) {
var result_obj = new UserStore_getUserUrls_result({success: result});
output.writeMessageBegin("getUserUrls", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_getUserUrls_result(err);
output.writeMessageBegin("getUserUrls", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getUserUrls", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.getUserUrls(args.authenticationToken, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_getUserUrls_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("getUserUrls", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getUserUrls", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_inviteToBusiness = function(seqid, input, output) {
var args = new UserStore_inviteToBusiness_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.inviteToBusiness.length === 2) {
Q.fcall(this._handler.inviteToBusiness.bind(this._handler),
args.authenticationToken,
args.emailAddress
).then(function(result) {
var result_obj = new UserStore_inviteToBusiness_result({success: result});
output.writeMessageBegin("inviteToBusiness", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_inviteToBusiness_result(err);
output.writeMessageBegin("inviteToBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("inviteToBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.inviteToBusiness(args.authenticationToken, args.emailAddress, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_inviteToBusiness_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("inviteToBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("inviteToBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_removeFromBusiness = function(seqid, input, output) {
var args = new UserStore_removeFromBusiness_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.removeFromBusiness.length === 2) {
Q.fcall(this._handler.removeFromBusiness.bind(this._handler),
args.authenticationToken,
args.emailAddress
).then(function(result) {
var result_obj = new UserStore_removeFromBusiness_result({success: result});
output.writeMessageBegin("removeFromBusiness", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMNotFoundException) {
result = new UserStore_removeFromBusiness_result(err);
output.writeMessageBegin("removeFromBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("removeFromBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.removeFromBusiness(args.authenticationToken, args.emailAddress, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMNotFoundException) {
result_obj = new UserStore_removeFromBusiness_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("removeFromBusiness", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("removeFromBusiness", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_updateBusinessUserIdentifier = function(seqid, input, output) {
var args = new UserStore_updateBusinessUserIdentifier_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.updateBusinessUserIdentifier.length === 3) {
Q.fcall(this._handler.updateBusinessUserIdentifier.bind(this._handler),
args.authenticationToken,
args.oldEmailAddress,
args.newEmailAddress
).then(function(result) {
var result_obj = new UserStore_updateBusinessUserIdentifier_result({success: result});
output.writeMessageBegin("updateBusinessUserIdentifier", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMNotFoundException) {
result = new UserStore_updateBusinessUserIdentifier_result(err);
output.writeMessageBegin("updateBusinessUserIdentifier", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("updateBusinessUserIdentifier", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.updateBusinessUserIdentifier(args.authenticationToken, args.oldEmailAddress, args.newEmailAddress, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException || err instanceof Errors_ttypes.EDAMNotFoundException) {
result_obj = new UserStore_updateBusinessUserIdentifier_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("updateBusinessUserIdentifier", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("updateBusinessUserIdentifier", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_listBusinessUsers = function(seqid, input, output) {
var args = new UserStore_listBusinessUsers_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.listBusinessUsers.length === 1) {
Q.fcall(this._handler.listBusinessUsers.bind(this._handler),
args.authenticationToken
).then(function(result) {
var result_obj = new UserStore_listBusinessUsers_result({success: result});
output.writeMessageBegin("listBusinessUsers", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_listBusinessUsers_result(err);
output.writeMessageBegin("listBusinessUsers", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("listBusinessUsers", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.listBusinessUsers(args.authenticationToken, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_listBusinessUsers_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("listBusinessUsers", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("listBusinessUsers", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_listBusinessInvitations = function(seqid, input, output) {
var args = new UserStore_listBusinessInvitations_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.listBusinessInvitations.length === 2) {
Q.fcall(this._handler.listBusinessInvitations.bind(this._handler),
args.authenticationToken,
args.includeRequestedInvitations
).then(function(result) {
var result_obj = new UserStore_listBusinessInvitations_result({success: result});
output.writeMessageBegin("listBusinessInvitations", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result = new UserStore_listBusinessInvitations_result(err);
output.writeMessageBegin("listBusinessInvitations", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("listBusinessInvitations", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.listBusinessInvitations(args.authenticationToken, args.includeRequestedInvitations, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException || err instanceof Errors_ttypes.EDAMSystemException) {
result_obj = new UserStore_listBusinessInvitations_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("listBusinessInvitations", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("listBusinessInvitations", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
UserStoreProcessor.prototype.process_getAccountLimits = function(seqid, input, output) {
var args = new UserStore_getAccountLimits_args();
args[Symbol.for("read")](input);
input.readMessageEnd();
if (this._handler.getAccountLimits.length === 1) {
Q.fcall(this._handler.getAccountLimits.bind(this._handler),
args.serviceLevel
).then(function(result) {
var result_obj = new UserStore_getAccountLimits_result({success: result});
output.writeMessageBegin("getAccountLimits", Thrift.MessageType.REPLY, seqid);
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof Errors_ttypes.EDAMUserException) {
result = new UserStore_getAccountLimits_result(err);
output.writeMessageBegin("getAccountLimits", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getAccountLimits", Thrift.MessageType.EXCEPTION, seqid);
}
result[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.getAccountLimits(args.serviceLevel, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.EDAMUserException) {
result_obj = new UserStore_getAccountLimits_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("getAccountLimits", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("getAccountLimits", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj[Symbol.for("write")](output);
output.writeMessageEnd();
output.flush();
});
}
};
exports.Processor = UserStoreProcessor;