// Generated by IcedCoffeeScript 1.8.0-d
(function() {
  var Auth, Base, constants,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Base = require('./base').Base;

  constants = require('./constants').constants;

  exports.Auth = Auth = (function(_super) {
    __extends(Auth, _super);

    function Auth(obj) {
      this.nonce = obj.nonce;
      this.session = obj.session;
      Auth.__super__.constructor.call(this, obj);
    }

    Auth.prototype._type = function() {
      return constants.sig_types.auth;
    };

    Auth.prototype._required_sections = function() {
      return Auth.__super__._required_sections.call(this).concat(["auth"]);
    };

    Auth.prototype._v_customize_json = function(ret) {
      ret.body.auth = {};
      ret.body.auth.nonce = this.nonce ? this.nonce.toString('hex') : null;
      if (this.session != null) {
        return ret.body.auth.session = this.session;
      }
    };

    Auth.prototype._json = function() {
      return Auth.__super__._json.call(this, {
        expire_in: 24 * 60 * 60
      });
    };

    return Auth;

  })(Base);

}).call(this);
