Table of Contents

Class CloudEvent

Namespace
Azure.Iot.Operations.Protocol.Telemetry
Assembly
Azure.Iot.Operations.Protocol.dll

Implements the CloudEvent spec 1.0. The required fields are source, type, id and specversion. Id is required but we want to update it in the same instance. See CloudEvent Spec

public class CloudEvent
Inheritance
CloudEvent
Inherited Members

Constructors

CloudEvent(Uri, string, string)

Implements the CloudEvent spec 1.0. The required fields are source, type, id and specversion. Id is required but we want to update it in the same instance. See CloudEvent Spec

public CloudEvent(Uri source, string type = "ms.aio.telemetry", string specversion = "1.0")

Parameters

source Uri

Source

type string

Type

specversion string

SpecVersion

Properties

DataContentType

Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format.

public string? DataContentType { get; }

Property Value

string

DataSchema

Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI.

public string? DataSchema { get; set; }

Property Value

string

Id

Identifies the event. Producers MUST ensure that source + id is unique for each distinct event. If a duplicate event is re-sent (e.g. due to a network error) it MAY have the same id. Consumers MAY assume that Events with identical source and id are duplicates.

public string? Id { get; set; }

Property Value

string

Source

Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer.

public Uri? Source { get; }

Property Value

Uri

SpecVersion

The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification.

public string SpecVersion { get; }

Property Value

string

Subject

Identifies the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure.

public string? Subject { get; set; }

Property Value

string

Time

Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect.

public DateTime? Time { get; set; }

Property Value

DateTime?

Type

Contains a value describing the type of event related to the originating occurrence. Often this attribute is used for routing, observability, policy enforcement, etc. The format of this is producer defined and might include information such as the version of the type

public string Type { get; }

Property Value

string