Read list of commands - Metasys - LIT-12013522 - Software Application - Basic Services client library for .NET (and COM) - Metasys API - 4.2

Metasys REST Client for .NET and COM Developer Guide

Brand
Metasys
Product name
Basic Services client library for .NET (and COM)
Metasys API
Document type
API Reference Guide
Document number
LIT-12013522
Version
4.2
Revision date
2021-04-07
Language
English

Use the GetCommands method to retrieve a list of all available commands on an object. Additionally use the ToList() method to display any information associated with the object. When you send a command, use the command.CommandId parameter. The command.Items property lists all of these values including their title and type.

Table 1. Get commands .NET signature
Library method name GetCommands
Description Get all commands on an object.
Method signature IEnumerable<Command> GetCommands(Guid id);
Method input parameters id: the object GUID the method targets to obtain a list of possible commands.
Return value A collection of Command objects.
The following .NET C# code is an example of a successful response to get commands:
List<Command> commands = client.GetCommands(objectId).ToList();
Command command = commands.FindById("Adjust"); // Adjust
Console.WriteLine(command);
/*                       
  {
    "Title": "Adjust",
    "TitleEnumerationKey": "commandIdEnumSet.adjustCommand",
    "CommandId": "Adjust",
    "Items": [
      {
        "Title": "Value",
        "Type": "number",
        "EnumerationValues": null,
        "Minimum": null,
        "Maximum": null
      }
    ]
  }
*/