text:
"use strict";

var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;

var Authentication_ttypes = require('./Authentication_types');
var Aroma_ttypes = require('./Aroma_types');
var Channels_ttypes = require('./Channels_types');
var Endpoint_ttypes = require('./Endpoint_types');
var Events_ttypes = require('./Events_types');
var Exceptions_ttypes = require('./Exceptions_types');
var Reactions_ttypes = require('./Reactions_types');

var ttypes = module.exports = {};
var SignInRequest = module.exports.SignInRequest = function(args) {
  this.credentials = null;
  this.emailAddress = null;
  if (args) {
    if (args.credentials !== undefined && args.credentials !== null) {
      this.credentials = new Authentication_ttypes.Credentials(args.credentials);
    }
    if (args.emailAddress !== undefined && args.emailAddress !== null) {
      this.emailAddress = args.emailAddress;
    }
  }
};
SignInRequest.prototype = {};
SignInRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.credentials = new Authentication_ttypes.Credentials();
        this.credentials.read(input);
      } 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;
};

SignInRequest.prototype.write = function(output) {
  output.writeStructBegin('SignInRequest');
  if (this.credentials !== null && this.credentials !== undefined) {
    output.writeFieldBegin('credentials', Thrift.Type.STRUCT, 1);
    this.credentials.write(output);
    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 SignInResponse = module.exports.SignInResponse = function(args) {
  this.userToken = null;
  if (args) {
    if (args.userToken !== undefined && args.userToken !== null) {
      this.userToken = new Authentication_ttypes.UserToken(args.userToken);
    }
  }
};
SignInResponse.prototype = {};
SignInResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.userToken = new Authentication_ttypes.UserToken();
        this.userToken.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

SignInResponse.prototype.write = function(output) {
  output.writeStructBegin('SignInResponse');
  if (this.userToken !== null && this.userToken !== undefined) {
    output.writeFieldBegin('userToken', Thrift.Type.STRUCT, 1);
    this.userToken.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var SignUpRequest = module.exports.SignUpRequest = function(args) {
  this.email = null;
  this.name = null;
  this.firstName = null;
  this.middleName = null;
  this.lastName = null;
  this.username = null;
  this.organizationId = null;
  this.credentials = null;
  this.mainRole = null;
  this.birthDate = null;
  this.githubProfile = null;
  this.profileImage = null;
  if (args) {
    if (args.email !== undefined && args.email !== null) {
      this.email = args.email;
    }
    if (args.name !== undefined && args.name !== null) {
      this.name = args.name;
    }
    if (args.firstName !== undefined && args.firstName !== null) {
      this.firstName = args.firstName;
    }
    if (args.middleName !== undefined && args.middleName !== null) {
      this.middleName = args.middleName;
    }
    if (args.lastName !== undefined && args.lastName !== null) {
      this.lastName = args.lastName;
    }
    if (args.username !== undefined && args.username !== null) {
      this.username = args.username;
    }
    if (args.organizationId !== undefined && args.organizationId !== null) {
      this.organizationId = args.organizationId;
    }
    if (args.credentials !== undefined && args.credentials !== null) {
      this.credentials = new Authentication_ttypes.Credentials(args.credentials);
    }
    if (args.mainRole !== undefined && args.mainRole !== null) {
      this.mainRole = args.mainRole;
    }
    if (args.birthDate !== undefined && args.birthDate !== null) {
      this.birthDate = args.birthDate;
    }
    if (args.githubProfile !== undefined && args.githubProfile !== null) {
      this.githubProfile = args.githubProfile;
    }
    if (args.profileImage !== undefined && args.profileImage !== null) {
      this.profileImage = new Aroma_ttypes.Image(args.profileImage);
    }
  }
};
SignUpRequest.prototype = {};
SignUpRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.email = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.name = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.firstName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.middleName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.lastName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRING) {
        this.username = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.STRING) {
        this.organizationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 8:
      if (ftype == Thrift.Type.STRUCT) {
        this.credentials = new Authentication_ttypes.Credentials();
        this.credentials.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 9:
      if (ftype == Thrift.Type.I32) {
        this.mainRole = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 10:
      if (ftype == Thrift.Type.I64) {
        this.birthDate = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 11:
      if (ftype == Thrift.Type.STRING) {
        this.githubProfile = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 12:
      if (ftype == Thrift.Type.STRUCT) {
        this.profileImage = new Aroma_ttypes.Image();
        this.profileImage.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

SignUpRequest.prototype.write = function(output) {
  output.writeStructBegin('SignUpRequest');
  if (this.email !== null && this.email !== undefined) {
    output.writeFieldBegin('email', Thrift.Type.STRING, 1);
    output.writeString(this.email);
    output.writeFieldEnd();
  }
  if (this.name !== null && this.name !== undefined) {
    output.writeFieldBegin('name', Thrift.Type.STRING, 2);
    output.writeString(this.name);
    output.writeFieldEnd();
  }
  if (this.firstName !== null && this.firstName !== undefined) {
    output.writeFieldBegin('firstName', Thrift.Type.STRING, 3);
    output.writeString(this.firstName);
    output.writeFieldEnd();
  }
  if (this.middleName !== null && this.middleName !== undefined) {
    output.writeFieldBegin('middleName', Thrift.Type.STRING, 4);
    output.writeString(this.middleName);
    output.writeFieldEnd();
  }
  if (this.lastName !== null && this.lastName !== undefined) {
    output.writeFieldBegin('lastName', Thrift.Type.STRING, 5);
    output.writeString(this.lastName);
    output.writeFieldEnd();
  }
  if (this.username !== null && this.username !== undefined) {
    output.writeFieldBegin('username', Thrift.Type.STRING, 6);
    output.writeString(this.username);
    output.writeFieldEnd();
  }
  if (this.organizationId !== null && this.organizationId !== undefined) {
    output.writeFieldBegin('organizationId', Thrift.Type.STRING, 7);
    output.writeString(this.organizationId);
    output.writeFieldEnd();
  }
  if (this.credentials !== null && this.credentials !== undefined) {
    output.writeFieldBegin('credentials', Thrift.Type.STRUCT, 8);
    this.credentials.write(output);
    output.writeFieldEnd();
  }
  if (this.mainRole !== null && this.mainRole !== undefined) {
    output.writeFieldBegin('mainRole', Thrift.Type.I32, 9);
    output.writeI32(this.mainRole);
    output.writeFieldEnd();
  }
  if (this.birthDate !== null && this.birthDate !== undefined) {
    output.writeFieldBegin('birthDate', Thrift.Type.I64, 10);
    output.writeI64(this.birthDate);
    output.writeFieldEnd();
  }
  if (this.githubProfile !== null && this.githubProfile !== undefined) {
    output.writeFieldBegin('githubProfile', Thrift.Type.STRING, 11);
    output.writeString(this.githubProfile);
    output.writeFieldEnd();
  }
  if (this.profileImage !== null && this.profileImage !== undefined) {
    output.writeFieldBegin('profileImage', Thrift.Type.STRUCT, 12);
    this.profileImage.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var SignUpResponse = module.exports.SignUpResponse = function(args) {
  this.userToken = null;
  this.account = null;
  this.userId = null;
  if (args) {
    if (args.userToken !== undefined && args.userToken !== null) {
      this.userToken = new Authentication_ttypes.UserToken(args.userToken);
    }
    if (args.account !== undefined && args.account !== null) {
      this.account = new Authentication_ttypes.AromaAccount(args.account);
    }
    if (args.userId !== undefined && args.userId !== null) {
      this.userId = args.userId;
    }
  }
};
SignUpResponse.prototype = {};
SignUpResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.userToken = new Authentication_ttypes.UserToken();
        this.userToken.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.account = new Authentication_ttypes.AromaAccount();
        this.account.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.userId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

SignUpResponse.prototype.write = function(output) {
  output.writeStructBegin('SignUpResponse');
  if (this.userToken !== null && this.userToken !== undefined) {
    output.writeFieldBegin('userToken', Thrift.Type.STRUCT, 1);
    this.userToken.write(output);
    output.writeFieldEnd();
  }
  if (this.account !== null && this.account !== undefined) {
    output.writeFieldBegin('account', Thrift.Type.STRUCT, 2);
    this.account.write(output);
    output.writeFieldEnd();
  }
  if (this.userId !== null && this.userId !== undefined) {
    output.writeFieldBegin('userId', Thrift.Type.STRING, 3);
    output.writeString(this.userId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var CheckExistsRequest = module.exports.CheckExistsRequest = function(args) {
  this.emailAddress = null;
  if (args) {
    if (args.emailAddress !== undefined && args.emailAddress !== null) {
      this.emailAddress = args.emailAddress;
    }
  }
};
CheckExistsRequest.prototype = {};
CheckExistsRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.emailAddress = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

CheckExistsRequest.prototype.write = function(output) {
  output.writeStructBegin('CheckExistsRequest');
  if (this.emailAddress !== null && this.emailAddress !== undefined) {
    output.writeFieldBegin('emailAddress', Thrift.Type.STRING, 1);
    output.writeString(this.emailAddress);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var CheckExistsResponse = module.exports.CheckExistsResponse = function(args) {
  this.exists = null;
  this.message = null;
  if (args) {
    if (args.exists !== undefined && args.exists !== null) {
      this.exists = args.exists;
    }
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
  }
};
CheckExistsResponse.prototype = {};
CheckExistsResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.BOOL) {
        this.exists = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

CheckExistsResponse.prototype.write = function(output) {
  output.writeStructBegin('CheckExistsResponse');
  if (this.exists !== null && this.exists !== undefined) {
    output.writeFieldBegin('exists', Thrift.Type.BOOL, 1);
    output.writeBool(this.exists);
    output.writeFieldEnd();
  }
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 2);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetUserInfoRequest = module.exports.GetUserInfoRequest = function(args) {
  this.token = null;
  this.userId = null;
  this.email = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.userId !== undefined && args.userId !== null) {
      this.userId = args.userId;
    }
    if (args.email !== undefined && args.email !== null) {
      this.email = args.email;
    }
  }
};
GetUserInfoRequest.prototype = {};
GetUserInfoRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.userId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.email = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetUserInfoRequest.prototype.write = function(output) {
  output.writeStructBegin('GetUserInfoRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.userId !== null && this.userId !== undefined) {
    output.writeFieldBegin('userId', Thrift.Type.STRING, 2);
    output.writeString(this.userId);
    output.writeFieldEnd();
  }
  if (this.email !== null && this.email !== undefined) {
    output.writeFieldBegin('email', Thrift.Type.STRING, 3);
    output.writeString(this.email);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetUserInfoResponse = module.exports.GetUserInfoResponse = function(args) {
  this.userInfo = null;
  if (args) {
    if (args.userInfo !== undefined && args.userInfo !== null) {
      this.userInfo = new Aroma_ttypes.User(args.userInfo);
    }
  }
};
GetUserInfoResponse.prototype = {};
GetUserInfoResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.userInfo = new Aroma_ttypes.User();
        this.userInfo.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetUserInfoResponse.prototype.write = function(output) {
  output.writeStructBegin('GetUserInfoResponse');
  if (this.userInfo !== null && this.userInfo !== undefined) {
    output.writeFieldBegin('userInfo', Thrift.Type.STRUCT, 1);
    this.userInfo.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationInfoRequest = module.exports.GetApplicationInfoRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  this.includeFollowingInfo = false;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.AuthenticationToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.includeFollowingInfo !== undefined && args.includeFollowingInfo !== null) {
      this.includeFollowingInfo = args.includeFollowingInfo;
    }
  }
};
GetApplicationInfoRequest.prototype = {};
GetApplicationInfoRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.AuthenticationToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.BOOL) {
        this.includeFollowingInfo = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationInfoRequest.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationInfoRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.includeFollowingInfo !== null && this.includeFollowingInfo !== undefined) {
    output.writeFieldBegin('includeFollowingInfo', Thrift.Type.BOOL, 3);
    output.writeBool(this.includeFollowingInfo);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationInfoResponse = module.exports.GetApplicationInfoResponse = function(args) {
  this.applicationInfo = null;
  if (args) {
    if (args.applicationInfo !== undefined && args.applicationInfo !== null) {
      this.applicationInfo = new Aroma_ttypes.Application(args.applicationInfo);
    }
  }
};
GetApplicationInfoResponse.prototype = {};
GetApplicationInfoResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.applicationInfo = new Aroma_ttypes.Application();
        this.applicationInfo.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationInfoResponse.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationInfoResponse');
  if (this.applicationInfo !== null && this.applicationInfo !== undefined) {
    output.writeFieldBegin('applicationInfo', Thrift.Type.STRUCT, 1);
    this.applicationInfo.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationsOwnedByRequest = module.exports.GetApplicationsOwnedByRequest = function(args) {
  this.token = null;
  this.userId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.userId !== undefined && args.userId !== null) {
      this.userId = args.userId;
    }
  }
};
GetApplicationsOwnedByRequest.prototype = {};
GetApplicationsOwnedByRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.userId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationsOwnedByRequest.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationsOwnedByRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.userId !== null && this.userId !== undefined) {
    output.writeFieldBegin('userId', Thrift.Type.STRING, 2);
    output.writeString(this.userId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationsOwnedByResponse = module.exports.GetApplicationsOwnedByResponse = function(args) {
  this.applications = [];
  if (args) {
    if (args.applications !== undefined && args.applications !== null) {
      this.applications = Thrift.copyList(args.applications, [null]);
    }
  }
};
GetApplicationsOwnedByResponse.prototype = {};
GetApplicationsOwnedByResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size0 = 0;
        var _rtmp34;
        this.applications = [];
        var _etype3 = 0;
        _rtmp34 = input.readListBegin();
        _etype3 = _rtmp34.etype;
        _size0 = _rtmp34.size;
        for (var _i5 = 0; _i5 < _size0; ++_i5)
        {
          var elem6 = null;
          elem6 = new Aroma_ttypes.Application();
          elem6.read(input);
          this.applications.push(elem6);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationsOwnedByResponse.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationsOwnedByResponse');
  if (this.applications !== null && this.applications !== undefined) {
    output.writeFieldBegin('applications', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.applications.length);
    for (var iter7 in this.applications)
    {
      if (this.applications.hasOwnProperty(iter7))
      {
        iter7 = this.applications[iter7];
        iter7.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var ProvisionApplicationRequest = module.exports.ProvisionApplicationRequest = function(args) {
  this.token = null;
  this.applicationName = null;
  this.programmingLanguage = null;
  this.organizationId = null;
  this.icon = null;
  this.owners = null;
  this.applicationDescription = '';
  this.tier = 1;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationName !== undefined && args.applicationName !== null) {
      this.applicationName = args.applicationName;
    }
    if (args.programmingLanguage !== undefined && args.programmingLanguage !== null) {
      this.programmingLanguage = args.programmingLanguage;
    }
    if (args.organizationId !== undefined && args.organizationId !== null) {
      this.organizationId = args.organizationId;
    }
    if (args.icon !== undefined && args.icon !== null) {
      this.icon = new Aroma_ttypes.Image(args.icon);
    }
    if (args.owners !== undefined && args.owners !== null) {
      this.owners = Thrift.copyList(args.owners, [null]);
    }
    if (args.applicationDescription !== undefined && args.applicationDescription !== null) {
      this.applicationDescription = args.applicationDescription;
    }
    if (args.tier !== undefined && args.tier !== null) {
      this.tier = args.tier;
    }
  }
};
ProvisionApplicationRequest.prototype = {};
ProvisionApplicationRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I32) {
        this.programmingLanguage = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.organizationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRUCT) {
        this.icon = new Aroma_ttypes.Image();
        this.icon.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.SET) {
        var _size8 = 0;
        var _rtmp312;
        this.owners = [];
        var _etype11 = 0;
        _rtmp312 = input.readSetBegin();
        _etype11 = _rtmp312.etype;
        _size8 = _rtmp312.size;
        for (var _i13 = 0; _i13 < _size8; ++_i13)
        {
          var elem14 = null;
          elem14 = input.readString();
          this.owners.push(elem14);
        }
        input.readSetEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.STRING) {
        this.applicationDescription = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 8:
      if (ftype == Thrift.Type.I32) {
        this.tier = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

ProvisionApplicationRequest.prototype.write = function(output) {
  output.writeStructBegin('ProvisionApplicationRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationName !== null && this.applicationName !== undefined) {
    output.writeFieldBegin('applicationName', Thrift.Type.STRING, 2);
    output.writeString(this.applicationName);
    output.writeFieldEnd();
  }
  if (this.programmingLanguage !== null && this.programmingLanguage !== undefined) {
    output.writeFieldBegin('programmingLanguage', Thrift.Type.I32, 3);
    output.writeI32(this.programmingLanguage);
    output.writeFieldEnd();
  }
  if (this.organizationId !== null && this.organizationId !== undefined) {
    output.writeFieldBegin('organizationId', Thrift.Type.STRING, 4);
    output.writeString(this.organizationId);
    output.writeFieldEnd();
  }
  if (this.icon !== null && this.icon !== undefined) {
    output.writeFieldBegin('icon', Thrift.Type.STRUCT, 5);
    this.icon.write(output);
    output.writeFieldEnd();
  }
  if (this.owners !== null && this.owners !== undefined) {
    output.writeFieldBegin('owners', Thrift.Type.SET, 6);
    output.writeSetBegin(Thrift.Type.STRING, this.owners.length);
    for (var iter15 in this.owners)
    {
      if (this.owners.hasOwnProperty(iter15))
      {
        iter15 = this.owners[iter15];
        output.writeString(iter15);
      }
    }
    output.writeSetEnd();
    output.writeFieldEnd();
  }
  if (this.applicationDescription !== null && this.applicationDescription !== undefined) {
    output.writeFieldBegin('applicationDescription', Thrift.Type.STRING, 7);
    output.writeString(this.applicationDescription);
    output.writeFieldEnd();
  }
  if (this.tier !== null && this.tier !== undefined) {
    output.writeFieldBegin('tier', Thrift.Type.I32, 8);
    output.writeI32(this.tier);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var ProvisionApplicationResponse = module.exports.ProvisionApplicationResponse = function(args) {
  this.applicationToken = null;
  this.applicationInfo = null;
  if (args) {
    if (args.applicationToken !== undefined && args.applicationToken !== null) {
      this.applicationToken = new Authentication_ttypes.ApplicationToken(args.applicationToken);
    }
    if (args.applicationInfo !== undefined && args.applicationInfo !== null) {
      this.applicationInfo = new Aroma_ttypes.Application(args.applicationInfo);
    }
  }
};
ProvisionApplicationResponse.prototype = {};
ProvisionApplicationResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.applicationToken = new Authentication_ttypes.ApplicationToken();
        this.applicationToken.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.applicationInfo = new Aroma_ttypes.Application();
        this.applicationInfo.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

ProvisionApplicationResponse.prototype.write = function(output) {
  output.writeStructBegin('ProvisionApplicationResponse');
  if (this.applicationToken !== null && this.applicationToken !== undefined) {
    output.writeFieldBegin('applicationToken', Thrift.Type.STRUCT, 1);
    this.applicationToken.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationInfo !== null && this.applicationInfo !== undefined) {
    output.writeFieldBegin('applicationInfo', Thrift.Type.STRUCT, 2);
    this.applicationInfo.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteApplicationRequest = module.exports.DeleteApplicationRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
  }
};
DeleteApplicationRequest.prototype = {};
DeleteApplicationRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteApplicationRequest.prototype.write = function(output) {
  output.writeStructBegin('DeleteApplicationRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteApplicationResponse = module.exports.DeleteApplicationResponse = function(args) {
  this.message = 'Success';
  if (args) {
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
  }
};
DeleteApplicationResponse.prototype = {};
DeleteApplicationResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteApplicationResponse.prototype.write = function(output) {
  output.writeStructBegin('DeleteApplicationResponse');
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UpdateApplicationRequest = module.exports.UpdateApplicationRequest = function(args) {
  this.token = null;
  this.updatedApplication = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.updatedApplication !== undefined && args.updatedApplication !== null) {
      this.updatedApplication = new Aroma_ttypes.Application(args.updatedApplication);
    }
  }
};
UpdateApplicationRequest.prototype = {};
UpdateApplicationRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.updatedApplication = new Aroma_ttypes.Application();
        this.updatedApplication.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UpdateApplicationRequest.prototype.write = function(output) {
  output.writeStructBegin('UpdateApplicationRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.updatedApplication !== null && this.updatedApplication !== undefined) {
    output.writeFieldBegin('updatedApplication', Thrift.Type.STRUCT, 2);
    this.updatedApplication.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UpdateApplicationResponse = module.exports.UpdateApplicationResponse = function(args) {
  this.application = null;
  if (args) {
    if (args.application !== undefined && args.application !== null) {
      this.application = new Aroma_ttypes.Application(args.application);
    }
  }
};
UpdateApplicationResponse.prototype = {};
UpdateApplicationResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.application = new Aroma_ttypes.Application();
        this.application.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UpdateApplicationResponse.prototype.write = function(output) {
  output.writeStructBegin('UpdateApplicationResponse');
  if (this.application !== null && this.application !== undefined) {
    output.writeFieldBegin('application', Thrift.Type.STRUCT, 1);
    this.application.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var SearchForApplicationsRequest = module.exports.SearchForApplicationsRequest = function(args) {
  this.token = null;
  this.applicationName = null;
  this.organizationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationName !== undefined && args.applicationName !== null) {
      this.applicationName = args.applicationName;
    }
    if (args.organizationId !== undefined && args.organizationId !== null) {
      this.organizationId = args.organizationId;
    }
  }
};
SearchForApplicationsRequest.prototype = {};
SearchForApplicationsRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.organizationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

SearchForApplicationsRequest.prototype.write = function(output) {
  output.writeStructBegin('SearchForApplicationsRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationName !== null && this.applicationName !== undefined) {
    output.writeFieldBegin('applicationName', Thrift.Type.STRING, 2);
    output.writeString(this.applicationName);
    output.writeFieldEnd();
  }
  if (this.organizationId !== null && this.organizationId !== undefined) {
    output.writeFieldBegin('organizationId', Thrift.Type.STRING, 3);
    output.writeString(this.organizationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var SearchForApplicationsResponse = module.exports.SearchForApplicationsResponse = function(args) {
  this.applications = [];
  if (args) {
    if (args.applications !== undefined && args.applications !== null) {
      this.applications = Thrift.copyList(args.applications, [null]);
    }
  }
};
SearchForApplicationsResponse.prototype = {};
SearchForApplicationsResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size16 = 0;
        var _rtmp320;
        this.applications = [];
        var _etype19 = 0;
        _rtmp320 = input.readListBegin();
        _etype19 = _rtmp320.etype;
        _size16 = _rtmp320.size;
        for (var _i21 = 0; _i21 < _size16; ++_i21)
        {
          var elem22 = null;
          elem22 = new Aroma_ttypes.Application();
          elem22.read(input);
          this.applications.push(elem22);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

SearchForApplicationsResponse.prototype.write = function(output) {
  output.writeStructBegin('SearchForApplicationsResponse');
  if (this.applications !== null && this.applications !== undefined) {
    output.writeFieldBegin('applications', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.applications.length);
    for (var iter23 in this.applications)
    {
      if (this.applications.hasOwnProperty(iter23))
      {
        iter23 = this.applications[iter23];
        iter23.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RecreateApplicationTokenRequest = module.exports.RecreateApplicationTokenRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
  }
};
RecreateApplicationTokenRequest.prototype = {};
RecreateApplicationTokenRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RecreateApplicationTokenRequest.prototype.write = function(output) {
  output.writeStructBegin('RecreateApplicationTokenRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RecreateApplicationTokenResponse = module.exports.RecreateApplicationTokenResponse = function(args) {
  this.applicationToken = null;
  if (args) {
    if (args.applicationToken !== undefined && args.applicationToken !== null) {
      this.applicationToken = new Authentication_ttypes.ApplicationToken(args.applicationToken);
    }
  }
};
RecreateApplicationTokenResponse.prototype = {};
RecreateApplicationTokenResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.applicationToken = new Authentication_ttypes.ApplicationToken();
        this.applicationToken.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RecreateApplicationTokenResponse.prototype.write = function(output) {
  output.writeStructBegin('RecreateApplicationTokenResponse');
  if (this.applicationToken !== null && this.applicationToken !== undefined) {
    output.writeFieldBegin('applicationToken', Thrift.Type.STRUCT, 1);
    this.applicationToken.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RenewApplicationTokenRequest = module.exports.RenewApplicationTokenRequest = function(args) {
  this.token = null;
  this.newLifetime = null;
  this.applicationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.newLifetime !== undefined && args.newLifetime !== null) {
      this.newLifetime = new Aroma_ttypes.LengthOfTime(args.newLifetime);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
  }
};
RenewApplicationTokenRequest.prototype = {};
RenewApplicationTokenRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.newLifetime = new Aroma_ttypes.LengthOfTime();
        this.newLifetime.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RenewApplicationTokenRequest.prototype.write = function(output) {
  output.writeStructBegin('RenewApplicationTokenRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.newLifetime !== null && this.newLifetime !== undefined) {
    output.writeFieldBegin('newLifetime', Thrift.Type.STRUCT, 3);
    this.newLifetime.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 4);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RenewApplicationTokenResponse = module.exports.RenewApplicationTokenResponse = function(args) {
  this.applicationToken = null;
  if (args) {
    if (args.applicationToken !== undefined && args.applicationToken !== null) {
      this.applicationToken = new Authentication_ttypes.ApplicationToken(args.applicationToken);
    }
  }
};
RenewApplicationTokenResponse.prototype = {};
RenewApplicationTokenResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.applicationToken = new Authentication_ttypes.ApplicationToken();
        this.applicationToken.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RenewApplicationTokenResponse.prototype.write = function(output) {
  output.writeStructBegin('RenewApplicationTokenResponse');
  if (this.applicationToken !== null && this.applicationToken !== undefined) {
    output.writeFieldBegin('applicationToken', Thrift.Type.STRUCT, 1);
    this.applicationToken.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationsFollowedByRequest = module.exports.GetApplicationsFollowedByRequest = function(args) {
  this.token = null;
  this.userId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.userId !== undefined && args.userId !== null) {
      this.userId = args.userId;
    }
  }
};
GetApplicationsFollowedByRequest.prototype = {};
GetApplicationsFollowedByRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.userId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationsFollowedByRequest.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationsFollowedByRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.userId !== null && this.userId !== undefined) {
    output.writeFieldBegin('userId', Thrift.Type.STRING, 2);
    output.writeString(this.userId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationsFollowedByResponse = module.exports.GetApplicationsFollowedByResponse = function(args) {
  this.applications = [];
  if (args) {
    if (args.applications !== undefined && args.applications !== null) {
      this.applications = Thrift.copyList(args.applications, [null]);
    }
  }
};
GetApplicationsFollowedByResponse.prototype = {};
GetApplicationsFollowedByResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size24 = 0;
        var _rtmp328;
        this.applications = [];
        var _etype27 = 0;
        _rtmp328 = input.readListBegin();
        _etype27 = _rtmp328.etype;
        _size24 = _rtmp328.size;
        for (var _i29 = 0; _i29 < _size24; ++_i29)
        {
          var elem30 = null;
          elem30 = new Aroma_ttypes.Application();
          elem30.read(input);
          this.applications.push(elem30);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationsFollowedByResponse.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationsFollowedByResponse');
  if (this.applications !== null && this.applications !== undefined) {
    output.writeFieldBegin('applications', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.applications.length);
    for (var iter31 in this.applications)
    {
      if (this.applications.hasOwnProperty(iter31))
      {
        iter31 = this.applications[iter31];
        iter31.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var FollowApplicationRequest = module.exports.FollowApplicationRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  this.organizationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.organizationId !== undefined && args.organizationId !== null) {
      this.organizationId = args.organizationId;
    }
  }
};
FollowApplicationRequest.prototype = {};
FollowApplicationRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.organizationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

FollowApplicationRequest.prototype.write = function(output) {
  output.writeStructBegin('FollowApplicationRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.organizationId !== null && this.organizationId !== undefined) {
    output.writeFieldBegin('organizationId', Thrift.Type.STRING, 3);
    output.writeString(this.organizationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var FollowApplicationResponse = module.exports.FollowApplicationResponse = function(args) {
  this.message = 'Success';
  if (args) {
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
  }
};
FollowApplicationResponse.prototype = {};
FollowApplicationResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

FollowApplicationResponse.prototype.write = function(output) {
  output.writeStructBegin('FollowApplicationResponse');
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UnfollowApplicationRequest = module.exports.UnfollowApplicationRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  this.organizationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.organizationId !== undefined && args.organizationId !== null) {
      this.organizationId = args.organizationId;
    }
  }
};
UnfollowApplicationRequest.prototype = {};
UnfollowApplicationRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.organizationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UnfollowApplicationRequest.prototype.write = function(output) {
  output.writeStructBegin('UnfollowApplicationRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.organizationId !== null && this.organizationId !== undefined) {
    output.writeFieldBegin('organizationId', Thrift.Type.STRING, 3);
    output.writeString(this.organizationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UnfollowApplicationResponse = module.exports.UnfollowApplicationResponse = function(args) {
  this.message = 'Success';
  if (args) {
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
  }
};
UnfollowApplicationResponse.prototype = {};
UnfollowApplicationResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UnfollowApplicationResponse.prototype.write = function(output) {
  output.writeStructBegin('UnfollowApplicationResponse');
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationMessagesRequest = module.exports.GetApplicationMessagesRequest = function(args) {
  this.token = null;
  this.applicationId = null;
  this.limit = 0;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.limit !== undefined && args.limit !== null) {
      this.limit = args.limit;
    }
  }
};
GetApplicationMessagesRequest.prototype = {};
GetApplicationMessagesRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I32) {
        this.limit = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationMessagesRequest.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationMessagesRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 2);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.limit !== null && this.limit !== undefined) {
    output.writeFieldBegin('limit', Thrift.Type.I32, 3);
    output.writeI32(this.limit);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetApplicationMessagesResponse = module.exports.GetApplicationMessagesResponse = function(args) {
  this.messages = [];
  this.totalMessagesMatching = 0;
  if (args) {
    if (args.messages !== undefined && args.messages !== null) {
      this.messages = Thrift.copyList(args.messages, [Aroma_ttypes.Message]);
    }
    if (args.totalMessagesMatching !== undefined && args.totalMessagesMatching !== null) {
      this.totalMessagesMatching = args.totalMessagesMatching;
    }
  }
};
GetApplicationMessagesResponse.prototype = {};
GetApplicationMessagesResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size32 = 0;
        var _rtmp336;
        this.messages = [];
        var _etype35 = 0;
        _rtmp336 = input.readListBegin();
        _etype35 = _rtmp336.etype;
        _size32 = _rtmp336.size;
        for (var _i37 = 0; _i37 < _size32; ++_i37)
        {
          var elem38 = null;
          elem38 = new Aroma_ttypes.Message();
          elem38.read(input);
          this.messages.push(elem38);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.totalMessagesMatching = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetApplicationMessagesResponse.prototype.write = function(output) {
  output.writeStructBegin('GetApplicationMessagesResponse');
  if (this.messages !== null && this.messages !== undefined) {
    output.writeFieldBegin('messages', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.messages.length);
    for (var iter39 in this.messages)
    {
      if (this.messages.hasOwnProperty(iter39))
      {
        iter39 = this.messages[iter39];
        iter39.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.totalMessagesMatching !== null && this.totalMessagesMatching !== undefined) {
    output.writeFieldBegin('totalMessagesMatching', Thrift.Type.I32, 2);
    output.writeI32(this.totalMessagesMatching);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetFullMessageRequest = module.exports.GetFullMessageRequest = function(args) {
  this.token = null;
  this.messageId = null;
  this.applicationId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.messageId !== undefined && args.messageId !== null) {
      this.messageId = args.messageId;
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
  }
};
GetFullMessageRequest.prototype = {};
GetFullMessageRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.messageId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetFullMessageRequest.prototype.write = function(output) {
  output.writeStructBegin('GetFullMessageRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.messageId !== null && this.messageId !== undefined) {
    output.writeFieldBegin('messageId', Thrift.Type.STRING, 2);
    output.writeString(this.messageId);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 3);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetFullMessageResponse = module.exports.GetFullMessageResponse = function(args) {
  this.fullMessage = null;
  if (args) {
    if (args.fullMessage !== undefined && args.fullMessage !== null) {
      this.fullMessage = new Aroma_ttypes.Message(args.fullMessage);
    }
  }
};
GetFullMessageResponse.prototype = {};
GetFullMessageResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.fullMessage = new Aroma_ttypes.Message();
        this.fullMessage.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetFullMessageResponse.prototype.write = function(output) {
  output.writeStructBegin('GetFullMessageResponse');
  if (this.fullMessage !== null && this.fullMessage !== undefined) {
    output.writeFieldBegin('fullMessage', Thrift.Type.STRUCT, 1);
    this.fullMessage.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetMediaRequest = module.exports.GetMediaRequest = function(args) {
  this.token = null;
  this.mediaId = null;
  this.desiredThumbnailSize = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.mediaId !== undefined && args.mediaId !== null) {
      this.mediaId = args.mediaId;
    }
    if (args.desiredThumbnailSize !== undefined && args.desiredThumbnailSize !== null) {
      this.desiredThumbnailSize = new Aroma_ttypes.Dimension(args.desiredThumbnailSize);
    }
  }
};
GetMediaRequest.prototype = {};
GetMediaRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.mediaId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.desiredThumbnailSize = new Aroma_ttypes.Dimension();
        this.desiredThumbnailSize.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetMediaRequest.prototype.write = function(output) {
  output.writeStructBegin('GetMediaRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.mediaId !== null && this.mediaId !== undefined) {
    output.writeFieldBegin('mediaId', Thrift.Type.STRING, 2);
    output.writeString(this.mediaId);
    output.writeFieldEnd();
  }
  if (this.desiredThumbnailSize !== null && this.desiredThumbnailSize !== undefined) {
    output.writeFieldBegin('desiredThumbnailSize', Thrift.Type.STRUCT, 3);
    this.desiredThumbnailSize.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetMediaResponse = module.exports.GetMediaResponse = function(args) {
  this.image = null;
  if (args) {
    if (args.image !== undefined && args.image !== null) {
      this.image = new Aroma_ttypes.Image(args.image);
    }
  }
};
GetMediaResponse.prototype = {};
GetMediaResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.image = new Aroma_ttypes.Image();
        this.image.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetMediaResponse.prototype.write = function(output) {
  output.writeStructBegin('GetMediaResponse');
  if (this.image !== null && this.image !== undefined) {
    output.writeFieldBegin('image', Thrift.Type.STRUCT, 1);
    this.image.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteMessageRequest = module.exports.DeleteMessageRequest = function(args) {
  this.token = null;
  this.messageId = null;
  this.applicationId = null;
  this.messageIds = [];
  this.deleteAll = false;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.messageId !== undefined && args.messageId !== null) {
      this.messageId = args.messageId;
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.messageIds !== undefined && args.messageIds !== null) {
      this.messageIds = Thrift.copyList(args.messageIds, [null]);
    }
    if (args.deleteAll !== undefined && args.deleteAll !== null) {
      this.deleteAll = args.deleteAll;
    }
  }
};
DeleteMessageRequest.prototype = {};
DeleteMessageRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.messageId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.LIST) {
        var _size40 = 0;
        var _rtmp344;
        this.messageIds = [];
        var _etype43 = 0;
        _rtmp344 = input.readListBegin();
        _etype43 = _rtmp344.etype;
        _size40 = _rtmp344.size;
        for (var _i45 = 0; _i45 < _size40; ++_i45)
        {
          var elem46 = null;
          elem46 = input.readString();
          this.messageIds.push(elem46);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.BOOL) {
        this.deleteAll = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteMessageRequest.prototype.write = function(output) {
  output.writeStructBegin('DeleteMessageRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.messageId !== null && this.messageId !== undefined) {
    output.writeFieldBegin('messageId', Thrift.Type.STRING, 2);
    output.writeString(this.messageId);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 3);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.messageIds !== null && this.messageIds !== undefined) {
    output.writeFieldBegin('messageIds', Thrift.Type.LIST, 4);
    output.writeListBegin(Thrift.Type.STRING, this.messageIds.length);
    for (var iter47 in this.messageIds)
    {
      if (this.messageIds.hasOwnProperty(iter47))
      {
        iter47 = this.messageIds[iter47];
        output.writeString(iter47);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.deleteAll !== null && this.deleteAll !== undefined) {
    output.writeFieldBegin('deleteAll', Thrift.Type.BOOL, 5);
    output.writeBool(this.deleteAll);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteMessageResponse = module.exports.DeleteMessageResponse = function(args) {
  this.messagesDeleted = 0;
  if (args) {
    if (args.messagesDeleted !== undefined && args.messagesDeleted !== null) {
      this.messagesDeleted = args.messagesDeleted;
    }
  }
};
DeleteMessageResponse.prototype = {};
DeleteMessageResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.messagesDeleted = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteMessageResponse.prototype.write = function(output) {
  output.writeStructBegin('DeleteMessageResponse');
  if (this.messagesDeleted !== null && this.messagesDeleted !== undefined) {
    output.writeFieldBegin('messagesDeleted', Thrift.Type.I32, 1);
    output.writeI32(this.messagesDeleted);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DismissMessageRequest = module.exports.DismissMessageRequest = function(args) {
  this.token = null;
  this.messageId = null;
  this.applicationId = null;
  this.messageIds = [];
  this.dismissAll = false;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.messageId !== undefined && args.messageId !== null) {
      this.messageId = args.messageId;
    }
    if (args.applicationId !== undefined && args.applicationId !== null) {
      this.applicationId = args.applicationId;
    }
    if (args.messageIds !== undefined && args.messageIds !== null) {
      this.messageIds = Thrift.copyList(args.messageIds, [null]);
    }
    if (args.dismissAll !== undefined && args.dismissAll !== null) {
      this.dismissAll = args.dismissAll;
    }
  }
};
DismissMessageRequest.prototype = {};
DismissMessageRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.messageId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.applicationId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.LIST) {
        var _size48 = 0;
        var _rtmp352;
        this.messageIds = [];
        var _etype51 = 0;
        _rtmp352 = input.readListBegin();
        _etype51 = _rtmp352.etype;
        _size48 = _rtmp352.size;
        for (var _i53 = 0; _i53 < _size48; ++_i53)
        {
          var elem54 = null;
          elem54 = input.readString();
          this.messageIds.push(elem54);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.BOOL) {
        this.dismissAll = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DismissMessageRequest.prototype.write = function(output) {
  output.writeStructBegin('DismissMessageRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.messageId !== null && this.messageId !== undefined) {
    output.writeFieldBegin('messageId', Thrift.Type.STRING, 2);
    output.writeString(this.messageId);
    output.writeFieldEnd();
  }
  if (this.applicationId !== null && this.applicationId !== undefined) {
    output.writeFieldBegin('applicationId', Thrift.Type.STRING, 3);
    output.writeString(this.applicationId);
    output.writeFieldEnd();
  }
  if (this.messageIds !== null && this.messageIds !== undefined) {
    output.writeFieldBegin('messageIds', Thrift.Type.LIST, 4);
    output.writeListBegin(Thrift.Type.STRING, this.messageIds.length);
    for (var iter55 in this.messageIds)
    {
      if (this.messageIds.hasOwnProperty(iter55))
      {
        iter55 = this.messageIds[iter55];
        output.writeString(iter55);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.dismissAll !== null && this.dismissAll !== undefined) {
    output.writeFieldBegin('dismissAll', Thrift.Type.BOOL, 5);
    output.writeBool(this.dismissAll);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DismissMessageResponse = module.exports.DismissMessageResponse = function(args) {
  this.messagesDismissed = 0;
  if (args) {
    if (args.messagesDismissed !== undefined && args.messagesDismissed !== null) {
      this.messagesDismissed = args.messagesDismissed;
    }
  }
};
DismissMessageResponse.prototype = {};
DismissMessageResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.messagesDismissed = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DismissMessageResponse.prototype.write = function(output) {
  output.writeStructBegin('DismissMessageResponse');
  if (this.messagesDismissed !== null && this.messagesDismissed !== undefined) {
    output.writeFieldBegin('messagesDismissed', Thrift.Type.I32, 1);
    output.writeI32(this.messagesDismissed);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetInboxRequest = module.exports.GetInboxRequest = function(args) {
  this.token = null;
  this.limit = 0;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.limit !== undefined && args.limit !== null) {
      this.limit = args.limit;
    }
  }
};
GetInboxRequest.prototype = {};
GetInboxRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.limit = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetInboxRequest.prototype.write = function(output) {
  output.writeStructBegin('GetInboxRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.limit !== null && this.limit !== undefined) {
    output.writeFieldBegin('limit', Thrift.Type.I32, 2);
    output.writeI32(this.limit);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetInboxResponse = module.exports.GetInboxResponse = function(args) {
  this.messages = [];
  if (args) {
    if (args.messages !== undefined && args.messages !== null) {
      this.messages = Thrift.copyList(args.messages, [Aroma_ttypes.Message]);
    }
  }
};
GetInboxResponse.prototype = {};
GetInboxResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size56 = 0;
        var _rtmp360;
        this.messages = [];
        var _etype59 = 0;
        _rtmp360 = input.readListBegin();
        _etype59 = _rtmp360.etype;
        _size56 = _rtmp360.size;
        for (var _i61 = 0; _i61 < _size56; ++_i61)
        {
          var elem62 = null;
          elem62 = new Aroma_ttypes.Message();
          elem62.read(input);
          this.messages.push(elem62);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetInboxResponse.prototype.write = function(output) {
  output.writeStructBegin('GetInboxResponse');
  if (this.messages !== null && this.messages !== undefined) {
    output.writeFieldBegin('messages', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.messages.length);
    for (var iter63 in this.messages)
    {
      if (this.messages.hasOwnProperty(iter63))
      {
        iter63 = this.messages[iter63];
        iter63.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetActivityRequest = module.exports.GetActivityRequest = function(args) {
  this.token = null;
  this.limit = 0;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.limit !== undefined && args.limit !== null) {
      this.limit = args.limit;
    }
  }
};
GetActivityRequest.prototype = {};
GetActivityRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.limit = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetActivityRequest.prototype.write = function(output) {
  output.writeStructBegin('GetActivityRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.limit !== null && this.limit !== undefined) {
    output.writeFieldBegin('limit', Thrift.Type.I32, 2);
    output.writeI32(this.limit);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetActivityResponse = module.exports.GetActivityResponse = function(args) {
  this.events = [];
  if (args) {
    if (args.events !== undefined && args.events !== null) {
      this.events = Thrift.copyList(args.events, [Events_ttypes.Event]);
    }
  }
};
GetActivityResponse.prototype = {};
GetActivityResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size64 = 0;
        var _rtmp368;
        this.events = [];
        var _etype67 = 0;
        _rtmp368 = input.readListBegin();
        _etype67 = _rtmp368.etype;
        _size64 = _rtmp368.size;
        for (var _i69 = 0; _i69 < _size64; ++_i69)
        {
          var elem70 = null;
          elem70 = new Events_ttypes.Event();
          elem70.read(input);
          this.events.push(elem70);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetActivityResponse.prototype.write = function(output) {
  output.writeStructBegin('GetActivityResponse');
  if (this.events !== null && this.events !== undefined) {
    output.writeFieldBegin('events', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.events.length);
    for (var iter71 in this.events)
    {
      if (this.events.hasOwnProperty(iter71))
      {
        iter71 = this.events[iter71];
        iter71.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteActivityRequest = module.exports.DeleteActivityRequest = function(args) {
  this.token = null;
  this.eventId = null;
  this.deleteAll = false;
  this.multipleEventIds = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.eventId !== undefined && args.eventId !== null) {
      this.eventId = args.eventId;
    }
    if (args.deleteAll !== undefined && args.deleteAll !== null) {
      this.deleteAll = args.deleteAll;
    }
    if (args.multipleEventIds !== undefined && args.multipleEventIds !== null) {
      this.multipleEventIds = Thrift.copyList(args.multipleEventIds, [null]);
    }
  }
};
DeleteActivityRequest.prototype = {};
DeleteActivityRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.eventId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.BOOL) {
        this.deleteAll = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.LIST) {
        var _size72 = 0;
        var _rtmp376;
        this.multipleEventIds = [];
        var _etype75 = 0;
        _rtmp376 = input.readListBegin();
        _etype75 = _rtmp376.etype;
        _size72 = _rtmp376.size;
        for (var _i77 = 0; _i77 < _size72; ++_i77)
        {
          var elem78 = null;
          elem78 = input.readString();
          this.multipleEventIds.push(elem78);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteActivityRequest.prototype.write = function(output) {
  output.writeStructBegin('DeleteActivityRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.eventId !== null && this.eventId !== undefined) {
    output.writeFieldBegin('eventId', Thrift.Type.STRING, 2);
    output.writeString(this.eventId);
    output.writeFieldEnd();
  }
  if (this.deleteAll !== null && this.deleteAll !== undefined) {
    output.writeFieldBegin('deleteAll', Thrift.Type.BOOL, 3);
    output.writeBool(this.deleteAll);
    output.writeFieldEnd();
  }
  if (this.multipleEventIds !== null && this.multipleEventIds !== undefined) {
    output.writeFieldBegin('multipleEventIds', Thrift.Type.LIST, 4);
    output.writeListBegin(Thrift.Type.STRING, this.multipleEventIds.length);
    for (var iter79 in this.multipleEventIds)
    {
      if (this.multipleEventIds.hasOwnProperty(iter79))
      {
        iter79 = this.multipleEventIds[iter79];
        output.writeString(iter79);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var DeleteActivityResponse = module.exports.DeleteActivityResponse = function(args) {
  this.totalEventsDeleted = 0;
  if (args) {
    if (args.totalEventsDeleted !== undefined && args.totalEventsDeleted !== null) {
      this.totalEventsDeleted = args.totalEventsDeleted;
    }
  }
};
DeleteActivityResponse.prototype = {};
DeleteActivityResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.totalEventsDeleted = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

DeleteActivityResponse.prototype.write = function(output) {
  output.writeStructBegin('DeleteActivityResponse');
  if (this.totalEventsDeleted !== null && this.totalEventsDeleted !== undefined) {
    output.writeFieldBegin('totalEventsDeleted', Thrift.Type.I32, 1);
    output.writeI32(this.totalEventsDeleted);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetReactionsRequest = module.exports.GetReactionsRequest = function(args) {
  this.token = null;
  this.forAppId = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.forAppId !== undefined && args.forAppId !== null) {
      this.forAppId = args.forAppId;
    }
  }
};
GetReactionsRequest.prototype = {};
GetReactionsRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.forAppId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetReactionsRequest.prototype.write = function(output) {
  output.writeStructBegin('GetReactionsRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.forAppId !== null && this.forAppId !== undefined) {
    output.writeFieldBegin('forAppId', Thrift.Type.STRING, 2);
    output.writeString(this.forAppId);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetReactionsResponse = module.exports.GetReactionsResponse = function(args) {
  this.reactions = [];
  if (args) {
    if (args.reactions !== undefined && args.reactions !== null) {
      this.reactions = Thrift.copyList(args.reactions, [null]);
    }
  }
};
GetReactionsResponse.prototype = {};
GetReactionsResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size80 = 0;
        var _rtmp384;
        this.reactions = [];
        var _etype83 = 0;
        _rtmp384 = input.readListBegin();
        _etype83 = _rtmp384.etype;
        _size80 = _rtmp384.size;
        for (var _i85 = 0; _i85 < _size80; ++_i85)
        {
          var elem86 = null;
          elem86 = new Reactions_ttypes.Reaction();
          elem86.read(input);
          this.reactions.push(elem86);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetReactionsResponse.prototype.write = function(output) {
  output.writeStructBegin('GetReactionsResponse');
  if (this.reactions !== null && this.reactions !== undefined) {
    output.writeFieldBegin('reactions', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.reactions.length);
    for (var iter87 in this.reactions)
    {
      if (this.reactions.hasOwnProperty(iter87))
      {
        iter87 = this.reactions[iter87];
        iter87.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UpdateReactionsRequest = module.exports.UpdateReactionsRequest = function(args) {
  this.token = null;
  this.forAppId = null;
  this.reactions = [];
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.forAppId !== undefined && args.forAppId !== null) {
      this.forAppId = args.forAppId;
    }
    if (args.reactions !== undefined && args.reactions !== null) {
      this.reactions = Thrift.copyList(args.reactions, [null]);
    }
  }
};
UpdateReactionsRequest.prototype = {};
UpdateReactionsRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.forAppId = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.LIST) {
        var _size88 = 0;
        var _rtmp392;
        this.reactions = [];
        var _etype91 = 0;
        _rtmp392 = input.readListBegin();
        _etype91 = _rtmp392.etype;
        _size88 = _rtmp392.size;
        for (var _i93 = 0; _i93 < _size88; ++_i93)
        {
          var elem94 = null;
          elem94 = new Reactions_ttypes.Reaction();
          elem94.read(input);
          this.reactions.push(elem94);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UpdateReactionsRequest.prototype.write = function(output) {
  output.writeStructBegin('UpdateReactionsRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.forAppId !== null && this.forAppId !== undefined) {
    output.writeFieldBegin('forAppId', Thrift.Type.STRING, 2);
    output.writeString(this.forAppId);
    output.writeFieldEnd();
  }
  if (this.reactions !== null && this.reactions !== undefined) {
    output.writeFieldBegin('reactions', Thrift.Type.LIST, 3);
    output.writeListBegin(Thrift.Type.STRUCT, this.reactions.length);
    for (var iter95 in this.reactions)
    {
      if (this.reactions.hasOwnProperty(iter95))
      {
        iter95 = this.reactions[iter95];
        iter95.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UpdateReactionsResponse = module.exports.UpdateReactionsResponse = function(args) {
  this.reactions = [];
  if (args) {
    if (args.reactions !== undefined && args.reactions !== null) {
      this.reactions = Thrift.copyList(args.reactions, [null]);
    }
  }
};
UpdateReactionsResponse.prototype = {};
UpdateReactionsResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size96 = 0;
        var _rtmp3100;
        this.reactions = [];
        var _etype99 = 0;
        _rtmp3100 = input.readListBegin();
        _etype99 = _rtmp3100.etype;
        _size96 = _rtmp3100.size;
        for (var _i101 = 0; _i101 < _size96; ++_i101)
        {
          var elem102 = null;
          elem102 = new Reactions_ttypes.Reaction();
          elem102.read(input);
          this.reactions.push(elem102);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UpdateReactionsResponse.prototype.write = function(output) {
  output.writeStructBegin('UpdateReactionsResponse');
  if (this.reactions !== null && this.reactions !== undefined) {
    output.writeFieldBegin('reactions', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.reactions.length);
    for (var iter103 in this.reactions)
    {
      if (this.reactions.hasOwnProperty(iter103))
      {
        iter103 = this.reactions[iter103];
        iter103.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetBuzzRequest = module.exports.GetBuzzRequest = function(args) {
  this.token = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
  }
};
GetBuzzRequest.prototype = {};
GetBuzzRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetBuzzRequest.prototype.write = function(output) {
  output.writeStructBegin('GetBuzzRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetBuzzResponse = module.exports.GetBuzzResponse = function(args) {
  this.freshUsers = [];
  this.freshApplications = [];
  this.failedHealthChecks = [];
  this.generalEvents = [];
  if (args) {
    if (args.freshUsers !== undefined && args.freshUsers !== null) {
      this.freshUsers = Thrift.copyList(args.freshUsers, [null]);
    }
    if (args.freshApplications !== undefined && args.freshApplications !== null) {
      this.freshApplications = Thrift.copyList(args.freshApplications, [null]);
    }
    if (args.failedHealthChecks !== undefined && args.failedHealthChecks !== null) {
      this.failedHealthChecks = Thrift.copyList(args.failedHealthChecks, [null]);
    }
    if (args.generalEvents !== undefined && args.generalEvents !== null) {
      this.generalEvents = Thrift.copyList(args.generalEvents, [Events_ttypes.Event]);
    }
  }
};
GetBuzzResponse.prototype = {};
GetBuzzResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size104 = 0;
        var _rtmp3108;
        this.freshUsers = [];
        var _etype107 = 0;
        _rtmp3108 = input.readListBegin();
        _etype107 = _rtmp3108.etype;
        _size104 = _rtmp3108.size;
        for (var _i109 = 0; _i109 < _size104; ++_i109)
        {
          var elem110 = null;
          elem110 = new Aroma_ttypes.User();
          elem110.read(input);
          this.freshUsers.push(elem110);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.LIST) {
        var _size111 = 0;
        var _rtmp3115;
        this.freshApplications = [];
        var _etype114 = 0;
        _rtmp3115 = input.readListBegin();
        _etype114 = _rtmp3115.etype;
        _size111 = _rtmp3115.size;
        for (var _i116 = 0; _i116 < _size111; ++_i116)
        {
          var elem117 = null;
          elem117 = new Aroma_ttypes.Application();
          elem117.read(input);
          this.freshApplications.push(elem117);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.LIST) {
        var _size118 = 0;
        var _rtmp3122;
        this.failedHealthChecks = [];
        var _etype121 = 0;
        _rtmp3122 = input.readListBegin();
        _etype121 = _rtmp3122.etype;
        _size118 = _rtmp3122.size;
        for (var _i123 = 0; _i123 < _size118; ++_i123)
        {
          var elem124 = null;
          elem124 = new Events_ttypes.HealthCheckFailed();
          elem124.read(input);
          this.failedHealthChecks.push(elem124);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.LIST) {
        var _size125 = 0;
        var _rtmp3129;
        this.generalEvents = [];
        var _etype128 = 0;
        _rtmp3129 = input.readListBegin();
        _etype128 = _rtmp3129.etype;
        _size125 = _rtmp3129.size;
        for (var _i130 = 0; _i130 < _size125; ++_i130)
        {
          var elem131 = null;
          elem131 = new Events_ttypes.Event();
          elem131.read(input);
          this.generalEvents.push(elem131);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetBuzzResponse.prototype.write = function(output) {
  output.writeStructBegin('GetBuzzResponse');
  if (this.freshUsers !== null && this.freshUsers !== undefined) {
    output.writeFieldBegin('freshUsers', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.freshUsers.length);
    for (var iter132 in this.freshUsers)
    {
      if (this.freshUsers.hasOwnProperty(iter132))
      {
        iter132 = this.freshUsers[iter132];
        iter132.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.freshApplications !== null && this.freshApplications !== undefined) {
    output.writeFieldBegin('freshApplications', Thrift.Type.LIST, 2);
    output.writeListBegin(Thrift.Type.STRUCT, this.freshApplications.length);
    for (var iter133 in this.freshApplications)
    {
      if (this.freshApplications.hasOwnProperty(iter133))
      {
        iter133 = this.freshApplications[iter133];
        iter133.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.failedHealthChecks !== null && this.failedHealthChecks !== undefined) {
    output.writeFieldBegin('failedHealthChecks', Thrift.Type.LIST, 3);
    output.writeListBegin(Thrift.Type.STRUCT, this.failedHealthChecks.length);
    for (var iter134 in this.failedHealthChecks)
    {
      if (this.failedHealthChecks.hasOwnProperty(iter134))
      {
        iter134 = this.failedHealthChecks[iter134];
        iter134.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.generalEvents !== null && this.generalEvents !== undefined) {
    output.writeFieldBegin('generalEvents', Thrift.Type.LIST, 4);
    output.writeListBegin(Thrift.Type.STRUCT, this.generalEvents.length);
    for (var iter135 in this.generalEvents)
    {
      if (this.generalEvents.hasOwnProperty(iter135))
      {
        iter135 = this.generalEvents[iter135];
        iter135.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetDashboardRequest = module.exports.GetDashboardRequest = function(args) {
  this.token = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
  }
};
GetDashboardRequest.prototype = {};
GetDashboardRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetDashboardRequest.prototype.write = function(output) {
  output.writeStructBegin('GetDashboardRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetDashboardResponse = module.exports.GetDashboardResponse = function(args) {
  this.unreadMessageCount = 0;
  this.totalMessagesLastHour = 0;
  this.totalMessagesLast24hrs = 0;
  this.recentMessages = [];
  this.numberOfLowUrgencyMessages = 0;
  this.numberOfMediumUrgencyMessages = 0;
  this.numberOfHighUrgencyMessages = 0;
  if (args) {
    if (args.unreadMessageCount !== undefined && args.unreadMessageCount !== null) {
      this.unreadMessageCount = args.unreadMessageCount;
    }
    if (args.totalMessagesLastHour !== undefined && args.totalMessagesLastHour !== null) {
      this.totalMessagesLastHour = args.totalMessagesLastHour;
    }
    if (args.totalMessagesLast24hrs !== undefined && args.totalMessagesLast24hrs !== null) {
      this.totalMessagesLast24hrs = args.totalMessagesLast24hrs;
    }
    if (args.recentMessages !== undefined && args.recentMessages !== null) {
      this.recentMessages = Thrift.copyList(args.recentMessages, [Aroma_ttypes.Message]);
    }
    if (args.numberOfLowUrgencyMessages !== undefined && args.numberOfLowUrgencyMessages !== null) {
      this.numberOfLowUrgencyMessages = args.numberOfLowUrgencyMessages;
    }
    if (args.numberOfMediumUrgencyMessages !== undefined && args.numberOfMediumUrgencyMessages !== null) {
      this.numberOfMediumUrgencyMessages = args.numberOfMediumUrgencyMessages;
    }
    if (args.numberOfHighUrgencyMessages !== undefined && args.numberOfHighUrgencyMessages !== null) {
      this.numberOfHighUrgencyMessages = args.numberOfHighUrgencyMessages;
    }
  }
};
GetDashboardResponse.prototype = {};
GetDashboardResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.unreadMessageCount = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.totalMessagesLastHour = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I32) {
        this.totalMessagesLast24hrs = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.LIST) {
        var _size136 = 0;
        var _rtmp3140;
        this.recentMessages = [];
        var _etype139 = 0;
        _rtmp3140 = input.readListBegin();
        _etype139 = _rtmp3140.etype;
        _size136 = _rtmp3140.size;
        for (var _i141 = 0; _i141 < _size136; ++_i141)
        {
          var elem142 = null;
          elem142 = new Aroma_ttypes.Message();
          elem142.read(input);
          this.recentMessages.push(elem142);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.I32) {
        this.numberOfLowUrgencyMessages = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.I32) {
        this.numberOfMediumUrgencyMessages = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.I32) {
        this.numberOfHighUrgencyMessages = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetDashboardResponse.prototype.write = function(output) {
  output.writeStructBegin('GetDashboardResponse');
  if (this.unreadMessageCount !== null && this.unreadMessageCount !== undefined) {
    output.writeFieldBegin('unreadMessageCount', Thrift.Type.I32, 1);
    output.writeI32(this.unreadMessageCount);
    output.writeFieldEnd();
  }
  if (this.totalMessagesLastHour !== null && this.totalMessagesLastHour !== undefined) {
    output.writeFieldBegin('totalMessagesLastHour', Thrift.Type.I32, 2);
    output.writeI32(this.totalMessagesLastHour);
    output.writeFieldEnd();
  }
  if (this.totalMessagesLast24hrs !== null && this.totalMessagesLast24hrs !== undefined) {
    output.writeFieldBegin('totalMessagesLast24hrs', Thrift.Type.I32, 3);
    output.writeI32(this.totalMessagesLast24hrs);
    output.writeFieldEnd();
  }
  if (this.recentMessages !== null && this.recentMessages !== undefined) {
    output.writeFieldBegin('recentMessages', Thrift.Type.LIST, 4);
    output.writeListBegin(Thrift.Type.STRUCT, this.recentMessages.length);
    for (var iter143 in this.recentMessages)
    {
      if (this.recentMessages.hasOwnProperty(iter143))
      {
        iter143 = this.recentMessages[iter143];
        iter143.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.numberOfLowUrgencyMessages !== null && this.numberOfLowUrgencyMessages !== undefined) {
    output.writeFieldBegin('numberOfLowUrgencyMessages', Thrift.Type.I32, 5);
    output.writeI32(this.numberOfLowUrgencyMessages);
    output.writeFieldEnd();
  }
  if (this.numberOfMediumUrgencyMessages !== null && this.numberOfMediumUrgencyMessages !== undefined) {
    output.writeFieldBegin('numberOfMediumUrgencyMessages', Thrift.Type.I32, 6);
    output.writeI32(this.numberOfMediumUrgencyMessages);
    output.writeFieldEnd();
  }
  if (this.numberOfHighUrgencyMessages !== null && this.numberOfHighUrgencyMessages !== undefined) {
    output.writeFieldBegin('numberOfHighUrgencyMessages', Thrift.Type.I32, 7);
    output.writeI32(this.numberOfHighUrgencyMessages);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var CheckIfDeviceIsRegisteredRequest = module.exports.CheckIfDeviceIsRegisteredRequest = function(args) {
  this.token = null;
  this.device = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.device !== undefined && args.device !== null) {
      this.device = new Channels_ttypes.MobileDevice(args.device);
    }
  }
};
CheckIfDeviceIsRegisteredRequest.prototype = {};
CheckIfDeviceIsRegisteredRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.device = new Channels_ttypes.MobileDevice();
        this.device.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

CheckIfDeviceIsRegisteredRequest.prototype.write = function(output) {
  output.writeStructBegin('CheckIfDeviceIsRegisteredRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.device !== null && this.device !== undefined) {
    output.writeFieldBegin('device', Thrift.Type.STRUCT, 2);
    this.device.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var CheckIfDeviceIsRegisteredResponse = module.exports.CheckIfDeviceIsRegisteredResponse = function(args) {
  this.isRegistered = null;
  if (args) {
    if (args.isRegistered !== undefined && args.isRegistered !== null) {
      this.isRegistered = args.isRegistered;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isRegistered is unset!');
    }
  }
};
CheckIfDeviceIsRegisteredResponse.prototype = {};
CheckIfDeviceIsRegisteredResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.BOOL) {
        this.isRegistered = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

CheckIfDeviceIsRegisteredResponse.prototype.write = function(output) {
  output.writeStructBegin('CheckIfDeviceIsRegisteredResponse');
  if (this.isRegistered !== null && this.isRegistered !== undefined) {
    output.writeFieldBegin('isRegistered', Thrift.Type.BOOL, 1);
    output.writeBool(this.isRegistered);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetRegisteredDevicesRequest = module.exports.GetRegisteredDevicesRequest = function(args) {
  this.token = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
  }
};
GetRegisteredDevicesRequest.prototype = {};
GetRegisteredDevicesRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetRegisteredDevicesRequest.prototype.write = function(output) {
  output.writeStructBegin('GetRegisteredDevicesRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetRegisteredDevicesResponse = module.exports.GetRegisteredDevicesResponse = function(args) {
  this.devices = [];
  if (args) {
    if (args.devices !== undefined && args.devices !== null) {
      this.devices = Thrift.copyList(args.devices, [null]);
    }
  }
};
GetRegisteredDevicesResponse.prototype = {};
GetRegisteredDevicesResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size144 = 0;
        var _rtmp3148;
        this.devices = [];
        var _etype147 = 0;
        _rtmp3148 = input.readListBegin();
        _etype147 = _rtmp3148.etype;
        _size144 = _rtmp3148.size;
        for (var _i149 = 0; _i149 < _size144; ++_i149)
        {
          var elem150 = null;
          elem150 = new Channels_ttypes.MobileDevice();
          elem150.read(input);
          this.devices.push(elem150);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetRegisteredDevicesResponse.prototype.write = function(output) {
  output.writeStructBegin('GetRegisteredDevicesResponse');
  if (this.devices !== null && this.devices !== undefined) {
    output.writeFieldBegin('devices', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.devices.length);
    for (var iter151 in this.devices)
    {
      if (this.devices.hasOwnProperty(iter151))
      {
        iter151 = this.devices[iter151];
        iter151.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RegisterDeviceRequest = module.exports.RegisterDeviceRequest = function(args) {
  this.token = null;
  this.device = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.device !== undefined && args.device !== null) {
      this.device = new Channels_ttypes.MobileDevice(args.device);
    }
  }
};
RegisterDeviceRequest.prototype = {};
RegisterDeviceRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.device = new Channels_ttypes.MobileDevice();
        this.device.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RegisterDeviceRequest.prototype.write = function(output) {
  output.writeStructBegin('RegisterDeviceRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.device !== null && this.device !== undefined) {
    output.writeFieldBegin('device', Thrift.Type.STRUCT, 2);
    this.device.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RegisterDeviceResponse = module.exports.RegisterDeviceResponse = function(args) {
  this.message = 'Successfully Registered';
  if (args) {
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
  }
};
RegisterDeviceResponse.prototype = {};
RegisterDeviceResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RegisterDeviceResponse.prototype.write = function(output) {
  output.writeStructBegin('RegisterDeviceResponse');
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UnregisterDeviceRequest = module.exports.UnregisterDeviceRequest = function(args) {
  this.token = null;
  this.device = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.device !== undefined && args.device !== null) {
      this.device = new Channels_ttypes.MobileDevice(args.device);
    }
  }
};
UnregisterDeviceRequest.prototype = {};
UnregisterDeviceRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.device = new Channels_ttypes.MobileDevice();
        this.device.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UnregisterDeviceRequest.prototype.write = function(output) {
  output.writeStructBegin('UnregisterDeviceRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.device !== null && this.device !== undefined) {
    output.writeFieldBegin('device', Thrift.Type.STRUCT, 2);
    this.device.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var UnregisterDeviceResponse = module.exports.UnregisterDeviceResponse = function(args) {
  this.removedDevice = null;
  if (args) {
    if (args.removedDevice !== undefined && args.removedDevice !== null) {
      this.removedDevice = new Channels_ttypes.MobileDevice(args.removedDevice);
    }
  }
};
UnregisterDeviceResponse.prototype = {};
UnregisterDeviceResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.removedDevice = new Channels_ttypes.MobileDevice();
        this.removedDevice.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

UnregisterDeviceResponse.prototype.write = function(output) {
  output.writeStructBegin('UnregisterDeviceResponse');
  if (this.removedDevice !== null && this.removedDevice !== undefined) {
    output.writeFieldBegin('removedDevice', Thrift.Type.STRUCT, 1);
    this.removedDevice.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RegisterHealthCheckRequest = module.exports.RegisterHealthCheckRequest = function(args) {
  this.token = null;
  this.endpoint = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
    if (args.endpoint !== undefined && args.endpoint !== null) {
      this.endpoint = new Endpoint_ttypes.Endpoint(args.endpoint);
    }
  }
};
RegisterHealthCheckRequest.prototype = {};
RegisterHealthCheckRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.endpoint = new Endpoint_ttypes.Endpoint();
        this.endpoint.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RegisterHealthCheckRequest.prototype.write = function(output) {
  output.writeStructBegin('RegisterHealthCheckRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  if (this.endpoint !== null && this.endpoint !== undefined) {
    output.writeFieldBegin('endpoint', Thrift.Type.STRUCT, 2);
    this.endpoint.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var RegisterHealthCheckResponse = module.exports.RegisterHealthCheckResponse = function(args) {
  this.message = null;
  this.healthCheckToken = null;
  if (args) {
    if (args.message !== undefined && args.message !== null) {
      this.message = args.message;
    }
    if (args.healthCheckToken !== undefined && args.healthCheckToken !== null) {
      this.healthCheckToken = args.healthCheckToken;
    }
  }
};
RegisterHealthCheckResponse.prototype = {};
RegisterHealthCheckResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.healthCheckToken = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

RegisterHealthCheckResponse.prototype.write = function(output) {
  output.writeStructBegin('RegisterHealthCheckResponse');
  if (this.message !== null && this.message !== undefined) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1);
    output.writeString(this.message);
    output.writeFieldEnd();
  }
  if (this.healthCheckToken !== null && this.healthCheckToken !== undefined) {
    output.writeFieldBegin('healthCheckToken', Thrift.Type.STRING, 2);
    output.writeString(this.healthCheckToken);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetServiceAnnouncementsRequest = module.exports.GetServiceAnnouncementsRequest = function(args) {
  this.token = null;
  if (args) {
    if (args.token !== undefined && args.token !== null) {
      this.token = new Authentication_ttypes.UserToken(args.token);
    }
  }
};
GetServiceAnnouncementsRequest.prototype = {};
GetServiceAnnouncementsRequest.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.token = new Authentication_ttypes.UserToken();
        this.token.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetServiceAnnouncementsRequest.prototype.write = function(output) {
  output.writeStructBegin('GetServiceAnnouncementsRequest');
  if (this.token !== null && this.token !== undefined) {
    output.writeFieldBegin('token', Thrift.Type.STRUCT, 1);
    this.token.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var GetServiceAnnouncementsResponse = module.exports.GetServiceAnnouncementsResponse = function(args) {
  this.serviceAnnouncements = [];
  if (args) {
    if (args.serviceAnnouncements !== undefined && args.serviceAnnouncements !== null) {
      this.serviceAnnouncements = Thrift.copyList(args.serviceAnnouncements, [Aroma_ttypes.ServiceAnnouncement]);
    }
  }
};
GetServiceAnnouncementsResponse.prototype = {};
GetServiceAnnouncementsResponse.prototype.read = function(input) {
  input.readStructBegin();
  while (true)
  {
    var ret = input.readFieldBegin();
    var fname = ret.fname;
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        var _size152 = 0;
        var _rtmp3156;
        this.serviceAnnouncements = [];
        var _etype155 = 0;
        _rtmp3156 = input.readListBegin();
        _etype155 = _rtmp3156.etype;
        _size152 = _rtmp3156.size;
        for (var _i157 = 0; _i157 < _size152; ++_i157)
        {
          var elem158 = null;
          elem158 = new Aroma_ttypes.ServiceAnnouncement();
          elem158.read(input);
          this.serviceAnnouncements.push(elem158);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

GetServiceAnnouncementsResponse.prototype.write = function(output) {
  output.writeStructBegin('GetServiceAnnouncementsResponse');
  if (this.serviceAnnouncements !== null && this.serviceAnnouncements !== undefined) {
    output.writeFieldBegin('serviceAnnouncements', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.serviceAnnouncements.length);
    for (var iter159 in this.serviceAnnouncements)
    {
      if (this.serviceAnnouncements.hasOwnProperty(iter159))
      {
        iter159 = this.serviceAnnouncements[iter159];
        iter159.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

ttypes.SERVICE_PORT = 7010;
ttypes.PRODUCTION_ENDPOINT = new Endpoint_ttypes.TcpEndpoint({
  'hostname' : 'aroma-srv.aroma.tech',
  'port' : 80
});
ttypes.BETA_ENDPOINT = new Endpoint_ttypes.TcpEndpoint({
  'hostname' : 'aroma-srv.beta.aroma.tech',
  'port' : 7010
});
ttypes.MAX_PROFILE_IMAGE_DIMENSION = new Aroma_ttypes.Dimension({
  'width' : 1024,
  'height' : 1024
});
ttypes.MAX_PROFILE_PICTURE_SIZE_IN_KILOBYTES = 100;
ttypes.DEFAULT_APP_TOKEN_LIFETIME = new Aroma_ttypes.LengthOfTime({
  'value' : 180,
  'unit' : 5
});
ttypes.MAX_APPLICATION_ICON_DIMENSION = new Aroma_ttypes.Dimension({
  'width' : 1024,
  'height' : 1024
});
ttypes.MAX_APPLICATION_ICON_SIZE_IN_KILOBYTES = 100;
ttypes.APPLICATION_NAME_MAX_LENGTH = 20;
ttypes.APPLICATION_MAX_OWNERS = 10;
ttypes.MAX_MESSAGE_LENGTH = 5000;
ttypes.DEFAULT_INBOX_LIFETIME = new Aroma_ttypes.LengthOfTime({
  'value' : 3,
  'unit' : 5
});
ttypes.DEFAULT_ACTIVITY_LIFETIME = new Aroma_ttypes.LengthOfTime({
  'value' : 4,
  'unit' : 5
});
ttypes.MAXIMUM_REACTIONS = 100;