Get space types - 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 (United States)

To get all available space types on your server use the GetSpaceTypes method, the library delivers a collection of MetasysObjectType.

Table 1. Get space types .NET signature
Library method name GetSpaceTypes
Description Get available space types on your server.
Method signature IEnumerable<MetasysObjectType>GetSpaceTypes();
Method input parameters None
Return value A collection of MetasysObjectType.
The following .NET C# code is an example of successful get spaces types response:
IEnumerable<MetasysObjectType> spaceTypes = client.GetSpaceTypes();
foreach (var type in spaceTypes)
  {
    Console.WriteLine(type);
  }
/*                     
    {
      "Description": "Building",
      "DescriptionEnumerationKey": "Building",
      "Id": 1
    }
    {
      "Description": "Floor",
      "DescriptionEnumerationKey": "Floor",
      "Id": 2
    }
    {
      "Description": "Generic",
      "DescriptionEnumerationKey": "Generic",
      "Id": 0
    }
    {
      "Description": "Room",
      "DescriptionEnumerationKey": "Room",
      "Id": 3
    }
*/