Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up docs for EventGridEvent/CloudEvent #17342

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,45 @@ internal CloudEvent(string id, string source, string type, DateTimeOffset? time,
ExtensionAttributes = new Dictionary<string, object>();
}

/// <summary> An identifier for the event. The combination of id and source must be unique for each distinct event. </summary>
/// <summary>
/// Gets or sets an identifier for the event. The combination of <see cref="Id"/> and <see cref="Source"/> must be unique for each distinct event.
/// If not explicitly set, this will default to a <see cref="Guid"/>.
/// </summary>
public string Id { get; set; } = Guid.NewGuid().ToString();

/// <summary> Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. </summary>
/// <summary>Gets or sets the context in which an event happened. The combination of <see cref="Id"/> and <see cref="Source"/> must be unique for each distinct event.</summary>
public string Source { get; set; }

/// <summary> Type of event related to the originating occurrence. </summary>
/// <summary>Gets or sets the type of event related to the originating occurrence.</summary>
public string Type { get; set; }

/// <summary> The time (in UTC) the event was generated, in RFC3339 format. </summary>
/// <summary>
/// Gets or sets the time (in UTC) the event was generated, in RFC3339 format.
/// If not explicitly set, this will default to the time that the event is constructed.
/// </summary>
public DateTimeOffset? Time { get; set; } = DateTimeOffset.UtcNow;

/// <summary> Identifies the schema that data adheres to. </summary>
/// <summary>Gets or sets the schema that the data adheres to.</summary>
public string DataSchema { get; set; }

/// <summary> Content type of data value. </summary>
/// <summary>Gets or sets the content type of the data.</summary>
public string DataContentType { get; set; }

/// <summary> This describes the subject of the event in the context of the event producer (identified by source). </summary>
/// <summary>Gets or sets the subject of the event in the context of the event producer (identified by source). </summary>
public string Subject { get; set; }

/// <summary>
/// Extension attributes that can be additionally added to the CloudEvent envelope.
/// Gets extension attributes that can be additionally added to the CloudEvent envelope.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The wording here feels a little clunky still, since you're not getting the attributes but rather the collection of attributes.

Maybe something like: "Gets the collection of extension attributes added to the CloudEvent envelope?"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't think we normally preface collection properties like this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, keeping what you have seems great then.

/// </summary>
public Dictionary<string, object> ExtensionAttributes { get; }

/// <summary> Deserialized event data specific to the event type. </summary>
/// <summary>Gets or sets the deserialized event data specific to the event type.</summary>
internal object Data { get; set; }

/// <summary> Serialized event data specific to the event type. </summary>
/// <summary>Gets or sets the serialized event data specific to the event type.</summary>
internal JsonElement SerializedData { get; set; }

/// <summary> Event data specific to the event type, encoded as a base64 string. </summary>
/// <summary>Gets or sets the event data specific to the event type, encoded as a base64 string.</summary>
internal byte[] DataBase64 { get; set; }

private static readonly JsonObjectSerializer s_jsonSerializer = new JsonObjectSerializer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,30 @@ internal EventGridEvent(JsonElement serializedData, string subject, string event
Id = id;
}

/// <summary> An unique identifier for the event. </summary>
/// <summary> Gets or sets a unique identifier for the event. </summary>
public string Id { get; set; } = Guid.NewGuid().ToString();

/// <summary> The resource path of the event source. </summary>
/// <summary>Gets or sets the resource path of the event source.
/// This must be set when publishing the event to a domain, and must not be set when publishing the event to a topic.
/// </summary>
public string Topic { get; set; }

/// <summary> A resource path relative to the topic path. </summary>
/// <summary>Gets or sets a resource path relative to the topic path.</summary>
public string Subject { get; set; }

/// <summary> The type of the event that occurred. </summary>
/// <summary>Gets or sets the type of the event that occurred.</summary>
public string EventType { get; set; }

/// <summary> The time (in UTC) the event was generated. </summary>
/// <summary>Gets or sets the time (in UTC) the event was generated.</summary>
public DateTimeOffset EventTime { get; set; } = DateTimeOffset.UtcNow;

/// <summary> The schema version of the data object. </summary>
/// <summary>Gets or sets the schema version of the data object.</summary>
public string DataVersion { get; set; }

/// <summary> Event data specific to the event type. </summary>
/// <summary>Gets or sets the event data specific to the event type.</summary>
internal object Data { get; set; }

/// <summary> Serialized event data specific to the event type. </summary>
/// <summary>Gets or sets the serialized event data specific to the event type.</summary>
internal JsonElement SerializedData { get; set; }

private static readonly JsonObjectSerializer s_jsonSerializer = new JsonObjectSerializer();
Expand Down