Skip to content

Commit

Permalink
Add system event converters and fix nullability of CloudEvent propert…
Browse files Browse the repository at this point in the history
…ies (#19181)

* Add system event converters and fix nullability of CloudEvent properties

* API
  • Loading branch information
JoshLove-msft authored Mar 3, 2021
1 parent 66c7d5a commit da9e91b
Show file tree
Hide file tree
Showing 200 changed files with 5,207 additions and 593 deletions.
10 changes: 5 additions & 5 deletions sdk/core/Azure.Core/api/Azure.Core.net461.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,17 @@ namespace Azure.Messaging
{
public partial class CloudEvent
{
public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { }
public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { }
public System.BinaryData? Data { get { throw null; } set { } }
public string? DataContentType { get { throw null; } set { } }
public string? DataSchema { get { throw null; } set { } }
public System.Collections.Generic.IDictionary<string, object?> ExtensionAttributes { get { throw null; } }
public string Id { get { throw null; } set { } }
public string Source { get { throw null; } set { } }
public string? Id { get { throw null; } set { } }
public string? Source { get { throw null; } set { } }
public string? Subject { get { throw null; } set { } }
public System.DateTimeOffset? Time { get { throw null; } set { } }
public string Type { get { throw null; } set { } }
public string? Type { get { throw null; } set { } }
public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; }
public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; }
}
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/Azure.Core/api/Azure.Core.net5.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,17 @@ namespace Azure.Messaging
{
public partial class CloudEvent
{
public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { }
public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { }
public System.BinaryData? Data { get { throw null; } set { } }
public string? DataContentType { get { throw null; } set { } }
public string? DataSchema { get { throw null; } set { } }
public System.Collections.Generic.IDictionary<string, object?> ExtensionAttributes { get { throw null; } }
public string Id { get { throw null; } set { } }
public string Source { get { throw null; } set { } }
public string? Id { get { throw null; } set { } }
public string? Source { get { throw null; } set { } }
public string? Subject { get { throw null; } set { } }
public System.DateTimeOffset? Time { get { throw null; } set { } }
public string Type { get { throw null; } set { } }
public string? Type { get { throw null; } set { } }
public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; }
public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; }
}
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,17 @@ namespace Azure.Messaging
{
public partial class CloudEvent
{
public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { }
public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { }
public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { }
public System.BinaryData? Data { get { throw null; } set { } }
public string? DataContentType { get { throw null; } set { } }
public string? DataSchema { get { throw null; } set { } }
public System.Collections.Generic.IDictionary<string, object?> ExtensionAttributes { get { throw null; } }
public string Id { get { throw null; } set { } }
public string Source { get { throw null; } set { } }
public string? Id { get { throw null; } set { } }
public string? Source { get { throw null; } set { } }
public string? Subject { get { throw null; } set { } }
public System.DateTimeOffset? Time { get { throw null; } set { } }
public string Type { get { throw null; } set { } }
public string? Type { get { throw null; } set { } }
public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; }
public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; }
}
Expand Down
16 changes: 8 additions & 8 deletions sdk/core/Azure.Core/src/Messaging/CloudEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CloudEvent
/// <param name="jsonSerializableData"> Event data specific to the event type. </param>
/// <param name="dataSerializationType">The type to use when serializing the data.
/// If not specified, <see cref="object.GetType()"/> will be used on <paramref name="jsonSerializableData"/>.</param>
public CloudEvent(string source, string type, object jsonSerializableData, Type? dataSerializationType = default)
public CloudEvent(string source, string type, object? jsonSerializableData, Type? dataSerializationType = default)
{
if (jsonSerializableData is BinaryData)
{
Expand All @@ -39,7 +39,7 @@ public CloudEvent(string source, string type, object jsonSerializableData, Type?
/// <param name="data"> Binary event data specific to the event type. </param>
/// <param name="dataContentType"> Content type of the payload. A content type different from "application/json" should be specified if payload is not JSON. </param>
/// <param name="dataFormat"></param>
public CloudEvent(string source, string type, BinaryData data, string dataContentType, CloudEventDataFormat dataFormat = CloudEventDataFormat.Binary)
public CloudEvent(string source, string type, BinaryData? data, string? dataContentType, CloudEventDataFormat dataFormat = CloudEventDataFormat.Binary)
{
Source = source;
Type = type;
Expand All @@ -62,11 +62,11 @@ internal CloudEvent() { }
/// 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
public string? Id
{
get
{
return _id!;
return _id;
}
set
{
Expand All @@ -80,11 +80,11 @@ public string Id

/// <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
public string? Source
{
get
{
return _source!;
return _source;
}
set
{
Expand All @@ -95,11 +95,11 @@ public string Source
private string? _source;

/// <summary>Gets or sets the type of event related to the originating occurrence.</summary>
public string Type
public string? Type
{
get
{
return _type!;
return _type;
}
set
{
Expand Down
Loading

0 comments on commit da9e91b

Please sign in to comment.