var DEFAULT_VERSION = '1.1';

var sparse = 'Can be sparse, but must be identifiable.';
var matchtype = 'Each object will match the object type passed in.';

var downloadprompt = 'in a way designed to make the browser prompt the user with the file download dialog box.<br>Response will be a normal HTTP response with the following HTTP headers:';
var contlength = '<LI><code>Content-Length:</code>size of the file or range of the bytes to download';
var accept = '<LI><code>Accept-Ranges:bytes</code>';
var range = '<LI><code>Content-Range:</code>download range (start-end/total size) only if a range was provided';
var nojson = 'No JSON is returned, only data.';
var multipartdownloads = ' If <code>onlydata</code> is false, a JSON message will be returned along with the data (multipart message).<br><br>In this version we support multipart requests, so multiple files can be downloaded in one POST request.';
var extensions = '<br>File extensions that will be thumbnailed are:<UL><LI>Photo: <code>jpg gif jpeg tiff png psd bmp ico</code><LI>Video: <code>avi qt dv mov mpeg mp4 3gp 3g2 3gp2 asf wmv flv mpg divx</code></UL>';
var exceptionsParameter = new ParameterObject('exceptions', '[ExceptionObject]', 'ExceptionObject', 'Any exceptions, if any occurred.', false);
var assetcentric = '<br><br>Asset-Centric Methods handle generic methods that are applicable to many types of Data Transfer Objects. These methods are not "typed", they can take different types of inputs and return different types of outputs.';
var thumbwait = 'If the file was just uploaded in the last 30 seconds, and the thumbnail hasn\'t been generated yet, this method waits for 2 seconds and tries again. It will try a maximum of 5 times (10 seconds) before it gives up.';

function MethodObject(name, description, example, inputList, outputList, accessMethodList, since, methodOptions) {
  this.name = name;
  this.description = description;
  this.example = example;
  this.inputList = inputList;
  this.outputList = outputList;
  this.accessMethodList = accessMethodList == null ? getDefaultAccessMethodList() : accessMethodList;
  this.since = since == null ? DEFAULT_VERSION : since;
  this.methodOptions = methodOptions;
}

function ParameterObject(name, type, ref, description, required, updated) {
  this.name = name;
  this.type = type;
  this.ref = ref;
  this.description = description;
  this.required = required != null ? required : true;
  this.updated = updated != null ? ("<br><em>[<span class='update'>Updated:</span> " + updated + ".]</em>") : updated;
}

function OptionObject(name, description, defaults, internal) {
  this.name = name;
  this.description = description;
  this.defaults = defaults == null ? true : defaults;
  this.internal = internal == null ? false : internal;
}

function getDefaultAccessMethodList() {
  var accessMethodList = new Array();
  accessMethodList[0] = 'POST';
  accessMethodList[1] = 'GET';
  return accessMethodList;
}


