Table of Contents

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

string

AioDeviceRef

Generated aiodeviceref value. AIO-specific extension attribute.

public required string AioDeviceRef { get; init; }

Property Value

string

DataSchema

Schema registry ID for the payload schema.

public string? DataSchema { get; init; }

Property Value

string

Source

Generated CloudEvents source URI.

public required Uri Source { get; init; }

Property Value

Uri

Subject

Generated CloudEvents subject string.

public required string Subject { get; init; }

Property Value

string

Type

Generated CloudEvents type string.

public required string Type { get; init; }

Property Value

string

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

time DateTime?

Timestamp of when the occurrence happened. Defaults to current UTC time.

id string

Event identifier. Defaults to a new GUID.

Returns

CloudEvent

A CloudEvent instance with all standard fields populated.