/**
 *  Copyright 2013 Ionică Bizău
 *
 *  A Node.JS module, which provides an object oriented wrapper for the Youtube v3 API.
 *  Author: Ionică Bizău <bizauionica@gmail.com>
 *
 **/

var Util = require("../../util");

function list (options, callback) {
    var self = this;

    var url = Util.createUrl.apply(self, ["subscriptions", options]);
    var reqOptions = {
        url: url,
    };

    self.Client.request(reqOptions, callback);
}

function insert (options, callback) {
    callback(null, {"error": "Not yet implemented"});
}

function deleteItem (options, callback) {
    callback(null, {"error": "Not yet implemented"});
}

module.exports = {
    list: list,
    insert: insert,
    delete: deleteItem
};

@@ -482,59 +482,459 @@
 ) %7B%0A
+%0A
     
-callback(null, %7B%22error%22: %22Not yet implemented%22%7D
+// get self%0A    var self = this%0A%0A        // create the request url%0A      , url = Util.createUrl.apply(self, %5B%22subscriptions%22, %7B%0A            part:   options.part,%0A            fields: options.fields%0A        %7D%5D)%0A%0A        // create the request options%0A      , reqOptions = %7B%0A           uri: url,%0A           method: %22POST%22,%0A           json: options.requestBody%0A       %7D;%0A%0A    // submit request and callback%0A    self.Client.request(reqOptions, callback
 );%0A%7D
@@ -981,59 +981,383 @@
 ) %7B%0A
+%0A
     
-callback(null, %7B%22error%22: %22Not yet implemented%22%7D
+// get self%0A    var self = this%0A%0A        // create the request url%0A      , url = Util.createUrl.apply(self, %5B%22subscriptions%22, %7B%0A            id:   options.id%0A        %7D%5D)%0A%0A        // create the request options%0A      , reqOptions = %7B%0A           uri: url,%0A           method: %22DELETE%22%0A       %7D;%0A%0A    // submit request and callback%0A    self.Client.request(reqOptions, callback
 );%0A%7D

Support DELETE and PUT requests in subscriptions. (Related to #6)