Class CloudEventExtensions
public static class CloudEventExtensions
- Inheritance
-
CloudEventExtensions
- Inherited Members
Methods
BuildCloudEvent(string, string, byte[], string?, DateTimeOffset?, string?)
Build a CloudEvent proto from attributes and data.
public static CloudEvent BuildCloudEvent(string type, string source, byte[] data, string? id = null, DateTimeOffset? time = null, string? topic = null)
Parameters
Returns
- CloudEvent
ToJsonBytes(CloudEvent)
Serialize a CloudEvent proto to JSON bytes via the CloudNative.CloudEvents library.
public static byte[] ToJsonBytes(this CloudEvent ce)
Parameters
ceCloudEvent
Returns
- byte[]
ValidateAttributes(CloudEvent)
Validate a CloudEvent proto's attributes exactly as the JSON form does (the SDK's typed attribute setters), without serializing it to JSON. Throws CloudEventAttributeException for an attribute the SDK rejects, same as ToJsonBytes(CloudEvent).
public static void ValidateAttributes(CloudEvent ce)
Parameters
ceCloudEvent