LibraryInventory

Game library inventories are used to audit the games in the Library. You must have either the catalog or checkouts LibraryPrivilege to access a Library Inventory.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in LibraryInventoryProperties.

Related Objects

See "Related Objects" in Introduction for how to use them.

library

The Library that this inventory is for.

Relationships

See "Relationships" in Introduction for how to use them.

games

The LibraryGames associated with (counted in) the inventory. See LibraryGame for available search options.

items

The LibraryInventoryItems associated with the inventory.

libraryinventoryitems

The LibraryInventoryItems associated with the inventory. Deprecated, use items instead.

Includes

See "Includes" in Introduction for how to use them.

games_added_since_start

Count of games added to the Library since the start of the Library Inventory.

games_in_library

Count of all games in the Library.

games_missing

Number of games not counted in the Inventory. Just the games_in_library count minus the games_counted.

Services

The services used to fetch and manipulate library inventories.

Search Library Inventories

Searching all library inventories across libraries is not supported. To search on a single library see "Relationships" in Library.

Read Library Inventory

 GET /api/libraryinventory/xxx

Returns:

 {
   "id" : "xxx",
   "date_created" : "2019-01-27 12:15:00",
   ...
 }

Create Library Inventory

 POST /api/libraryinventory
Optional Params
name

A name for the Inventory. To allow easier reference (than reading the date_created) if the user might have multiple Inventories existing at one time.

Returns the same as a normal read.

Update Library Inventory

 PUT /api/libraryinventory/xxx

Returns the same as a normal read.

Only used for updating an Inventory's name. See Services below for specific endpoints for updating an Inventory's status.

Delete Library Inventory

 DELETE /api/libraryinventory/xxx

Deletes all related LibraryInventoryItems in addition to the Inventory record.

Returns:

 {
   "success" : 1
 }

Activate Inventory

 PUT /api/libraryinventory/xxx/activate

Changes the Inventory's status to "active". Fails if there is already an active Inventory for the Library.

Returns the same as a normal read.

Close Inventory

 PUT /api/libraryinventory/xxx/close

Changes the Inventory's status to "closed". Games cannot be counted in the Inventory if it is closed.

Returns the same as a normal read.

Games Missing from Inventory

 GET /api/libraryinventory/xxx/missing-games

The following endpoint is deprecated, use the above.

 GET /api/libraryinventory/xxx/missing_games

The LibraryGames which are not counted in the Inventory.

Returns:

 {
   "paging" : {...},
   "items" : [
       {
         "id" : "xxx",
         "name" : "Why Didn't You Count Me??",
         ...
       },
       ...
   ]
 }

Add Item to Inventory

 POST /api/libraryinventory/xxx/item
Required Params
game_id

The ID of the LibraryGame being counted for the Inventory.

Returns added LibraryInventoryItem:

 {
   "id" : "xxx",
   "libraryinventory_id" : "xxx",
   "librarygame_id" : "xxx",
   ...
 }

Remove Item from Inventory

 DELETE /api/libraryinventory/xxx/item/:item_id
Required Params
item_id

The ID of the LibraryInventoryItem to delete.

Returns:

 {
   "success" : 1
 }