Class AioCloudEvent
- Namespace
- Azure.Iot.Operations.Connector.CloudEvents
- Assembly
- Azure.Iot.Operations.Connector.dll
Azure IoT Operations CloudEvent with automatic metadata population. Contains all CloudEvents fields with AIO-specific extensions (aiodeviceref, aioassetref). This class holds all the CloudEvents headers that will be automatically populated based on connector, device, asset, and dataset/event configuration.
public class AioCloudEvent
- Inheritance
-
AioCloudEvent
- Inherited Members
Properties
AioAssetRef
Generated aioassetref value. AIO-specific extension attribute.
public required string AioAssetRef { get; init; }
Property Value
AioDeviceRef
Generated aiodeviceref value. AIO-specific extension attribute.
public required string AioDeviceRef { get; init; }
Property Value
DataSchema
Schema registry ID for the payload schema.
public string? DataSchema { get; init; }
Property Value
Source
Generated CloudEvents source URI.
public required Uri Source { get; init; }
Property Value
Subject
Generated CloudEvents subject string.
public required string Subject { get; init; }
Property Value
Type
Generated CloudEvents type string.
public required string Type { get; init; }
Property Value
Methods
GetExtensions()
Gets the AIO-specific extension attributes as a dictionary. Use this to populate CloudEvents extension attributes in OutgoingTelemetryMetadata.UserData.
public Dictionary<string, string> GetExtensions()
Returns
- Dictionary<string, string>
Dictionary containing aiodeviceref and aioassetref extension attributes.
ToCloudEvent(DateTime?, string?)
Creates a standard CloudEvent from this AIO CloudEvent metadata.
public CloudEvent ToCloudEvent(DateTime? time = null, string? id = null)
Parameters
timeDateTime?Timestamp of when the occurrence happened. Defaults to current UTC time.
idstringEvent identifier. Defaults to a new GUID.
Returns
- CloudEvent
A CloudEvent instance with all standard fields populated.