io7m | single-page | multi-page | epub | Cardant User Manual 1.0.0-beta0001
8. API Access
Previous
8. API Access
Up
9. Security
Next

# 8.1. Inventory Protocol

- 8.1.1. Versioning
- 8.1.2. Health
- 8.1.3. Version 1.0
  - 8.1.3.1. Encoding
  - 8.1.3.2. Login
  - 8.1.3.3. Commands
  - 8.1.3.4. Transactions
- 8.1.4. Schemas

## 8.1.1. Versioning

1
The Inventory API service exposes one or more versions of the Inventory protocol. The service uses the verdant protocol to advertise which versions of the Inventory protocol are available. Executing a GET request to the root endpoint will yield a verdant message showing which versions of the Inventory protocol are available. The Inventory protocol is assigned the protocol identifier 8ee23158-f8db-317a-a58b-45bd9d702040.
2
As an example, the following shows that the Inventory protocol version 1 is available at /inventory/1/0/:

### 8.1.1.3. Verdant Example

    $ curl https://cardant.example.com:30000/ | hexdump
    0000:0000  00 00 00 01 00 00 00 01  8e e2 31 58 f8 db 31 7a  |..........1X..1z|
    0000:0010  a5 8b 45 bd 9d 70 20 40  00 00 00 01 00 00 00 00  |..E..p @........|
    0000:0020  00 00 00 0f 2f 69 6e 76  65 6e 74 6f 72 79 2f 31  |..../inventory/1|
    0000:0030  2f 30 2f                                          |/0/|

## 8.1.2. Health

1
The Inventory API service exposes a health check endpoint at /health. The endpoint returns a 200 status code and the string OK if the server's most recent internal health checks succeeded. The server returns a 500 status code and string not equal to OK if the server's most recent internal health checks failed. In both cases, the string is returned directly as a text/plain UTF-8 value.

## 8.1.3. Version 1.0

## 8.1.3.1. Encoding

1
The version 1 Inventory protocol uses cedarbridge encoded messages over HTTP(s).

## 8.1.3.2. Login

1
Send an CAI1CommandLogin command to /inventory/1/0/login. If the login succeeds, a cookie named CARDANT_INVENTORY_SESSION will be set. This cookie must be included with all subsequent requests.

## 8.1.3.3. Commands

1
After logging in successfully, send commands of type CAI1Command* to /inventory/1/0/command. Failed commands will yield a value of type CAI1ResponseError, whilst successful results will yield values of type CAI1Response*.

## 8.1.3.4. Transactions

1
It can sometimes be desirable to send sets of commands that must execute atomically; if a single command in the set fails, it must be as if none of the commands were executed.
2
After logging in successfully, a sequence of commands of type CAI1Command* can be sent to /inventory/1/0/transaction. Each command must be prefixed with its serialized length as a 32-bit unsigned big-endian integer, and the sequence of commands must be terminated with a 32-bit unsigned big-endian value of zero.
3
The response from the /inventory/1/0 /transaction endpoint will be formatted in the same manner, where each element in the sequence is a value of type CAI1Response for the corresponding command in the original sequence. If any of the values in the sequence are CAI1ResponseError values, the transaction was rolled back by the server and not committed.

## 8.1.4. Schemas

### 8.1.4.1. Schemas

    ;
    ; Copyright © 2023 Mark Raynsford <code@io7m.com> https://www.io7m.com
    ;
    ; Permission to use, copy, modify, and/or distribute this software for any
    ; purpose with or without fee is hereby granted, provided that the above
    ; copyright notice and this permission notice appear in all copies.
    ;
    ; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    ; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    ; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
    ; SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    ; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
    ; IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    ;

    [language cedarbridge 1 0]

    [package com.io7m.cardant.protocol.inventory.cb]

    [import com.io7m.cedarbridge cb]
    [import com.io7m.cedarbridge.time ct]

    [variant CAI1ComparisonExact
      [parameter T]
      [case Anything]
      [case IsEqualTo    [field value T]]
      [case IsNotEqualTo [field value T]]
    ]

    [variant CAI1ComparisonFuzzy
      [parameter T]
      [case Anything]
      [case IsEqualTo      [field value T]]
      [case IsNotEqualTo   [field value T]]
      [case IsSimilarTo    [field value T]]
      [case IsNotSimilarTo [field value T]]
    ]

    [variant CAI1ComparisonSet
      [parameter T]
      [case Anything]
      [case IsEqualTo     [field value [cb:List T]]]
      [case IsNotEqualTo  [field value [cb:List T]]]
      [case IsSubsetOf    [field value [cb:List T]]]
      [case IsSupersetOf  [field value [cb:List T]]]
      [case IsOverlapping [field value [cb:List T]]]
    ]

    [documentation CAI1Id "An identifier value."]
    [variant CAI1Id
      [case CAI1FileID           [field id cb:UUID]]
      [case CAI1ItemID           [field id cb:UUID]]
      [case CAI1LocationID       [field id cb:UUID]]
      [case CAI1UserID           [field id cb:UUID]]
      [case CAI1StockInstanceID  [field id cb:UUID]]
    ]

    [documentation CAI1ItemSerial "A serial number."]
    [record CAI1ItemSerial
      [field type  cb:String]
      [field value cb:String]]

    [documentation CAI1IncludeDeleted "Include deleted data in search results."]
    [variant CAI1IncludeDeleted
      [documentation IncludeOnlyLive "Include only live data."]
      [case IncludeOnlyLive]
      [documentation IncludeOnlyDeleted "Include only deleted data."]
      [case IncludeOnlyDeleted]
      [documentation IncludeLiveAndDeleted "Include both live and deleted data."]
      [case IncludeLiveAndDeleted]
    ]

    [documentation CAI1File "A file."]
    [variant CAI1File
      [case CAI1FileWithoutData
        [documentation id "The file ID."]
        [field id cb:UUID]
        [documentation description "The file description."]
        [field description cb:String]
        [documentation mediaType "The media type."]
        [field mediaType cb:String]
        [documentation size "The file size."]
        [field size cb:IntegerUnsigned64]
        [documentation hashAlgorithm "The hash algorithm name."]
        [field hashAlgorithm cb:String]
        [documentation hashValue "The hash value."]
        [field hashValue cb:String]]
      [case CAI1FileWithData
        [documentation id "The file ID."]
        [field id cb:UUID]
        [documentation description "The file description."]
        [field description cb:String]
        [documentation mediaType "The media type."]
        [field mediaType cb:String]
        [documentation size "The file size."]
        [field size cb:IntegerUnsigned64]
        [documentation hashAlgorithm "The hash algorithm name."]
        [field hashAlgorithm cb:String]
        [documentation hashValue "The hash value."]
        [field hashValue cb:String]
        [documentation data "The file data."]
        [field data cb:ByteArray]]
    ]

    [documentation CAI1Metadata "A metadata value."]
    [variant CAI1Metadata
      [case Integral
        [documentation key "The metadata value key."]
        [field key CAI1TypeRecordFieldIdentifier]
        [documentation value "The metadata value."]
        [field value cb:IntegerSigned64]
      ]
      [case Text
        [documentation key "The metadata value key."]
        [field key CAI1TypeRecordFieldIdentifier]
        [documentation value "The metadata value."]
        [field value cb:String]
      ]
      [case Time
        [documentation key "The metadata value key."]
        [field key CAI1TypeRecordFieldIdentifier]
        [documentation value "The metadata value."]
        [field value ct:OffsetDateTime]
      ]
      [case Monetary
        [documentation key "The metadata value key."]
        [field key CAI1TypeRecordFieldIdentifier]
        [documentation value "The metadata value."]
        [field value cb:String]
        [documentation currency "The metadata currency unit."]
        [field currency cb:String]
      ]
      [case Real
        [documentation key "The metadata value key."]
        [field key CAI1TypeRecordFieldIdentifier]
        [documentation value "The metadata value."]
        [field value cb:Float64]
      ]
    ]

    [documentation CAI1AttachmentKey "The values that uniquely identify an attachment on an object."]
    [record CAI1AttachmentKey
      [documentation id "The file ID."]
      [field id cb:UUID]
      [documentation relation "The relation."]
      [field relation cb:String]
    ]

    [documentation CAI1Attachment "An item attachment."]
    [record CAI1Attachment
      [documentation file "The file ID."]
      [field file CAI1File]
      [documentation relation "The relation."]
      [field relation cb:String]
    ]

    [documentation CAI1Item "An item."]
    [record CAI1Item
      [documentation id "The item ID."]
      [field id cb:UUID]
      [documentation name "The item name."]
      [field name cb:String]
      [documentation created "The creation time"]
      [field created ct:OffsetDateTime]
      [documentation updated "The updated time"]
      [field updated ct:OffsetDateTime]
      [documentation metadata "The item metadata."]
      [field metadata [cb:Map CAI1TypeRecordFieldIdentifier CAI1Metadata]]
      [documentation attachments "The item attachments."]
      [field attachments [cb:Map CAI1AttachmentKey CAI1Attachment]]
      [documentation types "The item types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1LocationMatch "The behaviour requested for matching locations."]
    [variant CAI1LocationMatch
      [documentation CAI1LocationExact "Only consider the exact given location."]
      [case CAI1LocationExact
        [field locationId cb:UUID]]
      [documentation CAI1LocationWithDescendants "Consider the given location and all descendants of the given location."]
      [case CAI1LocationWithDescendants
        [field locationId cb:UUID]]
      [documentation CAI1LocationAny "Consider all locations."]
      [case CAI1LocationAny]
    ]

    [documentation CAI1StockReposit "The type of item reposit operations."]
    [variant CAI1StockReposit
      [documentation CAI1StockRepositSetIntroduce "An operation that adds a set of items to a storage location."]
      [case CAI1StockRepositSetIntroduce
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation itemId "The item."]
        [field itemId cb:UUID]
        [documentation locationId "The location ID."]
        [field locationId cb:UUID]
        [documentation count "The count."]
        [field count cb:IntegerUnsigned64]
      ]

      [documentation CAI1StockRepositSetAdd "An operation that adds a set of items to an instance."]
      [case CAI1StockRepositSetAdd
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation count "The count."]
        [field count cb:IntegerUnsigned64]
      ]

      [documentation CAI1StockRepositSetMove "An operation that moves a set of items from one storage location to another."]
      [case CAI1StockRepositSetMove
        [documentation instanceSource "The source instance."]
        [field instanceSource cb:UUID]
        [documentation instanceTarget "The target instance."]
        [field instanceTarget cb:UUID]
        [documentation locationTo "The target location."]
        [field locationTo cb:UUID]
        [documentation count "The count."]
        [field count cb:IntegerUnsigned64]
      ]

      [documentation CAI1StockRepositSetRemove "An operation that removes a set of items from a storage location."]
      [case CAI1StockRepositSetRemove
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation count "The count."]
        [field count cb:IntegerUnsigned64]
      ]

      [documentation CAI1StockRepositSerialIntroduce "An operation that adds a single identified item to a storage location."]
      [case CAI1StockRepositSerialIntroduce
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation itemId "The item."]
        [field itemId cb:UUID]
        [documentation locationId "The location ID."]
        [field locationId cb:UUID]
        [documentation serial "The serial number."]
        [field serial CAI1ItemSerial]
      ]

      [documentation CAI1StockRepositSerialMove "An operation that moves a single identified item between storage locations."]
      [case CAI1StockRepositSerialMove
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation locationTo "The target location."]
        [field locationTo cb:UUID]
      ]

      [documentation CAI1StockRepositSerialRemove "An operation that removes a single identified item."]
      [case CAI1StockRepositSerialRemove
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
      ]

      [documentation CAI1StockRepositSerialNumberAdd "An operation that adds a serial number to an instance."]
      [case CAI1StockRepositSerialNumberAdd
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation serial "The serial number."]
        [field serial CAI1ItemSerial]
      ]

      [documentation CAI1StockRepositSerialNumberRemove "An operation that removes a serial number from an instance."]
      [case CAI1StockRepositSerialNumberRemove
        [documentation instanceId "The instance."]
        [field instanceId cb:UUID]
        [documentation serial "The serial number."]
        [field serial CAI1ItemSerial]
      ]
    ]

    [documentation CAI1LocationSummary "A summary of a location."]
    [record CAI1LocationSummary
      [field id cb:UUID]
      [field parent [cb:Option cb:UUID]]
      [field path [cb:List cb:String]]
      [documentation created "The creation time"]
      [field created ct:OffsetDateTime]
      [documentation updated "The updated time"]
      [field updated ct:OffsetDateTime]
    ]

    [documentation CAI1Location "A location."]
    [record CAI1Location
      [documentation locationId "The location ID."]
      [field locationId cb:UUID]
      [documentation parent "The location parent."]
      [field parent [cb:Option cb:UUID]]
      [documentation path "The location path."]
      [field path [cb:List cb:String]]
      [documentation created "The creation time"]
      [field created ct:OffsetDateTime]
      [documentation updated "The updated time"]
      [field updated ct:OffsetDateTime]
      [documentation metadata "The item metadata."]
      [field metadata [cb:Map CAI1TypeRecordFieldIdentifier CAI1Metadata]]
      [documentation attachments "The item attachments."]
      [field attachments [cb:Map CAI1AttachmentKey CAI1Attachment]]
      [documentation types "The item types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1ItemColumn "The item column by which to order results."]
    [variant CAI1ItemColumn
      [documentation CAI1ById "Order by item ID."]
      [case CAI1ById]
      [documentation CAI1ByName "Order by item name."]
      [case CAI1ByName]
    ]

    [documentation CAI1ItemColumnOrdering "The item column by which to order results."]
    [record CAI1ItemColumnOrdering
      [documentation column "The item column."]
      [field column CAI1ItemColumn]
      [documentation ascending "Whether results should be in ascending order."]
      [field ascending cb:Boolean]
    ]

    [documentation CAI1MetadataValueMatch "An expression against which item metadata values are matched."]
    [variant CAI1MetadataValueMatch
      [case Anything]
      [case IntegralWithinRange
        [field lower cb:IntegerSigned64]
        [field upper cb:IntegerSigned64]
      ]
      [case RealWithinRange
        [field lower cb:Float64]
        [field upper cb:Float64]
      ]
      [case TimeWithinRange
        [field lower ct:OffsetDateTime]
        [field upper ct:OffsetDateTime]
      ]
      [case MonetaryWithinRange
        [field lower cb:String]
        [field upper cb:String]
      ]
      [case MonetaryWithCurrency
        [field currency cb:String]
      ]
      [case TextExact
        [field exact cb:String]
      ]
      [case TextSearch
        [field search cb:String]
      ]
    ]

    [documentation CAI1MetadataElementMatch "An expression against which item metadata is matched."]
    [variant CAI1MetadataElementMatch
      [case And
        [field e0 CAI1MetadataElementMatch]
        [field e1 CAI1MetadataElementMatch]
      ]
      [case Or
        [field e0 CAI1MetadataElementMatch]
        [field e1 CAI1MetadataElementMatch]
      ]
      [case Specific
        [field packageName [CAI1ComparisonExact cb:String]]
        [field typeName [CAI1ComparisonExact cb:String]]
        [field fieldName [CAI1ComparisonExact cb:String]]
        [field value CAI1MetadataValueMatch]
      ]
    ]

    [documentation CAI1ItemSearchParameters "The item search parameters."]
    [record CAI1ItemSearchParameters
      [documentation nameMatch "The item name match expression."]
      [field nameMatch [CAI1ComparisonFuzzy cb:String]]
      [documentation descriptionMatch "The item description match expression."]
      [field descriptionMatch [CAI1ComparisonFuzzy cb:String]]
      [documentation typeMatch "The item type match expression."]
      [field typeMatch [CAI1ComparisonSet CAI1TypeRecordIdentifier]]
      [documentation metaMatch "The item metadata match expression."]
      [field metaMatch CAI1MetadataElementMatch]
      [documentation includeDeleted "Include live/deleted data."]
      [field includeDeleted CAI1IncludeDeleted]
      [documentation order "The item result ordering."]
      [field order CAI1ItemColumnOrdering]
      [documentation limit "The item limit."]
      [field limit cb:IntegerUnsigned32]
    ]

    [documentation CAI1FileColumn "The item column by which to order results."]
    [variant CAI1FileColumn
      [documentation CAI1ById "Order by file ID."]
      [case CAI1ById]
      [documentation CAI1ByDescription "Order by file description."]
      [case CAI1ByDescription]
    ]

    [documentation CAI1FileColumnOrdering "The file column by which to order results."]
    [record CAI1FileColumnOrdering
      [documentation column "The file column."]
      [field column CAI1FileColumn]
      [documentation ascending "Whether results should be in ascending order."]
      [field ascending cb:Boolean]
    ]

    [documentation CAI1SizeRange "A size range."]
    [record CAI1SizeRange
      [documentation sizeMinimum "The lower bound (inclusive)."]
      [field sizeMinimum cb:IntegerUnsigned64]
      [documentation sizeMaximum "The upper bound (inclusive)."]
      [field sizeMaximum cb:IntegerUnsigned64]
    ]

    [documentation CAI1TimeRange "An inclusive time range."]
    [record CAI1TimeRange
      [field timeLower ct:OffsetDateTime]
      [field timeUpper ct:OffsetDateTime]
    ]

    [documentation CAI1FileSearchParameters "The file search parameters."]
    [record CAI1FileSearchParameters
      [documentation search "The file description search query."]
      [field search [CAI1ComparisonFuzzy cb:String]]
      [documentation mediaType "The file media type search query."]
      [field mediaType [CAI1ComparisonFuzzy cb:String]]
      [documentation sizeRange "The file size range query."]
      [field sizeRange CAI1SizeRange]
      [documentation order "The file result ordering."]
      [field order CAI1FileColumnOrdering]
      [documentation limit "The file limit."]
      [field limit cb:IntegerUnsigned32]
    ]

    [documentation CAI1TypeScalarSearchParameters "The scalar type search parameters."]
    [record CAI1TypeScalarSearchParameters
      [documentation nameSearch "The type description search query."]
      [field nameSearch [CAI1ComparisonFuzzy cb:String]]
      [documentation descriptionSearch "The type description search query."]
      [field descriptionSearch [CAI1ComparisonFuzzy cb:String]]
      [documentation limit "The limit."]
      [field limit cb:IntegerUnsigned32]
    ]

    [documentation CAI1Page "A page of search results."]
    [record CAI1Page
      [parameter T]
      [field items [cb:List T]]
      [field pageIndex cb:IntegerUnsigned32]
      [field pageCount cb:IntegerUnsigned32]
      [field pageFirstOffset cb:IntegerUnsigned64]
    ]

    [documentation CAI1ItemSummary "A summary of an item."]
    [record CAI1ItemSummary
      [field id cb:UUID]
      [field name cb:String]
      [documentation created "The creation time"]
      [field created ct:OffsetDateTime]
      [documentation updated "The updated time"]
      [field updated ct:OffsetDateTime]
    ]

    [record CAI1TypeRecordFieldIdentifier
      [field packageName cb:String]
      [field typeName cb:String]
      [field fieldName cb:String]
    ]

    [record CAI1TypeRecordIdentifier
      [field packageName cb:String]
      [field typeName cb:String]
    ]

    [record CAI1TypeScalarIdentifier
      [field packageName cb:String]
      [field typeName cb:String]
    ]

    [documentation CAI1TypeScalar "A scalar type."]
    [variant CAI1TypeScalar
      [case Integral
        [documentation name "The type name."]
        [field name CAI1TypeScalarIdentifier]
        [documentation description "The type description."]
        [field description cb:String]
        [field rangeLower cb:IntegerSigned64]
        [field rangeUpper cb:IntegerSigned64]
      ]
      [case Text
        [documentation name "The type name."]
        [field name CAI1TypeScalarIdentifier]
        [documentation description "The type description."]
        [field description cb:String]
        [field pattern cb:String]
      ]
      [case Time
        [documentation name "The type name."]
        [field name CAI1TypeScalarIdentifier]
        [documentation description "The type description."]
        [field description cb:String]
        [field rangeLower ct:OffsetDateTime]
        [field rangeUpper ct:OffsetDateTime]
      ]
      [case Monetary
        [documentation name "The type name."]
        [field name CAI1TypeScalarIdentifier]
        [documentation description "The type description."]
        [field description cb:String]
        [field rangeLower cb:String]
        [field rangeUpper cb:String]
      ]
      [case Real
        [documentation name "The type name."]
        [field name CAI1TypeScalarIdentifier]
        [documentation description "The type description."]
        [field description cb:String]
        [field rangeLower cb:Float64]
        [field rangeUpper cb:Float64]
      ]
    ]

    [documentation CAI1TypeField "A field within a type declaration."]
    [record CAI1TypeField
      [documentation name "The type field name."]
      [field name CAI1TypeRecordFieldIdentifier]
      [documentation description "The type field description."]
      [field description cb:String]
      [documentation type "The type of the field."]
      [field type CAI1TypeScalar]
      [documentation required "Whether or not the field is required to be present."]
      [field required cb:Boolean]
    ]

    [documentation CAI1TypeRecord "A type declaration."]
    [record CAI1TypeRecord
      [documentation name "The type declaration name."]
      [field name CAI1TypeRecordIdentifier]
      [documentation description "The type declaration description."]
      [field description cb:String]
      [documentation fields "Whether or not the field is required to be present."]
      [field fields [cb:Map CAI1TypeRecordFieldIdentifier CAI1TypeField]]
    ]

    [documentation CAI1TypeRecordSummary "A type declaration summary."]
    [record CAI1TypeRecordSummary
      [documentation name "The type declaration name."]
      [field name CAI1TypeRecordIdentifier]
      [documentation description "The type declaration description."]
      [field description cb:String]
    ]

    [documentation CAI1TypeRecordSearchParameters "The declared type search parameters."]
    [record CAI1TypeRecordSearchParameters
      [documentation nameSearch "The type description search query."]
      [field nameSearch [CAI1ComparisonFuzzy cb:String]]
      [documentation descriptionSearch "The type description search query."]
      [field descriptionSearch [CAI1ComparisonFuzzy cb:String]]
      [documentation limit "The limit."]
      [field limit cb:IntegerUnsigned32]
    ]

    [documentation CAI1AuditSearchParameters "The audit search parameters."]
    [record CAI1AuditSearchParameters
      [documentation owner "Limit to events with the given owner."]
      [field owner [cb:Option cb:UUID]]
      [documentation type "Limit to events with the given type."]
      [field type [CAI1ComparisonExact cb:String]]
      [documentation timeRange "Limit to events in the given time range."]
      [field timeRange CAI1TimeRange]
      [documentation pageSize "The page size."]
      [field pageSize cb:IntegerUnsigned32]
    ]

    [documentation CAI1AuditEvent "An audit event."]
    [record CAI1AuditEvent
      [documentation id "The event ID."]
      [field id cb:IntegerUnsigned64]
      [documentation time "The event time."]
      [field time ct:OffsetDateTime]
      [documentation owner "The event owner."]
      [field owner cb:UUID]
      [documentation type "The event type."]
      [field type cb:String]
      [documentation data "The event data."]
      [field data [cb:Map cb:String cb:String]]
    ]

    [documentation CAI1TypePackageSearchParameters "The type package search parameters."]
    [record CAI1TypePackageSearchParameters
      [documentation descriptionMatch "The type package description match expression."]
      [field descriptionMatch [CAI1ComparisonFuzzy cb:String]]
      [documentation limit "The item limit."]
      [field limit cb:IntegerUnsigned32]
    ]

    [documentation CAI1Version "A version number."]
    [record CAI1Version
      [documentation versionMajor "The major version."]
      [field versionMajor cb:IntegerUnsigned32]
      [documentation versionMinor "The minor version."]
      [field versionMinor cb:IntegerUnsigned32]
      [documentation versionPatch "The patch version."]
      [field versionPatch cb:IntegerUnsigned32]
      [documentation versionQualifier "The version qualifier."]
      [field versionQualifier [cb:Option cb:String]]
    ]

    [documentation CAI1TypePackageIdentifier "The type package identifier."]
    [record CAI1TypePackageIdentifier
      [documentation name "The package name."]
      [field name cb:String]
      [documentation version "The package version."]
      [field version CAI1Version]
    ]

    [documentation CAI1TypePackageSummary "The type package summary."]
    [record CAI1TypePackageSummary
      [documentation identifier "The package identifier."]
      [field identifier CAI1TypePackageIdentifier]
      [documentation description "The package description."]
      [field description cb:String]
    ]

    [documentation CAI1Error "An error response."]
    [record CAI1Error
      [documentation errorCode "The error code."]
      [field errorCode cb:String]
      [documentation message "The error message."]
      [field message cb:String]
      [documentation attributes "The error attributes."]
      [field attributes [cb:Map cb:String cb:String]]
      [documentation remediatingAction "The remediating action, if any."]
      [field remediatingAction [cb:Option cb:String]]
    ]

    [documentation CAI1TypePackageTypeRemovalBehavior "The type package type removal behavior."]
    [variant CAI1TypePackageTypeRemovalBehavior
      [case FailIfTypesReferenced]
      [case RevokeTypes]
    ]

    [documentation CAI1TypePackageVersionBehavior "The type package version behavior."]
    [variant CAI1TypePackageVersionBehavior
      [case AllowDowngrades]
      [case DisallowDowngrades]
    ]

    [documentation CAI1TypePackageUninstall "The type package uninstall parameters."]
    [record CAI1TypePackageUninstall
      [field typeRemovalBehavior CAI1TypePackageTypeRemovalBehavior]
      [field identifier CAI1TypePackageIdentifier]
    ]

    [variant CAI1StockOccurrenceKind
      [case Set]
      [case Serial]
    ]

    [variant CAI1StockOccurrence
      [case Serial
        [field instance cb:UUID]
        [field location CAI1LocationSummary]
        [field item CAI1ItemSummary]
        [field serials [cb:List CAI1ItemSerial]]
      ]
      [case Set
        [field instance cb:UUID]
        [field location CAI1LocationSummary]
        [field item CAI1ItemSummary]
        [field count cb:IntegerUnsigned64]
      ]
    ]

    [documentation CAI1StockSearchParameters "The stock search parameters."]
    [record CAI1StockSearchParameters
      [documentation locationMatch "The location match."]
      [field locationMatch CAI1LocationMatch]
      [documentation itemMatch "The item match."]
      [field itemMatch [CAI1ComparisonExact cb:UUID]]
      [documentation includeOccurrences "The kinds of stock occurrences to include."]
      [field includeOccurrences [cb:List CAI1StockOccurrenceKind]]
      [documentation pageSize "The page size."]
      [field pageSize cb:IntegerUnsigned32]
    ]

    ;
    ; Commands.
    ;

    [documentation CAI1CommandLogin "A request to log in."]
    [record CAI1CommandLogin
      [documentation userName "The username."]
      [field userName cb:String]
      [documentation password "The password."]
      [field password cb:String]
      [documentation metadata "Extra metadata included with the login request."]
      [field metadata [cb:Map cb:String cb:String]]
    ]

    [documentation CAI1CommandFilePut "Add or update files."]
    [record CAI1CommandFilePut
      [documentation file "The file."]
      [field file CAI1File]
    ]

    [documentation CAI1CommandFileDelete "Delete files."]
    [record CAI1CommandFileDelete
      [documentation id "The file ID."]
      [field id cb:UUID]
    ]

    [documentation CAI1CommandItemAttachmentAdd "Add item attachments."]
    [record CAI1CommandItemAttachmentAdd
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
      [documentation fileId "The file ID."]
      [field fileId cb:UUID]
      [documentation relation "The attachment relation."]
      [field relation cb:String]
    ]

    [documentation CAI1CommandItemAttachmentRemove "Remove item attachments."]
    [record CAI1CommandItemAttachmentRemove
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
      [documentation fileId "The file ID."]
      [field fileId cb:UUID]
      [documentation relation "The attachment relation."]
      [field relation cb:String]
    ]

    [documentation CAI1CommandItemCreate "Create a new item."]
    [record CAI1CommandItemCreate
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
      [documentation name "The item name."]
      [field name cb:String]
    ]

    [documentation CAI1CommandItemGet "Retrieve an item."]
    [record CAI1CommandItemGet
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
    ]

    [documentation CAI1CommandFileGet "Retrieve a file."]
    [record CAI1CommandFileGet
      [documentation fileId "The file ID."]
      [field fileId cb:UUID]
    ]

    [documentation CAI1CommandItemLocationsList "List all the locations an item is in, and how many times the item is in them."]
    [record CAI1CommandItemLocationsList
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
    ]

    [documentation CAI1CommandItemMetadataPut "Add or update metadata values in an item."]
    [record CAI1CommandItemMetadataPut
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
      [documentation metadatas "The item metadatas."]
      [field metadatas [cb:List CAI1Metadata]]
    ]

    [documentation CAI1CommandItemMetadataRemove "Remove metadata values from an item."]
    [record CAI1CommandItemMetadataRemove
      [documentation itemId "The item ID."]
      [field itemId cb:UUID]
      [documentation metadatas "The item metadatas."]
      [field metadatas [cb:List CAI1TypeRecordFieldIdentifier]]
    ]

    [documentation CAI1CommandStockReposit "Reposit an item."]
    [record CAI1CommandStockReposit
      [documentation reposit "The item reposition."]
      [field reposit CAI1StockReposit]
    ]

    [documentation CAI1CommandItemDelete "Delete items."]
    [record CAI1CommandItemDelete
      [documentation item "The items."]
      [field item cb:UUID]
    ]

    [documentation CAI1CommandItemSetName "Update the names of items."]
    [record CAI1CommandItemSetName
      [documentation item "The item ID."]
      [field item cb:UUID]
      [documentation name "The item name."]
      [field name cb:String]
    ]

    [documentation CAI1CommandLocationGet "Retrieve a location."]
    [record CAI1CommandLocationGet
      [documentation location "The location ID."]
      [field location cb:UUID]
    ]

    [documentation CAI1CommandLocationList "List locations."]
    [record CAI1CommandLocationList]

    [documentation CAI1CommandLocationPut "Create or update a location."]
    [record CAI1CommandLocationPut
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1CommandLocationDelete "Delete locations."]
    [record CAI1CommandLocationDelete
      [documentation location "The location."]
      [field location cb:UUID]
    ]

    [documentation CAI1CommandItemSearchBegin "Start searching for items."]
    [record CAI1CommandItemSearchBegin
      [documentation parameters "The search parameters."]
      [field parameters CAI1ItemSearchParameters]
    ]

    [documentation CAI1CommandItemSearchNext "Return the next page of search results."]
    [record CAI1CommandItemSearchNext]

    [documentation CAI1CommandItemSearchPrevious "Return the next page of search results."]
    [record CAI1CommandItemSearchPrevious]

    [documentation CAI1CommandFileSearchBegin "Start searching for items."]
    [record CAI1CommandFileSearchBegin
      [documentation parameters "The search parameters."]
      [field parameters CAI1FileSearchParameters]
    ]

    [documentation CAI1CommandFileSearchNext "Return the next page of search results."]
    [record CAI1CommandFileSearchNext]

    [documentation CAI1CommandFileSearchPrevious "Return the next page of search results."]
    [record CAI1CommandFileSearchPrevious]

    [documentation CAI1CommandRolesAssign "Assign a set of roles to a user."]
    [record CAI1CommandRolesAssign
      [documentation user "The target user."]
      [field user cb:UUID]
      [documentation roles "The assigned roles."]
      [field roles [cb:List cb:String]]
    ]

    [documentation CAI1CommandRolesRevoke "Revoke a set of roles from a user."]
    [record CAI1CommandRolesRevoke
      [documentation user "The target user."]
      [field user cb:UUID]
      [documentation roles "The roles."]
      [field roles [cb:List cb:String]]
    ]

    [documentation CAI1CommandRolesGet "Get the roles for a user."]
    [record CAI1CommandRolesGet
      [documentation user "The target user."]
      [field user cb:UUID]
    ]

    [documentation CAI1CommandItemTypesAssign "Assign a set of types to an item."]
    [record CAI1CommandItemTypesAssign
      [documentation item "The target item."]
      [field item cb:UUID]
      [documentation types "The assigned types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1CommandItemTypesRevoke "Revoke a set of types from an item."]
    [record CAI1CommandItemTypesRevoke
      [documentation item "The target item."]
      [field item cb:UUID]
      [documentation types "The removed types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1CommandLocationMetadataPut "Add or update metadata values in a location."]
    [record CAI1CommandLocationMetadataPut
      [documentation locationId "The location ID."]
      [field locationId cb:UUID]
      [documentation metadatas "The location metadatas."]
      [field metadatas [cb:List CAI1Metadata]]
    ]

    [documentation CAI1CommandLocationMetadataRemove "Remove metadata values from a location."]
    [record CAI1CommandLocationMetadataRemove
      [documentation locationId "The location ID."]
      [field locationId cb:UUID]
      [documentation metadatas "The location metadatas."]
      [field metadatas [cb:List CAI1TypeRecordFieldIdentifier]]
    ]

    [documentation CAI1CommandLocationTypesAssign "Assign a set of types to a location."]
    [record CAI1CommandLocationTypesAssign
      [documentation location "The target location."]
      [field location cb:UUID]
      [documentation types "The assigned types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1CommandLocationTypesRevoke "Revoke a set of types from a location."]
    [record CAI1CommandLocationTypesRevoke
      [documentation location "The target location."]
      [field location cb:UUID]
      [documentation types "The removed types."]
      [field types [cb:List CAI1TypeRecordIdentifier]]
    ]

    [documentation CAI1CommandLocationAttachmentAdd "Add location attachments."]
    [record CAI1CommandLocationAttachmentAdd
      [documentation locationId "The location ID."]
      [field locationId cb:UUID]
      [documentation fileId "The file ID."]
      [field fileId cb:UUID]
      [documentation relation "The attachment relation."]
      [field relation cb:String]
    ]

    [documentation CAI1CommandLocationAttachmentRemove "Remove location attachments."]
    [record CAI1CommandLocationAttachmentRemove
      [documentation locationId "The location ID."]
      [field locationId cb:UUID]
      [documentation fileId "The file ID."]
      [field fileId cb:UUID]
      [documentation relation "The attachment relation."]
      [field relation cb:String]
    ]

    [documentation CAI1CommandAuditSearchBegin "Start searching audit events."]
    [record CAI1CommandAuditSearchBegin
      [documentation parameters "The search parameters."]
      [field parameters CAI1AuditSearchParameters]
    ]

    [documentation CAI1CommandAuditSearchNext "Continue searching audit events."]
    [record CAI1CommandAuditSearchNext]

    [documentation CAI1CommandAuditSearchPrevious "Continue searching audit events."]
    [record CAI1CommandAuditSearchPrevious]

    [documentation CAI1CommandTypePackageSearchBegin "Start searching type packages."]
    [record CAI1CommandTypePackageSearchBegin
      [documentation parameters "The search parameters."]
      [field parameters CAI1TypePackageSearchParameters]
    ]

    [documentation CAI1CommandTypePackageSearchNext "Continue searching type packages."]
    [record CAI1CommandTypePackageSearchNext]

    [documentation CAI1CommandTypePackageSearchPrevious "Continue searching type packages."]
    [record CAI1CommandTypePackageSearchPrevious]

    [documentation CAI1CommandTypePackageGetText "Get a type package."]
    [record CAI1CommandTypePackageGetText
      [documentation identifier "The type package identifier."]
      [field identifier CAI1TypePackageIdentifier]
    ]

    [documentation CAI1CommandTypePackageInstall "Install a type package."]
    [record CAI1CommandTypePackageInstall
      [documentation text "The type package text."]
      [field text cb:String]
    ]

    [documentation CAI1CommandTypePackageUninstall "Uninstall a type package."]
    [record CAI1CommandTypePackageUninstall
      [documentation parameters "The uninstall parameters."]
      [field parameters CAI1TypePackageUninstall]
    ]

    [documentation CAI1CommandTypePackageUpgrade "Upgrade a type package."]
    [record CAI1CommandTypePackageUpgrade
      [documentation typeRemovalBehavior "The type removal behavior."]
      [field typeRemovalBehavior CAI1TypePackageTypeRemovalBehavior]
      [documentation versionBehavior "The version behavior."]
      [field versionBehavior CAI1TypePackageVersionBehavior]
      [documentation text "The type package text."]
      [field text cb:String]
    ]

    [documentation CAI1CommandStockCount "Count stock."]
    [record CAI1CommandStockCount
      [documentation parameters "The search parameters."]
      [field parameters CAI1StockSearchParameters]
    ]

    [documentation CAI1CommandStockSearchBegin "Search stock."]
    [record CAI1CommandStockSearchBegin
      [documentation parameters "The search parameters."]
      [field parameters CAI1StockSearchParameters]
    ]

    [documentation CAI1CommandStockSearchNext "Search stock."]
    [record CAI1CommandStockSearchNext]

    [documentation CAI1CommandStockSearchPrevious "Search stock."]
    [record CAI1CommandStockSearchPrevious]

    ;
    ; Responses.
    ;

    [documentation CAI1ResponseBlame "A blame assignment."]
    [variant CAI1ResponseBlame
      [documentation BlameClient "The client sent a bad response."]
      [case BlameClient]
      [documentation BlameServer "Something went wrong on the server."]
      [case BlameServer]
    ]

    [documentation CAI1ResponseError "An error response."]
    [record CAI1ResponseError
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation errorCode "The error code."]
      [field errorCode cb:String]
      [documentation message "The error message."]
      [field message cb:String]
      [documentation attributes "The error attributes."]
      [field attributes [cb:Map cb:String cb:String]]
      [documentation remediatingAction "The remediating action, if any."]
      [field remediatingAction [cb:Option cb:String]]
      [documentation blame "The blame assignment."]
      [field blame CAI1ResponseBlame]
      [documentation extras "The extra errors."]
      [field extras [cb:List CAI1Error]]
    ]

    [documentation CAI1ResponseLogin "A response to CAI1CommandLogin."]
    [record CAI1ResponseLogin
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation userId "The ID of the user that logged in."]
      [field userId cb:UUID]
    ]

    [documentation CAI1ResponseFilePut "A response to CAI1CommandFilePut."]
    [record CAI1ResponseFilePut
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation file "The file."]
      [field file CAI1File]
    ]

    [documentation CAI1ResponseFileDelete "A response to CAI1CommandFileDelete."]
    [record CAI1ResponseFileDelete
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation id "The file ID."]
      [field id cb:UUID]
    ]

    [documentation CAI1ResponseItemAttachmentAdd "A response to CAI1CommandItemAttachmentAdd."]
    [record CAI1ResponseItemAttachmentAdd
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseItemAttachmentRemove "A response to CAI1CommandItemAttachmentRemove."]
    [record CAI1ResponseItemAttachmentRemove
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseItemCreate "A response to CAI1CommandItemCreate."]
    [record CAI1ResponseItemCreate
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseItemGet "A response to CAI1CommandItemGet."]
    [record CAI1ResponseItemGet
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseFileGet "A response to CAI1CommandFileGet."]
    [record CAI1ResponseFileGet
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation file "The file."]
      [field file CAI1File]
    ]

    [documentation CAI1ResponseItemMetadataPut "A response to CAI1CommandItemMetadataPut."]
    [record CAI1ResponseItemMetadataPut
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseItemMetadataRemove "A response to CAI1CommandItemMetadataRemove."]
    [record CAI1ResponseItemMetadataRemove
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseStockReposit "A response to CAI1CommandStockReposit."]
    [record CAI1ResponseStockReposit
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation stock "The stock."]
      [field stock CAI1StockOccurrence]
    ]

    [documentation CAI1ResponseItemDelete "A response to CAI1CommandItemDelete."]
    [record CAI1ResponseItemDelete
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item cb:UUID]
    ]

    [documentation CAI1ResponseItemSetName "A response to CAI1CommandItemSetName."]
    [record CAI1ResponseItemSetName
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseLocationGet "A response to CAI1CommandLocationGet."]
    [record CAI1ResponseLocationGet
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationList "A response to CAI1CommandLocationList."]
    [record CAI1ResponseLocationList
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation locations "The locations."]
      [field locations [cb:Map cb:UUID CAI1LocationSummary]]
    ]

    [documentation CAI1ResponseLocationPut "A response to CAI1CommandLocationPut."]
    [record CAI1ResponseLocationPut
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationDelete "A response to CAI1CommandLocationDelete."]
    [record CAI1ResponseLocationDelete
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location cb:UUID]
    ]

    [documentation CAI1ResponseItemSearch "A response to CAI1CommandItemSearch."]
    [record CAI1ResponseItemSearch
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results."]
      [field results [CAI1Page CAI1ItemSummary]]
    ]

    [documentation CAI1ResponseFileSearch "A response to CAI1CommandFileSearch."]
    [record CAI1ResponseFileSearch
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results."]
      [field results [CAI1Page CAI1File]]
    ]

    [documentation CAI1ResponseRolesAssign "A response to CAI1ResponseRolesAssign."]
    [record CAI1ResponseRolesAssign
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
    ]

    [documentation CAI1ResponseRolesRevoke "A response to CAI1ResponseRolesRevoke."]
    [record CAI1ResponseRolesRevoke
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
    ]

    [documentation CAI1ResponseRolesGet "A response to CAI1ResponseRolesGet."]
    [record CAI1ResponseRolesGet
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation roles "The roles."]
      [field roles [cb:List cb:String]]
    ]

    [documentation CAI1ResponseItemTypesAssign "A response to CAI1CommandItemTypesAssign."]
    [record CAI1ResponseItemTypesAssign
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseItemTypesRevoke "A response to CAI1CommandItemTypesRevoke."]
    [record CAI1ResponseItemTypesRevoke
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation item "The item."]
      [field item CAI1Item]
    ]

    [documentation CAI1ResponseLocationMetadataPut "A response to CAI1CommandLocationMetadataPut."]
    [record CAI1ResponseLocationMetadataPut
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationMetadataRemove "A response to CAI1CommandLocationMetadataRemove."]
    [record CAI1ResponseLocationMetadataRemove
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationTypesAssign "A response to CAI1CommandLocationTypesAssign."]
    [record CAI1ResponseLocationTypesAssign
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationTypesRevoke "A response to CAI1CommandLocationTypesRevoke."]
    [record CAI1ResponseLocationTypesRevoke
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationAttachmentAdd "A response to CAI1CommandLocationAttachmentAdd."]
    [record CAI1ResponseLocationAttachmentAdd
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseLocationAttachmentRemove "A response to CAI1CommandLocationAttachmentRemove."]
    [record CAI1ResponseLocationAttachmentRemove
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation location "The location."]
      [field location CAI1Location]
    ]

    [documentation CAI1ResponseAuditSearch "A response to CAI1CommandAuditSearchBegin."]
    [record CAI1ResponseAuditSearch
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results"]
      [field results [CAI1Page CAI1AuditEvent]]
    ]

    [documentation CAI1ResponseTypePackageSearch "A response to CAI1CommandTypePackageSearch."]
    [record CAI1ResponseTypePackageSearch
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results."]
      [field results [CAI1Page CAI1TypePackageSummary]]
    ]

    [documentation CAI1ResponseTypePackageGetText "A response to CAI1CommandTypePackageGetText."]
    [record CAI1ResponseTypePackageGetText
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results."]
      [field results cb:String]
    ]

    [documentation CAI1ResponseTypePackageInstall "A response to CAI1CommandTypePackageInstall."]
    [record CAI1ResponseTypePackageInstall
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation identifier "The identifier."]
      [field identifier CAI1TypePackageIdentifier]
    ]

    [documentation CAI1ResponseTypePackageUninstall "A response to CAI1CommandTypePackageUninstall."]
    [record CAI1ResponseTypePackageUninstall
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
    ]

    [documentation CAI1ResponseTypePackageUpgrade "A response to CAI1CommandTypePackageUpgrade."]
    [record CAI1ResponseTypePackageUpgrade
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation identifier "The identifier."]
      [field identifier CAI1TypePackageIdentifier]
    ]

    [documentation CAI1ResponseStockCount "A response to CAI1CommandStockCount."]
    [record CAI1ResponseStockCount
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation count "The count."]
      [field count cb:IntegerUnsigned64]
    ]

    [documentation CAI1ResponseStockSearch "A response to CAI1CommandStockSearch."]
    [record CAI1ResponseStockSearch
      [documentation requestId "The ID of the request that yielded this response."]
      [field requestId cb:UUID]
      [documentation results "The results."]
      [field results [CAI1Page CAI1StockOccurrence]]
    ]

    ;
    ; Events.
    ;

    [documentation CAI1EventUpdated "Data on the server was updated."]
    [record CAI1EventUpdated
      [documentation updated "The list of objects that were updated."]
      [field updated [cb:List CAI1Id]]
      [documentation removed "The list of objects that were removed."]
      [field removed [cb:List CAI1Id]]]

    ;
    ; Protocol.
    ;

    [documentation CAI "The Inventory protocol."]
    [protocol CAI
      [version 1
        [types-added
          CAI1CommandAuditSearchBegin
          CAI1CommandAuditSearchNext
          CAI1CommandAuditSearchPrevious
          CAI1CommandFileDelete
          CAI1CommandFileGet
          CAI1CommandFilePut
          CAI1CommandFileSearchBegin
          CAI1CommandFileSearchNext
          CAI1CommandFileSearchPrevious
          CAI1CommandItemAttachmentAdd
          CAI1CommandItemAttachmentRemove
          CAI1CommandItemCreate
          CAI1CommandItemDelete
          CAI1CommandItemGet
          CAI1CommandItemMetadataPut
          CAI1CommandItemMetadataRemove
          CAI1CommandItemSearchBegin
          CAI1CommandItemSearchNext
          CAI1CommandItemSearchPrevious
          CAI1CommandItemSetName
          CAI1CommandItemTypesAssign
          CAI1CommandItemTypesRevoke
          CAI1CommandLocationAttachmentAdd
          CAI1CommandLocationAttachmentRemove
          CAI1CommandLocationDelete
          CAI1CommandLocationGet
          CAI1CommandLocationList
          CAI1CommandLocationMetadataPut
          CAI1CommandLocationMetadataRemove
          CAI1CommandLocationPut
          CAI1CommandLocationTypesAssign
          CAI1CommandLocationTypesRevoke
          CAI1CommandLogin
          CAI1CommandRolesAssign
          CAI1CommandRolesGet
          CAI1CommandRolesRevoke
          CAI1CommandStockCount
          CAI1CommandStockReposit
          CAI1CommandStockSearchBegin
          CAI1CommandStockSearchNext
          CAI1CommandStockSearchPrevious
          CAI1CommandTypePackageGetText
          CAI1CommandTypePackageInstall
          CAI1CommandTypePackageSearchBegin
          CAI1CommandTypePackageSearchNext
          CAI1CommandTypePackageSearchPrevious
          CAI1CommandTypePackageUninstall
          CAI1CommandTypePackageUpgrade
          CAI1EventUpdated
          CAI1ResponseAuditSearch
          CAI1ResponseError
          CAI1ResponseFileDelete
          CAI1ResponseFileGet
          CAI1ResponseFilePut
          CAI1ResponseFileSearch
          CAI1ResponseItemAttachmentAdd
          CAI1ResponseItemAttachmentRemove
          CAI1ResponseItemCreate
          CAI1ResponseItemDelete
          CAI1ResponseItemGet
          CAI1ResponseItemMetadataPut
          CAI1ResponseItemMetadataRemove
          CAI1ResponseItemSearch
          CAI1ResponseItemSetName
          CAI1ResponseItemTypesAssign
          CAI1ResponseItemTypesRevoke
          CAI1ResponseLocationAttachmentAdd
          CAI1ResponseLocationAttachmentRemove
          CAI1ResponseLocationDelete
          CAI1ResponseLocationGet
          CAI1ResponseLocationList
          CAI1ResponseLocationMetadataPut
          CAI1ResponseLocationMetadataRemove
          CAI1ResponseLocationPut
          CAI1ResponseLocationTypesAssign
          CAI1ResponseLocationTypesRevoke
          CAI1ResponseLogin
          CAI1ResponseRolesAssign
          CAI1ResponseRolesGet
          CAI1ResponseRolesRevoke
          CAI1ResponseStockCount
          CAI1ResponseStockReposit
          CAI1ResponseStockSearch
          CAI1ResponseTypePackageGetText
          CAI1ResponseTypePackageInstall
          CAI1ResponseTypePackageSearch
          CAI1ResponseTypePackageUninstall
          CAI1ResponseTypePackageUpgrade
        ]
      ]
    ]

8. API Access
Previous
8. API Access
Up
9. Security
Next
io7m | single-page | multi-page | epub | Cardant User Manual 1.0.0-beta0001