Table of Contents

Class AppEntityInfoToModel

Namespace
RustPlusApi.Extensions
Assembly
RustPlusApi.dll

Mapping extensions from protobuf entity messages to entity model types.

public static class AppEntityInfoToModel
Inheritance
AppEntityInfoToModel
Inherited Members

Methods

ToAlarmInfo(AppEntityInfo)

Maps an RustPlusContracts.AppEntityInfo of type Alarm to an AlarmInfo.

public static AlarmInfo ToAlarmInfo(this AppEntityInfo entity)

Parameters

entity AppEntityInfo

The protobuf entity info.

Returns

AlarmInfo

Exceptions

InvalidOperationException

Thrown when the entity type is not Alarm.

ToSmartSwitchInfo(AppEntityInfo)

Maps an RustPlusContracts.AppEntityInfo of type Switch to a SmartSwitchInfo.

public static SmartSwitchInfo ToSmartSwitchInfo(this AppEntityInfo entity)

Parameters

entity AppEntityInfo

The protobuf entity info.

Returns

SmartSwitchInfo

Exceptions

InvalidOperationException

Thrown when the entity type is not Switch.

ToStorageMonitorInfo(AppEntityInfo)

Maps an RustPlusContracts.AppEntityInfo of type StorageMonitor to a StorageMonitorInfo.

public static StorageMonitorInfo ToStorageMonitorInfo(this AppEntityInfo entity)

Parameters

entity AppEntityInfo

The protobuf entity info.

Returns

StorageMonitorInfo

Exceptions

InvalidOperationException

Thrown when the entity type is not StorageMonitor.

ToStorageMonitorItemInfo(Item)

Maps a single protobuf storage item to a StorageMonitorItemInfo.

public static StorageMonitorItemInfo ToStorageMonitorItemInfo(this AppEntityPayload.Item item)

Parameters

item AppEntityPayload.Item

The protobuf storage item.

Returns

StorageMonitorItemInfo

ToStorageMonitorItemsInfo(IEnumerable<Item>)

Maps a sequence of protobuf storage items to StorageMonitorItemInfo instances.

public static IEnumerable<StorageMonitorItemInfo> ToStorageMonitorItemsInfo(this IEnumerable<AppEntityPayload.Item> items)

Parameters

items IEnumerable<AppEntityPayload.Item>

The protobuf storage items to map.

Returns

IEnumerable<StorageMonitorItemInfo>