From 46f75befc1766bb62223a2677c223f8774703d5a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 30 Aug 2023 21:47:08 +0000 Subject: [PATCH] CodeGen from PR 25393 in Azure/azure-rest-api-specs Merge 8feba720ab02d37c951c8c7cb1fa7c2cc3c73f2a into ac44b88ba4c8c6c9a9ca67c230d3b44b49f1ee9a --- ...zure.Messaging.EventGrid.netstandard2.0.cs | 20 ++++++ .../src/Generated/EventGridModelFactory.cs | 30 +++++++++ ...nSnapshotCreatedEventData.Serialization.cs | 61 +++++++++++++++++++ ...ppConfigurationSnapshotCreatedEventData.cs | 26 ++++++++ ...gurationSnapshotEventData.Serialization.cs | 61 +++++++++++++++++++ .../AppConfigurationSnapshotEventData.cs | 36 +++++++++++ ...SnapshotModifiedEventData.Serialization.cs | 61 +++++++++++++++++++ ...pConfigurationSnapshotModifiedEventData.cs | 26 ++++++++ .../Azure.Messaging.EventGrid/src/autorest.md | 5 +- 9 files changed, 325 insertions(+), 1 deletion(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index cac68b6fbd64..6b8fb7ea77e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -111,6 +111,9 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData ApiManagementUserUpdatedEventData(string resourceUri = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueDeletedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData AppConfigurationKeyValueModifiedEventData(string key = null, string label = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null) { throw null; } @@ -383,6 +386,8 @@ public static partial class SystemEventNames public const string ApiManagementUserUpdated = "Microsoft.ApiManagement.UserUpdated"; public const string AppConfigurationKeyValueDeleted = "Microsoft.AppConfiguration.KeyValueDeleted"; public const string AppConfigurationKeyValueModified = "Microsoft.AppConfiguration.KeyValueModified"; + public const string AppConfigurationSnapshotCreated = "Microsoft.AppConfiguration.SnapshotCreated"; + public const string AppConfigurationSnapshotModified = "Microsoft.AppConfiguration.SnapshotModified"; public const string ContainerRegistryChartDeleted = "Microsoft.ContainerRegistry.ChartDeleted"; public const string ContainerRegistryChartPushed = "Microsoft.ContainerRegistry.ChartPushed"; public const string ContainerRegistryImageDeleted = "Microsoft.ContainerRegistry.ImageDeleted"; @@ -1093,6 +1098,21 @@ internal AppConfigurationKeyValueModifiedEventData() { } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } } + public partial class AppConfigurationSnapshotCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotCreatedEventData() { } + } + public partial class AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotEventData() { } + public string Etag { get { throw null; } } + public string Name { get { throw null; } } + public string SyncToken { get { throw null; } } + } + public partial class AppConfigurationSnapshotModifiedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData + { + internal AppConfigurationSnapshotModifiedEventData() { } + } public partial class AppEventTypeDetail { internal AppEventTypeDetail() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 949bd7a5dd8d..9bb3f9c0e8d8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -1086,6 +1086,36 @@ public static AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueD return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken); } + /// Initializes a new instance of AppConfigurationSnapshotEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotEventData(name, etag, syncToken); + } + + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotCreatedEventData(name, etag, syncToken); + } + + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + /// A new instance for mocking. + public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) + { + return new AppConfigurationSnapshotModifiedEventData(name, etag, syncToken); + } + /// Initializes a new instance of SignalRServiceClientConnectionConnectedEventData. /// The time at which the event occurred. /// The hub of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs new file mode 100644 index 000000000000..fc51ea60fa5d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotCreatedEventDataConverter))] + public partial class AppConfigurationSnapshotCreatedEventData + { + internal static AppConfigurationSnapshotCreatedEventData DeserializeAppConfigurationSnapshotCreatedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotCreatedEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotCreatedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs new file mode 100644 index 000000000000..3c7cda555e09 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotCreatedEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotCreated event. + public partial class AppConfigurationSnapshotCreatedEventData : AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + internal AppConfigurationSnapshotCreatedEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotCreatedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotCreatedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs new file mode 100644 index 000000000000..822ccd440d0b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotEventDataConverter))] + public partial class AppConfigurationSnapshotEventData + { + internal static AppConfigurationSnapshotEventData DeserializeAppConfigurationSnapshotEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs new file mode 100644 index 000000000000..5aaaa39d9d98 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotEventData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of snapshot events. + public partial class AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotEventData. + internal AppConfigurationSnapshotEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotEventData(string name, string etag, string syncToken) + { + Name = name; + Etag = etag; + SyncToken = syncToken; + } + + /// The name of the snapshot. + public string Name { get; } + /// The etag representing the new state of the snapshot. + public string Etag { get; } + /// The sync token representing the server state after the event. + public string SyncToken { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs new file mode 100644 index 000000000000..bbebcd9cde47 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AppConfigurationSnapshotModifiedEventDataConverter))] + public partial class AppConfigurationSnapshotModifiedEventData + { + internal static AppConfigurationSnapshotModifiedEventData DeserializeAppConfigurationSnapshotModifiedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional etag = default; + Optional syncToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag"u8)) + { + etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncToken"u8)) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationSnapshotModifiedEventData(name.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationSnapshotModifiedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotModifiedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AppConfigurationSnapshotModifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs new file mode 100644 index 000000000000..02a7096ba3d2 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationSnapshotModifiedEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotModified event. + public partial class AppConfigurationSnapshotModifiedEventData : AppConfigurationSnapshotEventData + { + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + internal AppConfigurationSnapshotModifiedEventData() + { + } + + /// Initializes a new instance of AppConfigurationSnapshotModifiedEventData. + /// The name of the snapshot. + /// The etag representing the new state of the snapshot. + /// The sync token representing the server state after the event. + internal AppConfigurationSnapshotModifiedEventData(string name, string etag, string syncToken) : base(name, etag, syncToken) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index 6de471d7d767..73e2f1733895 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -4,7 +4,9 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/eventgrid/data-plane/readme.md +require: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventgrid/data-plane/readme.md + generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset @@ -172,3 +174,4 @@ directive: $.MediaLiveEventIngestHeartbeatEventData["properties"]["ingestDriftValue"]["x-ms-client-name"] = "IngestDriftValueInternal"; $.MediaLiveEventIngestHeartbeatEventData["properties"]["lastFragmentArrivalTime"]["format"] = "date-time"; ``` +