ews javascript api

ResponseObject

declaration
 ResponseObject 

Represents the base class for all responses that can be sent.

var ResponseObject = (function (_super) {
    __extends(ResponseObject, _super);

ResponseObject

function
 ResponseObject() 

Option name Type Description
referenceItem type

The reference item.

Initializes a new instance of the class.

function ResponseObject(referenceItem) {
    _super.call(this, referenceItem.Service);
    this.referenceItem = null;
    EwsLogging_1.EwsLogging.Assert(referenceItem !== null, "ResponseObject.ctor", "referenceItem is null");
    referenceItem.ThrowIfThisIsNew();
    this.referenceItem = referenceItem;
}
Object.defineProperty(ResponseObject.prototype, "IsReadReceiptRequested", {

get

method
 get() 

Gets or sets a value indicating whether read receipts will be requested from recipients of this response.

get: function () {
    return this.PropertyBag._getItem(EmailMessageSchema_1.EmailMessageSchema.IsReadReceiptRequested);
},
set: function (value) {
    this.PropertyBag._setItem(EmailMessageSchema_1.EmailMessageSchema.IsReadReceiptRequested, value);
},
enumerable: true,
configurable: true
    });
    Object.defineProperty(ResponseObject.prototype, "IsDeliveryReceiptRequested", {

get

method
 get() 

Gets or sets a value indicating whether delivery receipts should be sent to the sender.

get: function () {
    return this.PropertyBag._getItem(EmailMessageSchema_1.EmailMessageSchema.IsDeliveryReceiptRequested);
},
set: function (value) {
    this.PropertyBag._setItem(EmailMessageSchema_1.EmailMessageSchema.IsDeliveryReceiptRequested, value);
},
enumerable: true,
configurable: true
    });

GetSchema

method
 ResponseObject.prototype.GetSchema() 

Internal method to return the schema associated with this type of object.

ResponseObject.prototype.GetSchema = function () { return ResponseObjectSchema_1.ResponseObjectSchema.Instance; };

InternalCreate

method
 ResponseObject.prototype.InternalCreate() 

Option name Type Description
destinationFolderId FolderId

The destination folder id.

messageDisposition MessageDisposition

The message disposition.

return IPromise.<Array.<Item>>

The list of items returned by EWS.

Create the response object.

ResponseObject.prototype.InternalCreate = function (destinationFolderId, messageDisposition) {
    this.PropertyBag._getItem(ResponseObjectSchema_1.ResponseObjectSchema.ReferenceItemId).Assign(this.referenceItem.Id);
    return this.Service.InternalCreateResponseObject(this, destinationFolderId, messageDisposition);
};

InternalDelete

method
 ResponseObject.prototype.InternalDelete() 

Option name Type Description
deleteMode DeleteMode

The deletion mode.

sendCancellationsMode SendCancellationsMode

Indicates whether meeting cancellation messages should be sent.

affectedTaskOccurrences affectedTaskOccurrences

Indicate which occurrence of a recurring task should be deleted.

Deletes the object.

ResponseObject.prototype.InternalDelete = function (deleteMode, sendCancellationsMode, affectedTaskOccurrences) { throw new Error("ResponseObject.ts - InternalDelete : Not Supported Exception."); }; //throw new NotSupportedException();

InternalLoad

method
 ResponseObject.prototype.InternalLoad() 

Option name Type Description
propertySet PropertySet

The properties to load.

Loads the specified set of properties on the object.

ResponseObject.prototype.InternalLoad = function (propertySet) { throw new Error("ResponseObject.ts - InternalLoad : Not Supported Exception."); }; //throw new NotSupportedException();
ResponseObject.prototype.Save = function (destinationFolderIdOrName) {
    var destinationFolderId = null;
    if (arguments.length === 1) {
        if (typeof destinationFolderIdOrName === "number") {
            destinationFolderId = new FolderId_1.FolderId(destinationFolderIdOrName);
        }
        else {
            //EwsUtilities.ValidateParam(destinationFolderIdOrName, "destinationFolderId");
            destinationFolderId = destinationFolderIdOrName;
        }
    }
    return this.InternalCreate(destinationFolderId, MessageDisposition_1.MessageDisposition.SaveOnly).then(function (result) {
        return result[0];
    });
};

Send

method
 ResponseObject.prototype.Send() 

Sends this response without saving a copy. Calling this method results in a call to EWS.

ResponseObject.prototype.Send = function () { return this.InternalCreate(null, MessageDisposition_1.MessageDisposition.SendOnly); };
ResponseObject.prototype.SendAndSaveCopy = function (destinationFolderIdOrName) {
    var destinationFolderId = null;
    if (arguments.length === 1) {
        if (typeof destinationFolderIdOrName === "number") {
            destinationFolderId = new FolderId_1.FolderId(destinationFolderIdOrName);
        }
        else {
            //EwsUtilities.ValidateParam(destinationFolderIdOrName, "destinationFolderId");
            destinationFolderId = destinationFolderIdOrName;
        }
    }
    return this.InternalCreate(destinationFolderId, MessageDisposition_1.MessageDisposition.SendAndSaveCopy);
};
return ResponseObject;
})(ServiceObject_1.ServiceObject);
exports.ResponseObject = ResponseObject;