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

Add system event converters and fix nullability of CloudEvent properties #19181

Merged
merged 2 commits into from
Mar 3, 2021
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
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