From 06d6ec53e35caa7b35a44b6dc66a2f1e65004d44 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Fri, 4 Dec 2020 11:23:37 -0800 Subject: [PATCH] Clean up docs --- .../src/Customization/CloudEvent.cs | 28 +++++++++++-------- .../src/Customization/EventGridEvent.cs | 18 ++++++------ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/CloudEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/CloudEvent.cs index 2d9307b86347..e70da622a9eb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/CloudEvent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/CloudEvent.cs @@ -99,39 +99,45 @@ internal CloudEvent(string id, string source, string type, DateTimeOffset? time, ExtensionAttributes = new Dictionary(); } - /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// + /// Gets or sets an identifier for the event. The combination of and must be unique for each distinct event. + /// If not explicitly set, this will default to a . + /// public string Id { get; set; } = Guid.NewGuid().ToString(); - /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Gets or sets the context in which an event happened. The combination of and must be unique for each distinct event. public string Source { get; set; } - /// Type of event related to the originating occurrence. + /// Gets or sets the type of event related to the originating occurrence. public string Type { get; set; } - /// The time (in UTC) the event was generated, in RFC3339 format. + /// + /// 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. + /// public DateTimeOffset? Time { get; set; } = DateTimeOffset.UtcNow; - /// Identifies the schema that data adheres to. + /// Gets or sets the schema that the data adheres to. public string DataSchema { get; set; } - /// Content type of data value. + /// Gets or sets the content type of the data. public string DataContentType { get; set; } - /// This describes the subject of the event in the context of the event producer (identified by source). + /// Gets or sets the subject of the event in the context of the event producer (identified by source). public string Subject { get; set; } /// - /// Extension attributes that can be additionally added to the CloudEvent envelope. + /// Gets extension attributes that can be additionally added to the CloudEvent envelope. /// public Dictionary ExtensionAttributes { get; } - /// Deserialized event data specific to the event type. + /// Gets or sets the deserialized event data specific to the event type. internal object Data { get; set; } - /// Serialized event data specific to the event type. + /// Gets or sets the serialized event data specific to the event type. internal JsonElement SerializedData { get; set; } - /// Event data specific to the event type, encoded as a base64 string. + /// Gets or sets the event data specific to the event type, encoded as a base64 string. internal byte[] DataBase64 { get; set; } private static readonly JsonObjectSerializer s_jsonSerializer = new JsonObjectSerializer(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridEvent.cs index 8f43baaa6f4d..b57b4aa1841b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridEvent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridEvent.cs @@ -51,28 +51,30 @@ internal EventGridEvent(JsonElement serializedData, string subject, string event Id = id; } - /// An unique identifier for the event. + /// Gets or sets a unique identifier for the event. public string Id { get; set; } = Guid.NewGuid().ToString(); - /// The resource path of the event source. + /// 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. + /// public string Topic { get; set; } - /// A resource path relative to the topic path. + /// Gets or sets a resource path relative to the topic path. public string Subject { get; set; } - /// The type of the event that occurred. + /// Gets or sets the type of the event that occurred. public string EventType { get; set; } - /// The time (in UTC) the event was generated. + /// Gets or sets the time (in UTC) the event was generated. public DateTimeOffset EventTime { get; set; } = DateTimeOffset.UtcNow; - /// The schema version of the data object. + /// Gets or sets the schema version of the data object. public string DataVersion { get; set; } - /// Event data specific to the event type. + /// Gets or sets the event data specific to the event type. internal object Data { get; set; } - /// Serialized event data specific to the event type. + /// Gets or sets the serialized event data specific to the event type. internal JsonElement SerializedData { get; set; } private static readonly JsonObjectSerializer s_jsonSerializer = new JsonObjectSerializer();