Class: Collection

Classes_API~Collection(collectionMetadata, alliances, users)

Represents a PSS Fleet Data Collection. This is a snapshot of top 100 fleets and their members and top 100 players not in a fleet taken once an hour.

Constructor

new Collection(collectionMetadata, alliances, users)

constructor - Creates an instance of Collection based on the given data.

Parameters:
Name Type Description
collectionMetadata CollectionMetadata

The metadata of the Collection.

alliances Array.<PssAlliance>

The PssAlliances (fleets) recorded in this Collection. May be empty.

users Array.<PssUser>

The PssUsers (players) recorded in this Collection. May be empty.

Source:

Members

alliances :Array.<PssAlliance>

alliances - The PssAlliances (fleets) recorded in this Collection. Might be empty.

Type:
  • Array.<PssAlliance>
Source:

metadata :CollectionMetadata

metadata - The metadata of the Collection.

Type:
  • CollectionMetadata
Source:

users :Array.<PssUser>

users - The PssUsers (players) recorded in this Collection. Might be empty.

Type:
  • Array.<PssUser>
Source:

Methods

(static) fromJson(json)

Creates an instance of CollectionMetadata from an object parsed from the JSON returned by the PSS Fleet Data API.

Parameters:
Name Type Description
json object

The metadata of the Collection as parsed from the response of the API.

Properties
Name Type Attributes Description
meta object <optional>

The metadata of the Collection. This key is returned by the API for any of the /collection... endpoints instead of collection.

collection object <optional>

The metadata of the Collection. This key is returned by the API for the /allianceHistory & /userHistory endpoints instead of meta.

fleets Array.<Array>

The PssAlliances (fleets) recorded in this Collection. May be empty. Defaults to an empty array, if not found in the provided JSON.

users Array.<Array>

The PssUsers (players) recorded in this Collection. May be empty. Defaults to an empty array, if not found in the provided JSON.

Source:
Returns:

Collection - An new instance of Collection.