var utils = require('../utils/httpUtils.js');
var _ = require('underscore');
var constants = require('../utils/constants.js');

exports.create = function(options) {
  var optionsToSend = {
    accessToken : options.accessToken
  };

  var getComment = function(getOptions, callback) {
    optionsToSend.url = buildUrl(getOptions);
    return utils.get(_.extend(optionsToSend, getOptions), callback);
  };

  var deleteComment = function(getOptions, callback) {
    optionsToSend.url = buildUrl(getOptions);
    return utils.delete(_.extend(optionsToSend, getOptions), callback);
  };

  var addCommentAttachment = function(getOptions, callback) {
    optionsToSend.url = buildUrl(getOptions) + '/attachments';
    return utils.post(_.extend(optionsToSend, getOptions), callback);
  };

  var editComment = function(putOptions, callback) {
    optionsToSend.url = buildUrl(putOptions);
    return utils.put(_.extend(optionsToSend, putOptions), callback);
  };

  var buildUrl = function(urlOptions) {
    return options.apiUrls.sheets + urlOptions.sheetId + '/comments/' + (urlOptions.commentId || '');
  };

  return {
    getComment : getComment,
    deleteComment : deleteComment,
    addCommentAttachment : addCommentAttachment,
    editComment : editComment
  };
};

@@ -586,32 +586,35 @@
   var addComment
+Url
 Attachment = fun
@@ -772,32 +772,243 @@
  callback);%0A  %7D;
+%0A  %0A  var addCommentFileAttachment = function(getOptions, callback) %7B%0A    optionsToSend.url = buildUrl(getOptions) + '/attachments';%0A    return utils.postFile(_.extend(optionsToSend, getOptions), callback);%0A  %7D;
 %0A%0A  var editComm
@@ -1396,32 +1396,35 @@
 ,%0A    addComment
+Url
 Attachment : add
@@ -1430,16 +1430,76 @@
 dComment
+UrlAttachment,%0A    addCommentFileAttachment : addCommentFile
 Attachme

Split URL and File comment attachment endpoints.