com.evernote.edam.notestore.NoteEmailParameters 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.notestore;
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.*;
/**
* Parameters that must be given to the NoteStore emailNote call. These allow
* the caller to specify the note to send, the recipient addresses, etc.
*
*
* - guid
* -
* If set, this must be the GUID of a note within the user's account that
* should be retrieved from the service and sent as email. If not set,
* the 'note' field must be provided instead.
*
*
* - note
* -
* If the 'guid' field is not set, this field must be provided, including
* the full contents of the note note (and all of its Resources) to send.
* This can be used for a Note that as not been created in the service,
* for example by a local client with local notes.
*
*
* - toAddresses
* -
* If provided, this should contain a list of the SMTP email addresses
* that should be included in the "To:" line of the email.
* Callers must specify at least one "to" or "cc" email address.
*
*
* - ccAddresses
* -
* If provided, this should contain a list of the SMTP email addresses
* that should be included in the "Cc:" line of the email.
* Callers must specify at least one "to" or "cc" email address.
*
*
* - subject
* -
* If provided, this should contain the subject line of the email that
* will be sent. If not provided, the title of the note will be used
* as the subject of the email.
*
*
* - message
* -
* If provided, this is additional personal text that should be included
* into the email as a message from the owner to the recipient(s).
*
*
*/
public class NoteEmailParameters implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("NoteEmailParameters");
private static final TField GUID_FIELD_DESC = new TField("guid", TType.STRING, (short)1);
private static final TField NOTE_FIELD_DESC = new TField("note", TType.STRUCT, (short)2);
private static final TField TO_ADDRESSES_FIELD_DESC = new TField("toAddresses", TType.LIST, (short)3);
private static final TField CC_ADDRESSES_FIELD_DESC = new TField("ccAddresses", TType.LIST, (short)4);
private static final TField SUBJECT_FIELD_DESC = new TField("subject", TType.STRING, (short)5);
private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)6);
private String guid;
private com.evernote.edam.type.Note note;
private List toAddresses;
private List ccAddresses;
private String subject;
private String message;
// isset id assignments
public NoteEmailParameters() {
}
/**
* Performs a deep copy on other.
*/
public NoteEmailParameters(NoteEmailParameters other) {
if (other.isSetGuid()) {
this.guid = other.guid;
}
if (other.isSetNote()) {
this.note = new com.evernote.edam.type.Note(other.note);
}
if (other.isSetToAddresses()) {
List __this__toAddresses = new ArrayList();
for (String other_element : other.toAddresses) {
__this__toAddresses.add(other_element);
}
this.toAddresses = __this__toAddresses;
}
if (other.isSetCcAddresses()) {
List __this__ccAddresses = new ArrayList();
for (String other_element : other.ccAddresses) {
__this__ccAddresses.add(other_element);
}
this.ccAddresses = __this__ccAddresses;
}
if (other.isSetSubject()) {
this.subject = other.subject;
}
if (other.isSetMessage()) {
this.message = other.message;
}
}
public NoteEmailParameters deepCopy() {
return new NoteEmailParameters(this);
}
public void clear() {
this.guid = null;
this.note = null;
this.toAddresses = null;
this.ccAddresses = null;
this.subject = null;
this.message = null;
}
public String getGuid() {
return this.guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public void unsetGuid() {
this.guid = null;
}
/** Returns true if field guid is set (has been asigned a value) and false otherwise */
public boolean isSetGuid() {
return this.guid != null;
}
public void setGuidIsSet(boolean value) {
if (!value) {
this.guid = null;
}
}
public com.evernote.edam.type.Note getNote() {
return this.note;
}
public void setNote(com.evernote.edam.type.Note note) {
this.note = note;
}
public void unsetNote() {
this.note = null;
}
/** Returns true if field note is set (has been asigned a value) and false otherwise */
public boolean isSetNote() {
return this.note != null;
}
public void setNoteIsSet(boolean value) {
if (!value) {
this.note = null;
}
}
public int getToAddressesSize() {
return (this.toAddresses == null) ? 0 : this.toAddresses.size();
}
public java.util.Iterator getToAddressesIterator() {
return (this.toAddresses == null) ? null : this.toAddresses.iterator();
}
public void addToToAddresses(String elem) {
if (this.toAddresses == null) {
this.toAddresses = new ArrayList();
}
this.toAddresses.add(elem);
}
public List getToAddresses() {
return this.toAddresses;
}
public void setToAddresses(List toAddresses) {
this.toAddresses = toAddresses;
}
public void unsetToAddresses() {
this.toAddresses = null;
}
/** Returns true if field toAddresses is set (has been asigned a value) and false otherwise */
public boolean isSetToAddresses() {
return this.toAddresses != null;
}
public void setToAddressesIsSet(boolean value) {
if (!value) {
this.toAddresses = null;
}
}
public int getCcAddressesSize() {
return (this.ccAddresses == null) ? 0 : this.ccAddresses.size();
}
public java.util.Iterator getCcAddressesIterator() {
return (this.ccAddresses == null) ? null : this.ccAddresses.iterator();
}
public void addToCcAddresses(String elem) {
if (this.ccAddresses == null) {
this.ccAddresses = new ArrayList();
}
this.ccAddresses.add(elem);
}
public List getCcAddresses() {
return this.ccAddresses;
}
public void setCcAddresses(List ccAddresses) {
this.ccAddresses = ccAddresses;
}
public void unsetCcAddresses() {
this.ccAddresses = null;
}
/** Returns true if field ccAddresses is set (has been asigned a value) and false otherwise */
public boolean isSetCcAddresses() {
return this.ccAddresses != null;
}
public void setCcAddressesIsSet(boolean value) {
if (!value) {
this.ccAddresses = null;
}
}
public String getSubject() {
return this.subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public void unsetSubject() {
this.subject = null;
}
/** Returns true if field subject is set (has been asigned a value) and false otherwise */
public boolean isSetSubject() {
return this.subject != null;
}
public void setSubjectIsSet(boolean value) {
if (!value) {
this.subject = null;
}
}
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
public void unsetMessage() {
this.message = null;
}
/** Returns true if field message is set (has been asigned a value) and false otherwise */
public boolean isSetMessage() {
return this.message != null;
}
public void setMessageIsSet(boolean value) {
if (!value) {
this.message = null;
}
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof NoteEmailParameters)
return this.equals((NoteEmailParameters)that);
return false;
}
public boolean equals(NoteEmailParameters that) {
if (that == null)
return false;
boolean this_present_guid = true && this.isSetGuid();
boolean that_present_guid = true && that.isSetGuid();
if (this_present_guid || that_present_guid) {
if (!(this_present_guid && that_present_guid))
return false;
if (!this.guid.equals(that.guid))
return false;
}
boolean this_present_note = true && this.isSetNote();
boolean that_present_note = true && that.isSetNote();
if (this_present_note || that_present_note) {
if (!(this_present_note && that_present_note))
return false;
if (!this.note.equals(that.note))
return false;
}
boolean this_present_toAddresses = true && this.isSetToAddresses();
boolean that_present_toAddresses = true && that.isSetToAddresses();
if (this_present_toAddresses || that_present_toAddresses) {
if (!(this_present_toAddresses && that_present_toAddresses))
return false;
if (!this.toAddresses.equals(that.toAddresses))
return false;
}
boolean this_present_ccAddresses = true && this.isSetCcAddresses();
boolean that_present_ccAddresses = true && that.isSetCcAddresses();
if (this_present_ccAddresses || that_present_ccAddresses) {
if (!(this_present_ccAddresses && that_present_ccAddresses))
return false;
if (!this.ccAddresses.equals(that.ccAddresses))
return false;
}
boolean this_present_subject = true && this.isSetSubject();
boolean that_present_subject = true && that.isSetSubject();
if (this_present_subject || that_present_subject) {
if (!(this_present_subject && that_present_subject))
return false;
if (!this.subject.equals(that.subject))
return false;
}
boolean this_present_message = true && this.isSetMessage();
boolean that_present_message = true && that.isSetMessage();
if (this_present_message || that_present_message) {
if (!(this_present_message && that_present_message))
return false;
if (!this.message.equals(that.message))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(NoteEmailParameters other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
NoteEmailParameters typedOther = (NoteEmailParameters)other;
lastComparison = Boolean.valueOf(isSetGuid()).compareTo(typedOther.isSetGuid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGuid()) { lastComparison = TBaseHelper.compareTo(this.guid, typedOther.guid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNote()).compareTo(typedOther.isSetNote());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNote()) { lastComparison = TBaseHelper.compareTo(this.note, typedOther.note);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetToAddresses()).compareTo(typedOther.isSetToAddresses());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetToAddresses()) { lastComparison = TBaseHelper.compareTo(this.toAddresses, typedOther.toAddresses);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCcAddresses()).compareTo(typedOther.isSetCcAddresses());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCcAddresses()) { lastComparison = TBaseHelper.compareTo(this.ccAddresses, typedOther.ccAddresses);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSubject()).compareTo(typedOther.isSetSubject());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSubject()) { lastComparison = TBaseHelper.compareTo(this.subject, typedOther.subject);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMessage()) { lastComparison = TBaseHelper.compareTo(this.message, typedOther.message);
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: // GUID
if (field.type == TType.STRING) {
this.guid = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NOTE
if (field.type == TType.STRUCT) {
this.note = new com.evernote.edam.type.Note();
this.note.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // TO_ADDRESSES
if (field.type == TType.LIST) {
{
TList _list86 = iprot.readListBegin();
this.toAddresses = new ArrayList(_list86.size);
for (int _i87 = 0; _i87 < _list86.size; ++_i87)
{
String _elem88;
_elem88 = iprot.readString();
this.toAddresses.add(_elem88);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // CC_ADDRESSES
if (field.type == TType.LIST) {
{
TList _list89 = iprot.readListBegin();
this.ccAddresses = new ArrayList(_list89.size);
for (int _i90 = 0; _i90 < _list89.size; ++_i90)
{
String _elem91;
_elem91 = iprot.readString();
this.ccAddresses.add(_elem91);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // SUBJECT
if (field.type == TType.STRING) {
this.subject = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // MESSAGE
if (field.type == TType.STRING) {
this.message = iprot.readString();
} 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 (this.guid != null) {
if (isSetGuid()) {
oprot.writeFieldBegin(GUID_FIELD_DESC);
oprot.writeString(this.guid);
oprot.writeFieldEnd();
}
}
if (this.note != null) {
if (isSetNote()) {
oprot.writeFieldBegin(NOTE_FIELD_DESC);
this.note.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.toAddresses != null) {
if (isSetToAddresses()) {
oprot.writeFieldBegin(TO_ADDRESSES_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.toAddresses.size()));
for (String _iter92 : this.toAddresses)
{
oprot.writeString(_iter92);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.ccAddresses != null) {
if (isSetCcAddresses()) {
oprot.writeFieldBegin(CC_ADDRESSES_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.ccAddresses.size()));
for (String _iter93 : this.ccAddresses)
{
oprot.writeString(_iter93);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.subject != null) {
if (isSetSubject()) {
oprot.writeFieldBegin(SUBJECT_FIELD_DESC);
oprot.writeString(this.subject);
oprot.writeFieldEnd();
}
}
if (this.message != null) {
if (isSetMessage()) {
oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
oprot.writeString(this.message);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("NoteEmailParameters(");
boolean first = true;
if (isSetGuid()) {
sb.append("guid:");
if (this.guid == null) {
sb.append("null");
} else {
sb.append(this.guid);
}
first = false;
}
if (isSetNote()) {
if (!first) sb.append(", ");
sb.append("note:");
if (this.note == null) {
sb.append("null");
} else {
sb.append(this.note);
}
first = false;
}
if (isSetToAddresses()) {
if (!first) sb.append(", ");
sb.append("toAddresses:");
if (this.toAddresses == null) {
sb.append("null");
} else {
sb.append(this.toAddresses);
}
first = false;
}
if (isSetCcAddresses()) {
if (!first) sb.append(", ");
sb.append("ccAddresses:");
if (this.ccAddresses == null) {
sb.append("null");
} else {
sb.append(this.ccAddresses);
}
first = false;
}
if (isSetSubject()) {
if (!first) sb.append(", ");
sb.append("subject:");
if (this.subject == null) {
sb.append("null");
} else {
sb.append(this.subject);
}
first = false;
}
if (isSetMessage()) {
if (!first) sb.append(", ");
sb.append("message:");
if (this.message == null) {
sb.append("null");
} else {
sb.append(this.message);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}