Class: Usages

Usages()

A Usages collection is a collection of Usage Models which track objects that use a portion of a Quota. Each Quota is associated with one or more Usage models, so this collection keeps all those associated Usages together in one collection. This collection also stores a reference to the Quota model associated with these Usages.

Constructor

new Usages()

Since:
  • 2.14.0
Source:

Extends

  • Backbone.Collection

Members

model :Backbone.Model

The class/model that is contained in this collection.
Type:
  • Backbone.Model
Source:

queryParams :Array.<string>

A list of query parameters that are supported by the Bookkeeper Usages API. These query parameters can be passed to Usages#fetch in the `options` object, and they will be used during the fetch.
Type:
  • Array.<string>
Source:

quota :Quota

A reference to a Quota model that this collection of Usages is associated with.
Type:
Source:

Methods

fetch(optionsopt)

Fetches a list of Usages from the DataONE Bookkeeper service, parses them, and stores them on this collection.
Parameters:
Name Type Attributes Description
options Object <optional>
Properties:
Name Type Description
options.quotaType string The Usage quotaType to fetch
options.subscriber string The user or group subject associated with these Usages
Source:

mergeCollections()

Merges another collection of models with this collection by matching instanceId to seriesId/id. A reference to the model from the otherCollection is stored in the corresponding Usage model.
Source:

parse() → {JSON}

Parses the fetch() of this collection. Bookkeeper returns JSON already, so there isn't much parsing to do.
Source:
Returns:
The collection data in JSON form
Type
JSON

url(optionsopt) → {string}

Constructs a URL string for fetching this collection and returns it
Parameters:
Name Type Attributes Description
options Object <optional>
Properties:
Name Type Description
options.quotaType string The Usage quotaType to fetch
options.subscriber string The user or group subject associated with these Usages
Source:
Returns:
The URL string
Type
string