diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs
index 6333520b7dc2..2bf401df1344 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs
@@ -1979,6 +1979,139 @@ public static TaskResource TaskResource(string id = null, DateTimeOffset? starte
serializedAdditionalRawData: null);
}
+ /// Initializes a new instance of .
+ /// The total number of elements.
+ /// The summary of observation counts by priority.
+ /// The list of observation results.
+ /// A new instance for mocking.
+ public static ObservationPageResult ObservationPageResult(long totalElements = default, IReadOnlyDictionary prioritySummary = null, IEnumerable value = null)
+ {
+ prioritySummary ??= new Dictionary();
+ value ??= new List();
+
+ return new ObservationPageResult(totalElements, prioritySummary, value?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the observation.
+ /// The list of applicable types.
+ /// The priority of the observation.
+ /// The CVSS v2 score.
+ /// The CVSS v3 score.
+ /// A new instance for mocking.
+ public static ObservationResult ObservationResult(string name = null, IEnumerable types = null, ObservationPriority priority = default, double cvssScoreV2 = default, double cvssScoreV3 = default)
+ {
+ types ??= new List();
+
+ return new ObservationResult(
+ name,
+ types?.ToList(),
+ priority,
+ cvssScoreV2,
+ cvssScoreV3,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The type of delta detail to retrieve.
+ /// The number of days prior to retrieve deltas for.
+ /// The type of asset.
+ /// expected format to be: yyyy-MM-dd.
+ /// A new instance for mocking.
+ public static DeltaDetailsRequest DeltaDetailsRequest(DeltaDetailType deltaDetailType = default, int? priorDays = null, GlobalAssetType kind = default, string date = null)
+ {
+ return new DeltaDetailsRequest(deltaDetailType, priorDays, kind, date, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Shows the asset kind.
+ /// Shows the asset name.
+ /// Shows the date when the asset was originally created.
+ /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for.
+ /// Shows the inventory state.
+ /// A new instance for mocking.
+ public static DeltaResult DeltaResult(GlobalAssetType kind = default, string name = null, DateTimeOffset createdAt = default, DateTimeOffset updatedAt = default, GlobalInventoryState state = default)
+ {
+ return new DeltaResult(
+ kind,
+ name,
+ createdAt,
+ updatedAt,
+ state,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Contains added, removed, and difference values for the whole range either 7 or 30 days.
+ /// Contains added, removed, count, and difference values for each day.
+ /// A new instance for mocking.
+ public static DeltaSummaryResult DeltaSummaryResult(DeltaRangeResult summary = null, IEnumerable daily = null)
+ {
+ daily ??= new List();
+
+ return new DeltaSummaryResult(summary, daily?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The range of dates requested.
+ /// The total amount of assets removed over a date range.
+ /// The total amount of assets added over a date range.
+ /// The total amount of assets changed removed over a date range.
+ /// A list of summary changes per asset kind.
+ /// A new instance for mocking.
+ public static DeltaRangeResult DeltaRangeResult(long range = default, long removed = default, long added = default, long difference = default, IEnumerable kindSummaries = null)
+ {
+ kindSummaries ??= new List();
+
+ return new DeltaRangeResult(
+ range,
+ removed,
+ added,
+ difference,
+ kindSummaries?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets removed for one asset kind.
+ /// The amount of assets added for one asset kind.
+ /// The amount of assets changed for one asset kind.
+ /// A new instance for mocking.
+ public static DeltaTypeResponse DeltaTypeResponse(GlobalAssetType kind = default, long removed = default, long added = default, long difference = default)
+ {
+ return new DeltaTypeResponse(kind, removed, added, difference, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The date that is being requested.
+ /// A list of summary counts per day.
+ /// A new instance for mocking.
+ public static DeltaDateResult DeltaDateResult(DateTimeOffset date = default, IEnumerable deltas = null)
+ {
+ deltas ??= new List();
+
+ return new DeltaDateResult(date, deltas?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets removed for one asset kind.
+ /// The amount of assets added for one asset kind.
+ /// The amount of assets changed for one asset kind.
+ /// The current number of assets for one asset kind.
+ /// A new instance for mocking.
+ public static DailyDeltaTypeResponse DailyDeltaTypeResponse(GlobalAssetType kind = default, long removed = default, long added = default, long difference = default, long count = default)
+ {
+ return new DailyDeltaTypeResponse(
+ kind,
+ removed,
+ added,
+ difference,
+ serializedAdditionalRawData: null,
+ count);
+ }
+
/// Initializes a new instance of .
/// Discriminator property for DataConnection.
/// The system generated unique id for the resource.
@@ -2218,6 +2351,47 @@ public static DiscoveryRunResult DiscoveryRunResult(DateTimeOffset? submittedDat
serializedAdditionalRawData: null);
}
+ /// Initializes a new instance of .
+ /// A list of asset chain summaries per asset kind.
+ /// A list of disco group summaries.
+ /// The list of exceptions.
+ /// A new instance for mocking.
+ public static AssetChainSummaryResult AssetChainSummaryResult(IEnumerable affectedAssetsSummary = null, IEnumerable affectedGroupsSummary = null, IEnumerable errors = null)
+ {
+ affectedAssetsSummary ??= new List();
+ affectedGroupsSummary ??= new List();
+ errors ??= new List();
+
+ return new AssetChainSummaryResult(affectedAssetsSummary?.ToList(), affectedGroupsSummary?.ToList(), errors?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets affected for a given asset kind.
+ /// A new instance for mocking.
+ public static AssetChainKindSummaryResult AssetChainKindSummaryResult(AssetKind kind = default, long affectedCount = default)
+ {
+ return new AssetChainKindSummaryResult(kind, affectedCount, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The system generated unique id for the resource.
+ /// The caller provided unique name for the resource.
+ /// The name that can be used for display purposes.
+ /// A new instance for mocking.
+ public static DiscoGroupSummaryResult DiscoGroupSummaryResult(string id = null, string name = null, string displayName = null)
+ {
+ return new DiscoGroupSummaryResult(id, name, displayName, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The error object.
+ /// A new instance for mocking.
+ public static ErrorResponse ErrorResponse(ResponseError error = null)
+ {
+ return new ErrorResponse(error, serializedAdditionalRawData: null);
+ }
+
/// Initializes a new instance of .
/// The system generated unique id for the resource.
/// The caller provided unique name for the resource.
@@ -2374,5 +2548,35 @@ public static SavedFilter SavedFilter(string id = null, string name = null, stri
description,
serializedAdditionalRawData: null);
}
+
+ /// Initializes a new instance of .
+ /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits.
+ /// The vendor or project name for the vulnerability.
+ /// The vulnerability product.
+ /// The name of the vulnerability.
+ /// A short description of the vulnerability.
+ /// The required action to address the vulnerability.
+ /// Any additional notes about the vulnerability.
+ /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD.
+ /// The date the required action is due in the format YYYY-MM-DD.
+ /// The date the vulnerability was updated.
+ /// The number of assets affected by the vulnerability.
+ /// A new instance for mocking.
+ public static CisaCveResult CisaCveResult(string cveId = null, string vendorProject = null, string product = null, string vulnerabilityName = null, string shortDescription = null, string requiredAction = null, string notes = null, DateTimeOffset dateAdded = default, DateTimeOffset dueDate = default, DateTimeOffset updatedAt = default, long count = default)
+ {
+ return new CisaCveResult(
+ cveId,
+ vendorProject,
+ product,
+ vulnerabilityName,
+ shortDescription,
+ requiredAction,
+ notes,
+ dateAdded,
+ dueDate,
+ updatedAt,
+ count,
+ serializedAdditionalRawData: null);
+ }
}
}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs
new file mode 100644
index 000000000000..26d0aef4c3ac
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs
@@ -0,0 +1,143 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class AssetChainKindSummaryResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WritePropertyName("affectedCount"u8);
+ writer.WriteNumberValue(AffectedCount);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ AssetChainKindSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssetChainKindSummaryResult(document.RootElement, options);
+ }
+
+ internal static AssetChainKindSummaryResult DeserializeAssetChainKindSummaryResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ AssetKind kind = default;
+ long affectedCount = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new AssetKind(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("affectedCount"u8))
+ {
+ affectedCount = property.Value.GetInt64();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AssetChainKindSummaryResult(kind, affectedCount, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AssetChainKindSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAssetChainKindSummaryResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AssetChainKindSummaryResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAssetChainKindSummaryResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs
new file mode 100644
index 000000000000..255ca689194f
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A list of asset chain summaries per asset kind.
+ public partial class AssetChainKindSummaryResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets affected for a given asset kind.
+ internal AssetChainKindSummaryResult(AssetKind kind, long affectedCount)
+ {
+ Kind = kind;
+ AffectedCount = affectedCount;
+ }
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets affected for a given asset kind.
+ /// Keeps track of any properties unknown to the library.
+ internal AssetChainKindSummaryResult(AssetKind kind, long affectedCount, IDictionary serializedAdditionalRawData)
+ {
+ Kind = kind;
+ AffectedCount = affectedCount;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AssetChainKindSummaryResult()
+ {
+ }
+
+ /// The kind of asset.
+ public AssetKind Kind { get; }
+ /// The amount of assets affected for a given asset kind.
+ public long AffectedCount { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs
new file mode 100644
index 000000000000..41374cb8a377
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class AssetChainRequest : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainRequest)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("assetChainSource"u8);
+ writer.WriteStringValue(AssetChainSource.ToString());
+ writer.WritePropertyName("sourceIds"u8);
+ writer.WriteStartArray();
+ foreach (var item in SourceIds)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ AssetChainRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainRequest)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssetChainRequest(document.RootElement, options);
+ }
+
+ internal static AssetChainRequest DeserializeAssetChainRequest(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ AssetChainSource assetChainSource = default;
+ IList sourceIds = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("assetChainSource"u8))
+ {
+ assetChainSource = new AssetChainSource(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("sourceIds"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ sourceIds = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AssetChainRequest(assetChainSource, sourceIds, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AssetChainRequest)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AssetChainRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAssetChainRequest(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AssetChainRequest)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AssetChainRequest FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAssetChainRequest(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs
new file mode 100644
index 000000000000..31ae0976c45c
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// AssetChainRequest containing information needed for the retrieval of the asset chain summary.
+ public partial class AssetChainRequest
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Asset chain source.
+ /// A collection of asset chain source ids.
+ /// is null.
+ public AssetChainRequest(AssetChainSource assetChainSource, IEnumerable sourceIds)
+ {
+ Argument.AssertNotNull(sourceIds, nameof(sourceIds));
+
+ AssetChainSource = assetChainSource;
+ SourceIds = sourceIds.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// Asset chain source.
+ /// A collection of asset chain source ids.
+ /// Keeps track of any properties unknown to the library.
+ internal AssetChainRequest(AssetChainSource assetChainSource, IList sourceIds, IDictionary serializedAdditionalRawData)
+ {
+ AssetChainSource = assetChainSource;
+ SourceIds = sourceIds;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AssetChainRequest()
+ {
+ }
+
+ /// Asset chain source.
+ public AssetChainSource AssetChainSource { get; }
+ /// A collection of asset chain source ids.
+ public IList SourceIds { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs
new file mode 100644
index 000000000000..954a437fd2a3
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A list of asset chain sources.
+ public readonly partial struct AssetChainSource : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AssetChainSource(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string DISCOGROUPValue = "DISCO_GROUP";
+ private const string ASSETValue = "ASSET";
+
+ /// discovery group.
+ public static AssetChainSource DISCOGROUP { get; } = new AssetChainSource(DISCOGROUPValue);
+ /// asset.
+ public static AssetChainSource ASSET { get; } = new AssetChainSource(ASSETValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AssetChainSource left, AssetChainSource right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AssetChainSource left, AssetChainSource right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator AssetChainSource(string value) => new AssetChainSource(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AssetChainSource other && Equals(other);
+ ///
+ public bool Equals(AssetChainSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs
new file mode 100644
index 000000000000..15cfb6fd12a4
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs
@@ -0,0 +1,188 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class AssetChainSummaryResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("affectedAssetsSummary"u8);
+ writer.WriteStartArray();
+ foreach (var item in AffectedAssetsSummary)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ writer.WritePropertyName("affectedGroupsSummary"u8);
+ writer.WriteStartArray();
+ foreach (var item in AffectedGroupsSummary)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (Optional.IsCollectionDefined(Errors))
+ {
+ writer.WritePropertyName("errors"u8);
+ writer.WriteStartArray();
+ foreach (var item in Errors)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ AssetChainSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssetChainSummaryResult(document.RootElement, options);
+ }
+
+ internal static AssetChainSummaryResult DeserializeAssetChainSummaryResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList affectedAssetsSummary = default;
+ IReadOnlyList affectedGroupsSummary = default;
+ IReadOnlyList errors = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("affectedAssetsSummary"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(AssetChainKindSummaryResult.DeserializeAssetChainKindSummaryResult(item, options));
+ }
+ affectedAssetsSummary = array;
+ continue;
+ }
+ if (property.NameEquals("affectedGroupsSummary"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DiscoGroupSummaryResult.DeserializeDiscoGroupSummaryResult(item, options));
+ }
+ affectedGroupsSummary = array;
+ continue;
+ }
+ if (property.NameEquals("errors"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ErrorResponse.DeserializeErrorResponse(item, options));
+ }
+ errors = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AssetChainSummaryResult(affectedAssetsSummary, affectedGroupsSummary, errors ?? new ChangeTrackingList(), serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AssetChainSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAssetChainSummaryResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AssetChainSummaryResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAssetChainSummaryResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs
new file mode 100644
index 000000000000..b97b8cdb4826
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// Response for the asset chain summary.
+ public partial class AssetChainSummaryResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// A list of asset chain summaries per asset kind.
+ /// A list of disco group summaries.
+ /// or is null.
+ internal AssetChainSummaryResult(IEnumerable affectedAssetsSummary, IEnumerable affectedGroupsSummary)
+ {
+ Argument.AssertNotNull(affectedAssetsSummary, nameof(affectedAssetsSummary));
+ Argument.AssertNotNull(affectedGroupsSummary, nameof(affectedGroupsSummary));
+
+ AffectedAssetsSummary = affectedAssetsSummary.ToList();
+ AffectedGroupsSummary = affectedGroupsSummary.ToList();
+ Errors = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// A list of asset chain summaries per asset kind.
+ /// A list of disco group summaries.
+ /// The list of exceptions.
+ /// Keeps track of any properties unknown to the library.
+ internal AssetChainSummaryResult(IReadOnlyList affectedAssetsSummary, IReadOnlyList affectedGroupsSummary, IReadOnlyList errors, IDictionary serializedAdditionalRawData)
+ {
+ AffectedAssetsSummary = affectedAssetsSummary;
+ AffectedGroupsSummary = affectedGroupsSummary;
+ Errors = errors;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AssetChainSummaryResult()
+ {
+ }
+
+ /// A list of asset chain summaries per asset kind.
+ public IReadOnlyList AffectedAssetsSummary { get; }
+ /// A list of disco group summaries.
+ public IReadOnlyList AffectedGroupsSummary { get; }
+ /// The list of exceptions.
+ public IReadOnlyList Errors { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs
new file mode 100644
index 000000000000..971d63ae8fd7
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// The kind of asset.
+ public readonly partial struct AssetKind : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AssetKind(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string AsValue = "as";
+ private const string ContactValue = "contact";
+ private const string DomainValue = "domain";
+ private const string HostValue = "host";
+ private const string IpAddressValue = "ipAddress";
+ private const string IpBlockValue = "ipBlock";
+ private const string PageValue = "page";
+ private const string SslCertValue = "sslCert";
+
+ /// as.
+ public static AssetKind As { get; } = new AssetKind(AsValue);
+ /// contact.
+ public static AssetKind Contact { get; } = new AssetKind(ContactValue);
+ /// domain.
+ public static AssetKind Domain { get; } = new AssetKind(DomainValue);
+ /// host.
+ public static AssetKind Host { get; } = new AssetKind(HostValue);
+ /// ipAddress.
+ public static AssetKind IpAddress { get; } = new AssetKind(IpAddressValue);
+ /// ipBlock.
+ public static AssetKind IpBlock { get; } = new AssetKind(IpBlockValue);
+ /// page.
+ public static AssetKind Page { get; } = new AssetKind(PageValue);
+ /// sslCert.
+ public static AssetKind SslCert { get; } = new AssetKind(SslCertValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AssetKind left, AssetKind right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AssetKind left, AssetKind right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator AssetKind(string value) => new AssetKind(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AssetKind other && Equals(other);
+ ///
+ public bool Equals(AssetKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs
new file mode 100644
index 000000000000..662ea951ed20
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A list of asset response type.
+ public readonly partial struct AssetResponseType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AssetResponseType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string IdValue = "id";
+ private const string StandardValue = "standard";
+ private const string FullValue = "full";
+ private const string ReducedValue = "reduced";
+
+ /// Return only the asset id.
+ public static AssetResponseType Id { get; } = new AssetResponseType(IdValue);
+ /// Return the standard set of asset fields.
+ public static AssetResponseType Standard { get; } = new AssetResponseType(StandardValue);
+ /// Return the full set of asset fields.
+ public static AssetResponseType Full { get; } = new AssetResponseType(FullValue);
+ /// Return a reduced set of fields.
+ public static AssetResponseType Reduced { get; } = new AssetResponseType(ReducedValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AssetResponseType left, AssetResponseType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AssetResponseType left, AssetResponseType right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator AssetResponseType(string value) => new AssetResponseType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AssetResponseType other && Equals(other);
+ ///
+ public bool Equals(AssetResponseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs
new file mode 100644
index 000000000000..df18ef2d43cd
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class AssetsExportRequest : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("fileName"u8);
+ writer.WriteStringValue(FileName);
+ writer.WritePropertyName("columns"u8);
+ writer.WriteStartArray();
+ foreach (var item in Columns)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ AssetsExportRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssetsExportRequest(document.RootElement, options);
+ }
+
+ internal static AssetsExportRequest DeserializeAssetsExportRequest(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string fileName = default;
+ IList columns = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("fileName"u8))
+ {
+ fileName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("columns"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ columns = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AssetsExportRequest(fileName, columns, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AssetsExportRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAssetsExportRequest(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AssetsExportRequest FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAssetsExportRequest(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs
new file mode 100644
index 000000000000..a32f3acef2e9
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A request body used to export an asset.
+ public partial class AssetsExportRequest
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The name of the file to export.
+ /// The columns to export.
+ /// or is null.
+ public AssetsExportRequest(string fileName, IEnumerable columns)
+ {
+ Argument.AssertNotNull(fileName, nameof(fileName));
+ Argument.AssertNotNull(columns, nameof(columns));
+
+ FileName = fileName;
+ Columns = columns.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the file to export.
+ /// The columns to export.
+ /// Keeps track of any properties unknown to the library.
+ internal AssetsExportRequest(string fileName, IList columns, IDictionary serializedAdditionalRawData)
+ {
+ FileName = fileName;
+ Columns = columns;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AssetsExportRequest()
+ {
+ }
+
+ /// The name of the file to export.
+ public string FileName { get; }
+ /// The columns to export.
+ public IList Columns { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs
index b98a0f227ee5..10d82d783d74 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs
@@ -25,7 +25,7 @@ public AzureDataExplorerDataConnectionPayload(AzureDataExplorerDataConnectionPro
}
/// Initializes a new instance of .
- /// Discriminator property for DataConnectionPayload.
+ /// Discriminator property for DataConnectionData.
/// The name of data connection.
/// The type of data the data connection will transfer.
/// The rate at which the data connection will receive updates.
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs
new file mode 100644
index 000000000000..9e20c938f789
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs
@@ -0,0 +1,230 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class CisaCveResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CisaCveResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("cveId"u8);
+ writer.WriteStringValue(CveId);
+ }
+ writer.WritePropertyName("vendorProject"u8);
+ writer.WriteStringValue(VendorProject);
+ writer.WritePropertyName("product"u8);
+ writer.WriteStringValue(Product);
+ writer.WritePropertyName("vulnerabilityName"u8);
+ writer.WriteStringValue(VulnerabilityName);
+ writer.WritePropertyName("shortDescription"u8);
+ writer.WriteStringValue(ShortDescription);
+ writer.WritePropertyName("requiredAction"u8);
+ writer.WriteStringValue(RequiredAction);
+ writer.WritePropertyName("notes"u8);
+ writer.WriteStringValue(Notes);
+ writer.WritePropertyName("dateAdded"u8);
+ writer.WriteStringValue(DateAdded, "O");
+ writer.WritePropertyName("dueDate"u8);
+ writer.WriteStringValue(DueDate, "O");
+ writer.WritePropertyName("updatedAt"u8);
+ writer.WriteStringValue(UpdatedAt, "O");
+ writer.WritePropertyName("count"u8);
+ writer.WriteNumberValue(Count);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ CisaCveResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CisaCveResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCisaCveResult(document.RootElement, options);
+ }
+
+ internal static CisaCveResult DeserializeCisaCveResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string cveId = default;
+ string vendorProject = default;
+ string product = default;
+ string vulnerabilityName = default;
+ string shortDescription = default;
+ string requiredAction = default;
+ string notes = default;
+ DateTimeOffset dateAdded = default;
+ DateTimeOffset dueDate = default;
+ DateTimeOffset updatedAt = default;
+ long count = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("cveId"u8))
+ {
+ cveId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("vendorProject"u8))
+ {
+ vendorProject = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("product"u8))
+ {
+ product = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("vulnerabilityName"u8))
+ {
+ vulnerabilityName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("shortDescription"u8))
+ {
+ shortDescription = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("requiredAction"u8))
+ {
+ requiredAction = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("notes"u8))
+ {
+ notes = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("dateAdded"u8))
+ {
+ dateAdded = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("dueDate"u8))
+ {
+ dueDate = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("updatedAt"u8))
+ {
+ updatedAt = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("count"u8))
+ {
+ count = property.Value.GetInt64();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new CisaCveResult(
+ cveId,
+ vendorProject,
+ product,
+ vulnerabilityName,
+ shortDescription,
+ requiredAction,
+ notes,
+ dateAdded,
+ dueDate,
+ updatedAt,
+ count,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(CisaCveResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CisaCveResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeCisaCveResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CisaCveResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static CisaCveResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeCisaCveResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs
new file mode 100644
index 000000000000..b232b946b07f
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// cisa cve in a given workspace.
+ public partial class CisaCveResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The vendor or project name for the vulnerability.
+ /// The vulnerability product.
+ /// The name of the vulnerability.
+ /// A short description of the vulnerability.
+ /// The required action to address the vulnerability.
+ /// Any additional notes about the vulnerability.
+ /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD.
+ /// The date the required action is due in the format YYYY-MM-DD.
+ /// The date the vulnerability was updated.
+ /// The number of assets affected by the vulnerability.
+ /// , , , , or is null.
+ internal CisaCveResult(string vendorProject, string product, string vulnerabilityName, string shortDescription, string requiredAction, string notes, DateTimeOffset dateAdded, DateTimeOffset dueDate, DateTimeOffset updatedAt, long count)
+ {
+ Argument.AssertNotNull(vendorProject, nameof(vendorProject));
+ Argument.AssertNotNull(product, nameof(product));
+ Argument.AssertNotNull(vulnerabilityName, nameof(vulnerabilityName));
+ Argument.AssertNotNull(shortDescription, nameof(shortDescription));
+ Argument.AssertNotNull(requiredAction, nameof(requiredAction));
+ Argument.AssertNotNull(notes, nameof(notes));
+
+ VendorProject = vendorProject;
+ Product = product;
+ VulnerabilityName = vulnerabilityName;
+ ShortDescription = shortDescription;
+ RequiredAction = requiredAction;
+ Notes = notes;
+ DateAdded = dateAdded;
+ DueDate = dueDate;
+ UpdatedAt = updatedAt;
+ Count = count;
+ }
+
+ /// Initializes a new instance of .
+ /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits.
+ /// The vendor or project name for the vulnerability.
+ /// The vulnerability product.
+ /// The name of the vulnerability.
+ /// A short description of the vulnerability.
+ /// The required action to address the vulnerability.
+ /// Any additional notes about the vulnerability.
+ /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD.
+ /// The date the required action is due in the format YYYY-MM-DD.
+ /// The date the vulnerability was updated.
+ /// The number of assets affected by the vulnerability.
+ /// Keeps track of any properties unknown to the library.
+ internal CisaCveResult(string cveId, string vendorProject, string product, string vulnerabilityName, string shortDescription, string requiredAction, string notes, DateTimeOffset dateAdded, DateTimeOffset dueDate, DateTimeOffset updatedAt, long count, IDictionary serializedAdditionalRawData)
+ {
+ CveId = cveId;
+ VendorProject = vendorProject;
+ Product = product;
+ VulnerabilityName = vulnerabilityName;
+ ShortDescription = shortDescription;
+ RequiredAction = requiredAction;
+ Notes = notes;
+ DateAdded = dateAdded;
+ DueDate = dueDate;
+ UpdatedAt = updatedAt;
+ Count = count;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal CisaCveResult()
+ {
+ }
+
+ /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits.
+ public string CveId { get; }
+ /// The vendor or project name for the vulnerability.
+ public string VendorProject { get; }
+ /// The vulnerability product.
+ public string Product { get; }
+ /// The name of the vulnerability.
+ public string VulnerabilityName { get; }
+ /// A short description of the vulnerability.
+ public string ShortDescription { get; }
+ /// The required action to address the vulnerability.
+ public string RequiredAction { get; }
+ /// Any additional notes about the vulnerability.
+ public string Notes { get; }
+ /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD.
+ public DateTimeOffset DateAdded { get; }
+ /// The date the required action is due in the format YYYY-MM-DD.
+ public DateTimeOffset DueDate { get; }
+ /// The date the vulnerability was updated.
+ public DateTimeOffset UpdatedAt { get; }
+ /// The number of assets affected by the vulnerability.
+ public long Count { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs
new file mode 100644
index 000000000000..0655299fd965
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DailyDeltaTypeResponse : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("count"u8);
+ writer.WriteNumberValue(Count);
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WritePropertyName("removed"u8);
+ writer.WriteNumberValue(Removed);
+ writer.WritePropertyName("added"u8);
+ writer.WriteNumberValue(Added);
+ writer.WritePropertyName("difference"u8);
+ writer.WriteNumberValue(Difference);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DailyDeltaTypeResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDailyDeltaTypeResponse(document.RootElement, options);
+ }
+
+ internal static DailyDeltaTypeResponse DeserializeDailyDeltaTypeResponse(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ long count = default;
+ GlobalAssetType kind = default;
+ long removed = default;
+ long added = default;
+ long difference = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("count"u8))
+ {
+ count = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new GlobalAssetType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("removed"u8))
+ {
+ removed = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("added"u8))
+ {
+ added = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("difference"u8))
+ {
+ difference = property.Value.GetInt64();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DailyDeltaTypeResponse(
+ kind,
+ removed,
+ added,
+ difference,
+ serializedAdditionalRawData,
+ count);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DailyDeltaTypeResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDailyDeltaTypeResponse(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new DailyDeltaTypeResponse FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDailyDeltaTypeResponse(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs
new file mode 100644
index 000000000000..bf7813c7e4e5
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// Delta response for each day.
+ public partial class DailyDeltaTypeResponse : DeltaTypeResponse
+ {
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets removed for one asset kind.
+ /// The amount of assets added for one asset kind.
+ /// The amount of assets changed for one asset kind.
+ /// The current number of assets for one asset kind.
+ internal DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, long count) : base(kind, removed, added, difference)
+ {
+ Count = count;
+ }
+
+ /// Initializes a new instance of .
+ /// The kind of asset.
+ /// The amount of assets removed for one asset kind.
+ /// The amount of assets added for one asset kind.
+ /// The amount of assets changed for one asset kind.
+ /// Keeps track of any properties unknown to the library.
+ /// The current number of assets for one asset kind.
+ internal DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, IDictionary serializedAdditionalRawData, long count) : base(kind, removed, added, difference, serializedAdditionalRawData)
+ {
+ Count = count;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DailyDeltaTypeResponse()
+ {
+ }
+
+ /// The current number of assets for one asset kind.
+ public long Count { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs
index a10e83a8ee34..d059fceb8aa5 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs
@@ -55,7 +55,7 @@ protected DataConnectionPayload()
}
/// Initializes a new instance of .
- /// Discriminator property for DataConnectionPayload.
+ /// Discriminator property for DataConnectionData.
/// The name of data connection.
/// The type of data the data connection will transfer.
/// The rate at which the data connection will receive updates.
@@ -71,7 +71,7 @@ internal DataConnectionPayload(string kind, string name, DataConnectionContent?
_serializedAdditionalRawData = serializedAdditionalRawData;
}
- /// Discriminator property for DataConnectionPayload.
+ /// Discriminator property for DataConnectionData.
internal string Kind { get; set; }
/// The name of data connection.
public string Name { get; set; }
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs
new file mode 100644
index 000000000000..e2df53fc4e8f
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaDateResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaDateResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("date"u8);
+ writer.WriteStringValue(Date, "O");
+ writer.WritePropertyName("deltas"u8);
+ writer.WriteStartArray();
+ foreach (var item in Deltas)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaDateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaDateResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaDateResult(document.RootElement, options);
+ }
+
+ internal static DeltaDateResult DeserializeDeltaDateResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DateTimeOffset date = default;
+ IReadOnlyList deltas = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("date"u8))
+ {
+ date = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("deltas"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DailyDeltaTypeResponse.DeserializeDailyDeltaTypeResponse(item, options));
+ }
+ deltas = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaDateResult(date, deltas, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaDateResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaDateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDeltaDateResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DeltaDateResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DeltaDateResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDeltaDateResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs
new file mode 100644
index 000000000000..ee5af7f2ec93
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// Date information for the delta response.
+ public partial class DeltaDateResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The date that is being requested.
+ /// A list of summary counts per day.
+ /// is null.
+ internal DeltaDateResult(DateTimeOffset date, IEnumerable deltas)
+ {
+ Argument.AssertNotNull(deltas, nameof(deltas));
+
+ Date = date;
+ Deltas = deltas.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The date that is being requested.
+ /// A list of summary counts per day.
+ /// Keeps track of any properties unknown to the library.
+ internal DeltaDateResult(DateTimeOffset date, IReadOnlyList deltas, IDictionary serializedAdditionalRawData)
+ {
+ Date = date;
+ Deltas = deltas;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DeltaDateResult()
+ {
+ }
+
+ /// The date that is being requested.
+ public DateTimeOffset Date { get; }
+ /// A list of summary counts per day.
+ public IReadOnlyList Deltas { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs
new file mode 100644
index 000000000000..47e92ef2723d
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A list of delta detail type.
+ public readonly partial struct DeltaDetailType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DeltaDetailType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string AddedValue = "added";
+ private const string RemovedValue = "removed";
+
+ /// added.
+ public static DeltaDetailType Added { get; } = new DeltaDetailType(AddedValue);
+ /// removed.
+ public static DeltaDetailType Removed { get; } = new DeltaDetailType(RemovedValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DeltaDetailType left, DeltaDetailType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DeltaDetailType left, DeltaDetailType right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator DeltaDetailType(string value) => new DeltaDetailType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DeltaDetailType other && Equals(other);
+ ///
+ public bool Equals(DeltaDetailType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs
new file mode 100644
index 000000000000..5034fd50e00c
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaDetailsRequest : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("deltaDetailType"u8);
+ writer.WriteStringValue(DeltaDetailType.ToString());
+ if (Optional.IsDefined(PriorDays))
+ {
+ writer.WritePropertyName("priorDays"u8);
+ writer.WriteNumberValue(PriorDays.Value);
+ }
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ if (Optional.IsDefined(Date))
+ {
+ writer.WritePropertyName("date"u8);
+ writer.WriteStringValue(Date);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaDetailsRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaDetailsRequest(document.RootElement, options);
+ }
+
+ internal static DeltaDetailsRequest DeserializeDeltaDetailsRequest(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DeltaDetailType deltaDetailType = default;
+ int? priorDays = default;
+ GlobalAssetType kind = default;
+ string date = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("deltaDetailType"u8))
+ {
+ deltaDetailType = new DeltaDetailType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("priorDays"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ priorDays = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new GlobalAssetType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("date"u8))
+ {
+ date = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaDetailsRequest(deltaDetailType, priorDays, kind, date, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaDetailsRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDeltaDetailsRequest(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DeltaDetailsRequest FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDeltaDetailsRequest(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs
new file mode 100644
index 000000000000..42095a187362
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A request body used to retrieve a list of deltas.
+ public partial class DeltaDetailsRequest
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The type of delta detail to retrieve.
+ /// The type of asset.
+ public DeltaDetailsRequest(DeltaDetailType deltaDetailType, GlobalAssetType kind)
+ {
+ DeltaDetailType = deltaDetailType;
+ Kind = kind;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of delta detail to retrieve.
+ /// The number of days prior to retrieve deltas for.
+ /// The type of asset.
+ /// expected format to be: yyyy-MM-dd.
+ /// Keeps track of any properties unknown to the library.
+ internal DeltaDetailsRequest(DeltaDetailType deltaDetailType, int? priorDays, GlobalAssetType kind, string date, IDictionary serializedAdditionalRawData)
+ {
+ DeltaDetailType = deltaDetailType;
+ PriorDays = priorDays;
+ Kind = kind;
+ Date = date;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DeltaDetailsRequest()
+ {
+ }
+
+ /// The type of delta detail to retrieve.
+ public DeltaDetailType DeltaDetailType { get; }
+ /// The number of days prior to retrieve deltas for.
+ public int? PriorDays { get; set; }
+ /// The type of asset.
+ public GlobalAssetType Kind { get; }
+ /// expected format to be: yyyy-MM-dd.
+ public string Date { get; set; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs
new file mode 100644
index 000000000000..b20a31665806
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs
@@ -0,0 +1,183 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaRangeResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("range"u8);
+ writer.WriteNumberValue(Range);
+ writer.WritePropertyName("removed"u8);
+ writer.WriteNumberValue(Removed);
+ writer.WritePropertyName("added"u8);
+ writer.WriteNumberValue(Added);
+ writer.WritePropertyName("difference"u8);
+ writer.WriteNumberValue(Difference);
+ writer.WritePropertyName("kindSummaries"u8);
+ writer.WriteStartArray();
+ foreach (var item in KindSummaries)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaRangeResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaRangeResult(document.RootElement, options);
+ }
+
+ internal static DeltaRangeResult DeserializeDeltaRangeResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ long range = default;
+ long removed = default;
+ long added = default;
+ long difference = default;
+ IReadOnlyList kindSummaries = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("range"u8))
+ {
+ range = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("removed"u8))
+ {
+ removed = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("added"u8))
+ {
+ added = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("difference"u8))
+ {
+ difference = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("kindSummaries"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DeltaTypeResponse.DeserializeDeltaTypeResponse(item, options));
+ }
+ kindSummaries = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaRangeResult(
+ range,
+ removed,
+ added,
+ difference,
+ kindSummaries,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaRangeResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDeltaRangeResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DeltaRangeResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDeltaRangeResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs
new file mode 100644
index 000000000000..2a64af73cbc1
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// Contains added, removed, and difference values for the whole range either 7 or 30 days.
+ public partial class DeltaRangeResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The range of dates requested.
+ /// The total amount of assets removed over a date range.
+ /// The total amount of assets added over a date range.
+ /// The total amount of assets changed removed over a date range.
+ /// A list of summary changes per asset kind.
+ /// is null.
+ internal DeltaRangeResult(long range, long removed, long added, long difference, IEnumerable kindSummaries)
+ {
+ Argument.AssertNotNull(kindSummaries, nameof(kindSummaries));
+
+ Range = range;
+ Removed = removed;
+ Added = added;
+ Difference = difference;
+ KindSummaries = kindSummaries.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The range of dates requested.
+ /// The total amount of assets removed over a date range.
+ /// The total amount of assets added over a date range.
+ /// The total amount of assets changed removed over a date range.
+ /// A list of summary changes per asset kind.
+ /// Keeps track of any properties unknown to the library.
+ internal DeltaRangeResult(long range, long removed, long added, long difference, IReadOnlyList kindSummaries, IDictionary serializedAdditionalRawData)
+ {
+ Range = range;
+ Removed = removed;
+ Added = added;
+ Difference = difference;
+ KindSummaries = kindSummaries;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DeltaRangeResult()
+ {
+ }
+
+ /// The range of dates requested.
+ public long Range { get; }
+ /// The total amount of assets removed over a date range.
+ public long Removed { get; }
+ /// The total amount of assets added over a date range.
+ public long Added { get; }
+ /// The total amount of assets changed removed over a date range.
+ public long Difference { get; }
+ /// A list of summary changes per asset kind.
+ public IReadOnlyList KindSummaries { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs
new file mode 100644
index 000000000000..f4e149b5498e
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ writer.WritePropertyName("createdAt"u8);
+ writer.WriteStringValue(CreatedAt, "O");
+ writer.WritePropertyName("updatedAt"u8);
+ writer.WriteStringValue(UpdatedAt, "O");
+ writer.WritePropertyName("state"u8);
+ writer.WriteStringValue(State.ToString());
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaResult(document.RootElement, options);
+ }
+
+ internal static DeltaResult DeserializeDeltaResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ GlobalAssetType kind = default;
+ string name = default;
+ DateTimeOffset createdAt = default;
+ DateTimeOffset updatedAt = default;
+ GlobalInventoryState state = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new GlobalAssetType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdAt"u8))
+ {
+ createdAt = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("updatedAt"u8))
+ {
+ updatedAt = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("state"u8))
+ {
+ state = new GlobalInventoryState(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaResult(
+ kind,
+ name,
+ createdAt,
+ updatedAt,
+ state,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDeltaResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DeltaResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DeltaResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDeltaResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs
new file mode 100644
index 000000000000..574e2526e978
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// Result for each of the delta detail response.
+ public partial class DeltaResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Shows the asset kind.
+ /// Shows the asset name.
+ /// Shows the date when the asset was originally created.
+ /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for.
+ /// Shows the inventory state.
+ /// is null.
+ internal DeltaResult(GlobalAssetType kind, string name, DateTimeOffset createdAt, DateTimeOffset updatedAt, GlobalInventoryState state)
+ {
+ Argument.AssertNotNull(name, nameof(name));
+
+ Kind = kind;
+ Name = name;
+ CreatedAt = createdAt;
+ UpdatedAt = updatedAt;
+ State = state;
+ }
+
+ /// Initializes a new instance of .
+ /// Shows the asset kind.
+ /// Shows the asset name.
+ /// Shows the date when the asset was originally created.
+ /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for.
+ /// Shows the inventory state.
+ /// Keeps track of any properties unknown to the library.
+ internal DeltaResult(GlobalAssetType kind, string name, DateTimeOffset createdAt, DateTimeOffset updatedAt, GlobalInventoryState state, IDictionary serializedAdditionalRawData)
+ {
+ Kind = kind;
+ Name = name;
+ CreatedAt = createdAt;
+ UpdatedAt = updatedAt;
+ State = state;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DeltaResult()
+ {
+ }
+
+ /// Shows the asset kind.
+ public GlobalAssetType Kind { get; }
+ /// Shows the asset name.
+ public string Name { get; }
+ /// Shows the date when the asset was originally created.
+ public DateTimeOffset CreatedAt { get; }
+ /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for.
+ public DateTimeOffset UpdatedAt { get; }
+ /// Shows the inventory state.
+ public GlobalInventoryState State { get; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs
new file mode 100644
index 000000000000..5d81ed2d1590
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaSummaryRequest : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (Optional.IsDefined(PriorDays))
+ {
+ writer.WritePropertyName("priorDays"u8);
+ writer.WriteNumberValue(PriorDays.Value);
+ }
+ if (Optional.IsDefined(Date))
+ {
+ writer.WritePropertyName("date"u8);
+ writer.WriteStringValue(Date);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaSummaryRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaSummaryRequest(document.RootElement, options);
+ }
+
+ internal static DeltaSummaryRequest DeserializeDeltaSummaryRequest(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int? priorDays = default;
+ string date = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("priorDays"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ priorDays = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("date"u8))
+ {
+ date = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaSummaryRequest(priorDays, date, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaSummaryRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeDeltaSummaryRequest(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DeltaSummaryRequest FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeDeltaSummaryRequest(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs
new file mode 100644
index 000000000000..b28a577ccb9c
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ /// A request body used to retrieve a delta summary.
+ public partial class DeltaSummaryRequest
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public DeltaSummaryRequest()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The number of days prior to retrieve deltas for.
+ /// expected format to be: yyyy-MM-dd.
+ /// Keeps track of any properties unknown to the library.
+ internal DeltaSummaryRequest(int? priorDays, string date, IDictionary serializedAdditionalRawData)
+ {
+ PriorDays = priorDays;
+ Date = date;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The number of days prior to retrieve deltas for.
+ public int? PriorDays { get; set; }
+ /// expected format to be: yyyy-MM-dd.
+ public string Date { get; set; }
+ }
+}
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs
new file mode 100644
index 000000000000..bb74f2943fd8
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Defender.Easm
+{
+ public partial class DeltaSummaryResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ writer.WritePropertyName("summary"u8);
+ writer.WriteObjectValue(Summary, options);
+ writer.WritePropertyName("daily"u8);
+ writer.WriteStartArray();
+ foreach (var item in Daily)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ DeltaSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeltaSummaryResult(document.RootElement, options);
+ }
+
+ internal static DeltaSummaryResult DeserializeDeltaSummaryResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DeltaRangeResult summary = default;
+ IReadOnlyList daily = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("summary"u8))
+ {
+ summary = DeltaRangeResult.DeserializeDeltaRangeResult(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("daily"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DeltaDateResult.DeserializeDeltaDateResult(item, options));
+ }
+ daily = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DeltaSummaryResult(summary, daily, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DeltaSummaryResult IPersistableModel