com.evernote.edam.type.SharedNotebook Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.evernote.edam.type;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import com.evernote.thrift.*;
import com.evernote.thrift.protocol.*;
/**
* Shared notebooks represent a relationship between a notebook and a single
* share invitation recipient.
*
* - id
* - the primary identifier of the share
*
* - userId
* - the user id of the owner of the notebook
*
* - notebookGuid
* - the GUID of the associated notebook shared.
*
* - email
* - the email address of the recipient - used by the notebook
* owner to identify who they shared with.
*
* - notebookModifiable
* - (DEPRECATED) a flag indicating the share is read/write -otherwise it's read
* only. This field is deprecated in favor of the new "privilege" field.
*
* - requireLogin
* - (DEPRECATED) indicates that a user must login to access the share. This
* field is deprecated and will be "true" for all new shared notebooks. It
* is read-only and ignored when creating or modifying a shared notebook,
* except that a shared notebook can be modified to require login.
* See "allowPreview" for information on privileges and shared notebooks.
*
* - serviceCreated
* - the date the owner first created the share with the specific email
* address
*
* - serviceUpdated
* - the date the shared notebook was last updated on the service. This
* will be updated when authenticateToSharedNotebook is called the first
* time with a shared notebook requiring login (i.e. when the username is
* bound to that shared notebook).
*
* - username
* - the username of the user who can access this share.
* Once it's assigned it cannot be changed.
*
* - privilege
* - The privilege level granted to the notebook, activity stream, and
* invitations. See the corresponding enumeration for details.
*
* - allowPreview
* - Whether or not to grant "READ_NOTEBOOK" privilege without an
* authentication token, for authenticateToSharedNotebook(...). With
* the change to "requireLogin" always being true for new shared
* notebooks, this is the only way to access a shared notebook without
* an authorization token. This setting expires after the first use
* of authenticateToSharedNotebook(...) with a valid authentication
* token.
*
* - recipientSettings
* - Settings intended for use only by the recipient of this shared
* notebook. You should skip setting this value unless you want
* to change the value contained inside the structure, and only if
* you are the recipient.
*
*/
public class SharedNotebook implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("SharedNotebook");
private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I32, (short)2);
private static final TField NOTEBOOK_GUID_FIELD_DESC = new TField("notebookGuid", TType.STRING, (short)3);
private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)4);
private static final TField NOTEBOOK_MODIFIABLE_FIELD_DESC = new TField("notebookModifiable", TType.BOOL, (short)5);
private static final TField REQUIRE_LOGIN_FIELD_DESC = new TField("requireLogin", TType.BOOL, (short)6);
private static final TField SERVICE_CREATED_FIELD_DESC = new TField("serviceCreated", TType.I64, (short)7);
private static final TField SERVICE_UPDATED_FIELD_DESC = new TField("serviceUpdated", TType.I64, (short)10);
private static final TField SHARE_KEY_FIELD_DESC = new TField("shareKey", TType.STRING, (short)8);
private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)9);
private static final TField PRIVILEGE_FIELD_DESC = new TField("privilege", TType.I32, (short)11);
private static final TField ALLOW_PREVIEW_FIELD_DESC = new TField("allowPreview", TType.BOOL, (short)12);
private static final TField RECIPIENT_SETTINGS_FIELD_DESC = new TField("recipientSettings", TType.STRUCT, (short)13);
private long id;
private int userId;
private String notebookGuid;
private String email;
private boolean notebookModifiable;
private boolean requireLogin;
private long serviceCreated;
private long serviceUpdated;
private String shareKey;
private String username;
private SharedNotebookPrivilegeLevel privilege;
private boolean allowPreview;
private SharedNotebookRecipientSettings recipientSettings;
// isset id assignments
private static final int __ID_ISSET_ID = 0;
private static final int __USERID_ISSET_ID = 1;
private static final int __NOTEBOOKMODIFIABLE_ISSET_ID = 2;
private static final int __REQUIRELOGIN_ISSET_ID = 3;
private static final int __SERVICECREATED_ISSET_ID = 4;
private static final int __SERVICEUPDATED_ISSET_ID = 5;
private static final int __ALLOWPREVIEW_ISSET_ID = 6;
private boolean[] __isset_vector = new boolean[7];
public SharedNotebook() {
}
/**
* Performs a deep copy on other.
*/
public SharedNotebook(SharedNotebook other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
this.id = other.id;
this.userId = other.userId;
if (other.isSetNotebookGuid()) {
this.notebookGuid = other.notebookGuid;
}
if (other.isSetEmail()) {
this.email = other.email;
}
this.notebookModifiable = other.notebookModifiable;
this.requireLogin = other.requireLogin;
this.serviceCreated = other.serviceCreated;
this.serviceUpdated = other.serviceUpdated;
if (other.isSetShareKey()) {
this.shareKey = other.shareKey;
}
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetPrivilege()) {
this.privilege = other.privilege;
}
this.allowPreview = other.allowPreview;
if (other.isSetRecipientSettings()) {
this.recipientSettings = new SharedNotebookRecipientSettings(other.recipientSettings);
}
}
public SharedNotebook deepCopy() {
return new SharedNotebook(this);
}
public void clear() {
setIdIsSet(false);
this.id = 0;
setUserIdIsSet(false);
this.userId = 0;
this.notebookGuid = null;
this.email = null;
setNotebookModifiableIsSet(false);
this.notebookModifiable = false;
setRequireLoginIsSet(false);
this.requireLogin = false;
setServiceCreatedIsSet(false);
this.serviceCreated = 0;
setServiceUpdatedIsSet(false);
this.serviceUpdated = 0;
this.shareKey = null;
this.username = null;
this.privilege = null;
setAllowPreviewIsSet(false);
this.allowPreview = false;
this.recipientSettings = null;
}
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
setIdIsSet(true);
}
public void unsetId() {
__isset_vector[__ID_ISSET_ID] = false;
}
/** Returns true if field id is set (has been asigned a value) and false otherwise */
public boolean isSetId() {
return __isset_vector[__ID_ISSET_ID];
}
public void setIdIsSet(boolean value) {
__isset_vector[__ID_ISSET_ID] = value;
}
public int getUserId() {
return this.userId;
}
public void setUserId(int userId) {
this.userId = userId;
setUserIdIsSet(true);
}
public void unsetUserId() {
__isset_vector[__USERID_ISSET_ID] = false;
}
/** Returns true if field userId is set (has been asigned a value) and false otherwise */
public boolean isSetUserId() {
return __isset_vector[__USERID_ISSET_ID];
}
public void setUserIdIsSet(boolean value) {
__isset_vector[__USERID_ISSET_ID] = value;
}
public String getNotebookGuid() {
return this.notebookGuid;
}
public void setNotebookGuid(String notebookGuid) {
this.notebookGuid = notebookGuid;
}
public void unsetNotebookGuid() {
this.notebookGuid = null;
}
/** Returns true if field notebookGuid is set (has been asigned a value) and false otherwise */
public boolean isSetNotebookGuid() {
return this.notebookGuid != null;
}
public void setNotebookGuidIsSet(boolean value) {
if (!value) {
this.notebookGuid = null;
}
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public void unsetEmail() {
this.email = null;
}
/** Returns true if field email is set (has been asigned a value) and false otherwise */
public boolean isSetEmail() {
return this.email != null;
}
public void setEmailIsSet(boolean value) {
if (!value) {
this.email = null;
}
}
public boolean isNotebookModifiable() {
return this.notebookModifiable;
}
public void setNotebookModifiable(boolean notebookModifiable) {
this.notebookModifiable = notebookModifiable;
setNotebookModifiableIsSet(true);
}
public void unsetNotebookModifiable() {
__isset_vector[__NOTEBOOKMODIFIABLE_ISSET_ID] = false;
}
/** Returns true if field notebookModifiable is set (has been asigned a value) and false otherwise */
public boolean isSetNotebookModifiable() {
return __isset_vector[__NOTEBOOKMODIFIABLE_ISSET_ID];
}
public void setNotebookModifiableIsSet(boolean value) {
__isset_vector[__NOTEBOOKMODIFIABLE_ISSET_ID] = value;
}
public boolean isRequireLogin() {
return this.requireLogin;
}
public void setRequireLogin(boolean requireLogin) {
this.requireLogin = requireLogin;
setRequireLoginIsSet(true);
}
public void unsetRequireLogin() {
__isset_vector[__REQUIRELOGIN_ISSET_ID] = false;
}
/** Returns true if field requireLogin is set (has been asigned a value) and false otherwise */
public boolean isSetRequireLogin() {
return __isset_vector[__REQUIRELOGIN_ISSET_ID];
}
public void setRequireLoginIsSet(boolean value) {
__isset_vector[__REQUIRELOGIN_ISSET_ID] = value;
}
public long getServiceCreated() {
return this.serviceCreated;
}
public void setServiceCreated(long serviceCreated) {
this.serviceCreated = serviceCreated;
setServiceCreatedIsSet(true);
}
public void unsetServiceCreated() {
__isset_vector[__SERVICECREATED_ISSET_ID] = false;
}
/** Returns true if field serviceCreated is set (has been asigned a value) and false otherwise */
public boolean isSetServiceCreated() {
return __isset_vector[__SERVICECREATED_ISSET_ID];
}
public void setServiceCreatedIsSet(boolean value) {
__isset_vector[__SERVICECREATED_ISSET_ID] = value;
}
public long getServiceUpdated() {
return this.serviceUpdated;
}
public void setServiceUpdated(long serviceUpdated) {
this.serviceUpdated = serviceUpdated;
setServiceUpdatedIsSet(true);
}
public void unsetServiceUpdated() {
__isset_vector[__SERVICEUPDATED_ISSET_ID] = false;
}
/** Returns true if field serviceUpdated is set (has been asigned a value) and false otherwise */
public boolean isSetServiceUpdated() {
return __isset_vector[__SERVICEUPDATED_ISSET_ID];
}
public void setServiceUpdatedIsSet(boolean value) {
__isset_vector[__SERVICEUPDATED_ISSET_ID] = value;
}
public String getShareKey() {
return this.shareKey;
}
public void setShareKey(String shareKey) {
this.shareKey = shareKey;
}
public void unsetShareKey() {
this.shareKey = null;
}
/** Returns true if field shareKey is set (has been asigned a value) and false otherwise */
public boolean isSetShareKey() {
return this.shareKey != null;
}
public void setShareKeyIsSet(boolean value) {
if (!value) {
this.shareKey = null;
}
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been asigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
/**
*
* @see SharedNotebookPrivilegeLevel
*/
public SharedNotebookPrivilegeLevel getPrivilege() {
return this.privilege;
}
/**
*
* @see SharedNotebookPrivilegeLevel
*/
public void setPrivilege(SharedNotebookPrivilegeLevel privilege) {
this.privilege = privilege;
}
public void unsetPrivilege() {
this.privilege = null;
}
/** Returns true if field privilege is set (has been asigned a value) and false otherwise */
public boolean isSetPrivilege() {
return this.privilege != null;
}
public void setPrivilegeIsSet(boolean value) {
if (!value) {
this.privilege = null;
}
}
public boolean isAllowPreview() {
return this.allowPreview;
}
public void setAllowPreview(boolean allowPreview) {
this.allowPreview = allowPreview;
setAllowPreviewIsSet(true);
}
public void unsetAllowPreview() {
__isset_vector[__ALLOWPREVIEW_ISSET_ID] = false;
}
/** Returns true if field allowPreview is set (has been asigned a value) and false otherwise */
public boolean isSetAllowPreview() {
return __isset_vector[__ALLOWPREVIEW_ISSET_ID];
}
public void setAllowPreviewIsSet(boolean value) {
__isset_vector[__ALLOWPREVIEW_ISSET_ID] = value;
}
public SharedNotebookRecipientSettings getRecipientSettings() {
return this.recipientSettings;
}
public void setRecipientSettings(SharedNotebookRecipientSettings recipientSettings) {
this.recipientSettings = recipientSettings;
}
public void unsetRecipientSettings() {
this.recipientSettings = null;
}
/** Returns true if field recipientSettings is set (has been asigned a value) and false otherwise */
public boolean isSetRecipientSettings() {
return this.recipientSettings != null;
}
public void setRecipientSettingsIsSet(boolean value) {
if (!value) {
this.recipientSettings = null;
}
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SharedNotebook)
return this.equals((SharedNotebook)that);
return false;
}
public boolean equals(SharedNotebook that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (this.id != that.id)
return false;
}
boolean this_present_userId = true && this.isSetUserId();
boolean that_present_userId = true && that.isSetUserId();
if (this_present_userId || that_present_userId) {
if (!(this_present_userId && that_present_userId))
return false;
if (this.userId != that.userId)
return false;
}
boolean this_present_notebookGuid = true && this.isSetNotebookGuid();
boolean that_present_notebookGuid = true && that.isSetNotebookGuid();
if (this_present_notebookGuid || that_present_notebookGuid) {
if (!(this_present_notebookGuid && that_present_notebookGuid))
return false;
if (!this.notebookGuid.equals(that.notebookGuid))
return false;
}
boolean this_present_email = true && this.isSetEmail();
boolean that_present_email = true && that.isSetEmail();
if (this_present_email || that_present_email) {
if (!(this_present_email && that_present_email))
return false;
if (!this.email.equals(that.email))
return false;
}
boolean this_present_notebookModifiable = true && this.isSetNotebookModifiable();
boolean that_present_notebookModifiable = true && that.isSetNotebookModifiable();
if (this_present_notebookModifiable || that_present_notebookModifiable) {
if (!(this_present_notebookModifiable && that_present_notebookModifiable))
return false;
if (this.notebookModifiable != that.notebookModifiable)
return false;
}
boolean this_present_requireLogin = true && this.isSetRequireLogin();
boolean that_present_requireLogin = true && that.isSetRequireLogin();
if (this_present_requireLogin || that_present_requireLogin) {
if (!(this_present_requireLogin && that_present_requireLogin))
return false;
if (this.requireLogin != that.requireLogin)
return false;
}
boolean this_present_serviceCreated = true && this.isSetServiceCreated();
boolean that_present_serviceCreated = true && that.isSetServiceCreated();
if (this_present_serviceCreated || that_present_serviceCreated) {
if (!(this_present_serviceCreated && that_present_serviceCreated))
return false;
if (this.serviceCreated != that.serviceCreated)
return false;
}
boolean this_present_serviceUpdated = true && this.isSetServiceUpdated();
boolean that_present_serviceUpdated = true && that.isSetServiceUpdated();
if (this_present_serviceUpdated || that_present_serviceUpdated) {
if (!(this_present_serviceUpdated && that_present_serviceUpdated))
return false;
if (this.serviceUpdated != that.serviceUpdated)
return false;
}
boolean this_present_shareKey = true && this.isSetShareKey();
boolean that_present_shareKey = true && that.isSetShareKey();
if (this_present_shareKey || that_present_shareKey) {
if (!(this_present_shareKey && that_present_shareKey))
return false;
if (!this.shareKey.equals(that.shareKey))
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_privilege = true && this.isSetPrivilege();
boolean that_present_privilege = true && that.isSetPrivilege();
if (this_present_privilege || that_present_privilege) {
if (!(this_present_privilege && that_present_privilege))
return false;
if (!this.privilege.equals(that.privilege))
return false;
}
boolean this_present_allowPreview = true && this.isSetAllowPreview();
boolean that_present_allowPreview = true && that.isSetAllowPreview();
if (this_present_allowPreview || that_present_allowPreview) {
if (!(this_present_allowPreview && that_present_allowPreview))
return false;
if (this.allowPreview != that.allowPreview)
return false;
}
boolean this_present_recipientSettings = true && this.isSetRecipientSettings();
boolean that_present_recipientSettings = true && that.isSetRecipientSettings();
if (this_present_recipientSettings || that_present_recipientSettings) {
if (!(this_present_recipientSettings && that_present_recipientSettings))
return false;
if (!this.recipientSettings.equals(that.recipientSettings))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(SharedNotebook other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SharedNotebook typedOther = (SharedNotebook)other;
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) { lastComparison = TBaseHelper.compareTo(this.id, typedOther.id);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserId()) { lastComparison = TBaseHelper.compareTo(this.userId, typedOther.userId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNotebookGuid()).compareTo(typedOther.isSetNotebookGuid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNotebookGuid()) { lastComparison = TBaseHelper.compareTo(this.notebookGuid, typedOther.notebookGuid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEmail()) { lastComparison = TBaseHelper.compareTo(this.email, typedOther.email);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNotebookModifiable()).compareTo(typedOther.isSetNotebookModifiable());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNotebookModifiable()) { lastComparison = TBaseHelper.compareTo(this.notebookModifiable, typedOther.notebookModifiable);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRequireLogin()).compareTo(typedOther.isSetRequireLogin());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequireLogin()) { lastComparison = TBaseHelper.compareTo(this.requireLogin, typedOther.requireLogin);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetServiceCreated()).compareTo(typedOther.isSetServiceCreated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceCreated()) { lastComparison = TBaseHelper.compareTo(this.serviceCreated, typedOther.serviceCreated);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetServiceUpdated()).compareTo(typedOther.isSetServiceUpdated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceUpdated()) { lastComparison = TBaseHelper.compareTo(this.serviceUpdated, typedOther.serviceUpdated);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetShareKey()).compareTo(typedOther.isSetShareKey());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetShareKey()) { lastComparison = TBaseHelper.compareTo(this.shareKey, typedOther.shareKey);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) { lastComparison = TBaseHelper.compareTo(this.username, typedOther.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPrivilege()).compareTo(typedOther.isSetPrivilege());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPrivilege()) { lastComparison = TBaseHelper.compareTo(this.privilege, typedOther.privilege);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAllowPreview()).compareTo(typedOther.isSetAllowPreview());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAllowPreview()) { lastComparison = TBaseHelper.compareTo(this.allowPreview, typedOther.allowPreview);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRecipientSettings()).compareTo(typedOther.isSetRecipientSettings());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRecipientSettings()) { lastComparison = TBaseHelper.compareTo(this.recipientSettings, typedOther.recipientSettings);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
case 1: // ID
if (field.type == TType.I64) {
this.id = iprot.readI64();
setIdIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // USER_ID
if (field.type == TType.I32) {
this.userId = iprot.readI32();
setUserIdIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // NOTEBOOK_GUID
if (field.type == TType.STRING) {
this.notebookGuid = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // EMAIL
if (field.type == TType.STRING) {
this.email = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // NOTEBOOK_MODIFIABLE
if (field.type == TType.BOOL) {
this.notebookModifiable = iprot.readBool();
setNotebookModifiableIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // REQUIRE_LOGIN
if (field.type == TType.BOOL) {
this.requireLogin = iprot.readBool();
setRequireLoginIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // SERVICE_CREATED
if (field.type == TType.I64) {
this.serviceCreated = iprot.readI64();
setServiceCreatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 10: // SERVICE_UPDATED
if (field.type == TType.I64) {
this.serviceUpdated = iprot.readI64();
setServiceUpdatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 8: // SHARE_KEY
if (field.type == TType.STRING) {
this.shareKey = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 9: // USERNAME
if (field.type == TType.STRING) {
this.username = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 11: // PRIVILEGE
if (field.type == TType.I32) {
this.privilege = SharedNotebookPrivilegeLevel.findByValue(iprot.readI32());
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 12: // ALLOW_PREVIEW
if (field.type == TType.BOOL) {
this.allowPreview = iprot.readBool();
setAllowPreviewIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 13: // RECIPIENT_SETTINGS
if (field.type == TType.STRUCT) {
this.recipientSettings = new SharedNotebookRecipientSettings();
this.recipientSettings.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (isSetId()) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeI64(this.id);
oprot.writeFieldEnd();
}
if (isSetUserId()) {
oprot.writeFieldBegin(USER_ID_FIELD_DESC);
oprot.writeI32(this.userId);
oprot.writeFieldEnd();
}
if (this.notebookGuid != null) {
if (isSetNotebookGuid()) {
oprot.writeFieldBegin(NOTEBOOK_GUID_FIELD_DESC);
oprot.writeString(this.notebookGuid);
oprot.writeFieldEnd();
}
}
if (this.email != null) {
if (isSetEmail()) {
oprot.writeFieldBegin(EMAIL_FIELD_DESC);
oprot.writeString(this.email);
oprot.writeFieldEnd();
}
}
if (isSetNotebookModifiable()) {
oprot.writeFieldBegin(NOTEBOOK_MODIFIABLE_FIELD_DESC);
oprot.writeBool(this.notebookModifiable);
oprot.writeFieldEnd();
}
if (isSetRequireLogin()) {
oprot.writeFieldBegin(REQUIRE_LOGIN_FIELD_DESC);
oprot.writeBool(this.requireLogin);
oprot.writeFieldEnd();
}
if (isSetServiceCreated()) {
oprot.writeFieldBegin(SERVICE_CREATED_FIELD_DESC);
oprot.writeI64(this.serviceCreated);
oprot.writeFieldEnd();
}
if (this.shareKey != null) {
if (isSetShareKey()) {
oprot.writeFieldBegin(SHARE_KEY_FIELD_DESC);
oprot.writeString(this.shareKey);
oprot.writeFieldEnd();
}
}
if (this.username != null) {
if (isSetUsername()) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(this.username);
oprot.writeFieldEnd();
}
}
if (isSetServiceUpdated()) {
oprot.writeFieldBegin(SERVICE_UPDATED_FIELD_DESC);
oprot.writeI64(this.serviceUpdated);
oprot.writeFieldEnd();
}
if (this.privilege != null) {
if (isSetPrivilege()) {
oprot.writeFieldBegin(PRIVILEGE_FIELD_DESC);
oprot.writeI32(this.privilege.getValue());
oprot.writeFieldEnd();
}
}
if (isSetAllowPreview()) {
oprot.writeFieldBegin(ALLOW_PREVIEW_FIELD_DESC);
oprot.writeBool(this.allowPreview);
oprot.writeFieldEnd();
}
if (this.recipientSettings != null) {
if (isSetRecipientSettings()) {
oprot.writeFieldBegin(RECIPIENT_SETTINGS_FIELD_DESC);
this.recipientSettings.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("SharedNotebook(");
boolean first = true;
if (isSetId()) {
sb.append("id:");
sb.append(this.id);
first = false;
}
if (isSetUserId()) {
if (!first) sb.append(", ");
sb.append("userId:");
sb.append(this.userId);
first = false;
}
if (isSetNotebookGuid()) {
if (!first) sb.append(", ");
sb.append("notebookGuid:");
if (this.notebookGuid == null) {
sb.append("null");
} else {
sb.append(this.notebookGuid);
}
first = false;
}
if (isSetEmail()) {
if (!first) sb.append(", ");
sb.append("email:");
if (this.email == null) {
sb.append("null");
} else {
sb.append(this.email);
}
first = false;
}
if (isSetNotebookModifiable()) {
if (!first) sb.append(", ");
sb.append("notebookModifiable:");
sb.append(this.notebookModifiable);
first = false;
}
if (isSetRequireLogin()) {
if (!first) sb.append(", ");
sb.append("requireLogin:");
sb.append(this.requireLogin);
first = false;
}
if (isSetServiceCreated()) {
if (!first) sb.append(", ");
sb.append("serviceCreated:");
sb.append(this.serviceCreated);
first = false;
}
if (isSetServiceUpdated()) {
if (!first) sb.append(", ");
sb.append("serviceUpdated:");
sb.append(this.serviceUpdated);
first = false;
}
if (isSetShareKey()) {
if (!first) sb.append(", ");
sb.append("shareKey:");
if (this.shareKey == null) {
sb.append("null");
} else {
sb.append(this.shareKey);
}
first = false;
}
if (isSetUsername()) {
if (!first) sb.append(", ");
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
}
if (isSetPrivilege()) {
if (!first) sb.append(", ");
sb.append("privilege:");
if (this.privilege == null) {
sb.append("null");
} else {
sb.append(this.privilege);
}
first = false;
}
if (isSetAllowPreview()) {
if (!first) sb.append(", ");
sb.append("allowPreview:");
sb.append(this.allowPreview);
first = false;
}
if (isSetRecipientSettings()) {
if (!first) sb.append(", ");
sb.append("recipientSettings:");
if (this.recipientSettings == null) {
sb.append("null");
} else {
sb.append(this.recipientSettings);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}