public MappedObject(string name, string remoteId, MappedObjectType type, string parentId, string changeToken, long contentSize = -1, bool readOnly = false) {
if (string.IsNullOrEmpty(name)) {
throw new ArgumentNullException("name", "Given name is null or empty");
}
if (string.IsNullOrEmpty(remoteId)) {
throw new ArgumentNullException("remoteId");
}
if (type == MappedObjectType.Unkown) {
throw new ArgumentException("Given type is unknown but must be set to a known type", "type");
} else {
this.Type = type;
}
this.Name = name;
this.RemoteObjectId = remoteId;
this.ParentId = parentId;
this.LastChangeToken = changeToken;
this.LastContentSize = contentSize;
this.ActualOperation = OperationType.No;
this.Retries = new Dictionary<OperationType, int>();
this.IsReadOnly = readOnly;
}