diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml
index 34d76f338750..08cd5e996cce 100644
--- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml
+++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml
@@ -1,3 +1,4 @@
directory: specification/ai/DocumentIntelligence
-commit: 28a0baf2c401a0b9bf839688c4d235398868835e
+commit: c42804d2563feb068280fc99b43f3f96deda85a9
repo: Azure/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs
new file mode 100644
index 000000000000..d49af5f2ce28
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs
@@ -0,0 +1,145 @@
+// 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 ActionParameters : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ActionParameters)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(Value))
+ {
+ writer.WritePropertyName("value"u8);
+ writer.WriteStringValue(Value);
+ }
+ 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
+ }
+ }
+ }
+
+ ActionParameters 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(ActionParameters)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeActionParameters(document.RootElement, options);
+ }
+
+ internal static ActionParameters DeserializeActionParameters(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string value = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("value"u8))
+ {
+ value = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ActionParameters(value, 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(ActionParameters)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ActionParameters 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 DeserializeActionParameters(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ActionParameters)} 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 ActionParameters FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeActionParameters(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/ActionParameters.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.cs
new file mode 100644
index 000000000000..54e07325de47
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.cs
@@ -0,0 +1,73 @@
+// 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
+{
+ /// This is an object that exists to provide a common schema definition for the action parameters.
+ public partial class ActionParameters
+ {
+ ///
+ /// 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 ActionParameters()
+ {
+ }
+
+ /// Initializes a new instance of .
+ ///
+ /// The value parameter that is used by the policy action. This is action specific,
+ /// for further information please refer to documentation here:
+ /// https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal ActionParameters(string value, IDictionary serializedAdditionalRawData)
+ {
+ Value = value;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ ///
+ /// The value parameter that is used by the policy action. This is action specific,
+ /// for further information please refer to documentation here:
+ /// https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine
+ ///
+ public string Value { get; set; }
+ }
+}
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..81af844b25c1 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs
@@ -54,7 +54,7 @@ public static AssetResource AssetResource(string kind = null, string id = null,
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The kind of asset.
@@ -1979,15 +1979,152 @@ 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.
+ /// The remediation state of the observation.
+ /// The source of the remediation state of the observation.
+ /// A new instance for mocking.
+ public static ObservationResult ObservationResult(string name = null, IEnumerable types = null, ObservationPriority priority = default, double cvssScoreV2 = default, double cvssScoreV3 = default, ObservationRemediationState remediationState = default, ObservationRemediationSource remediationSource = default)
+ {
+ types ??= new List();
+
+ return new ObservationResult(
+ name,
+ types?.ToList(),
+ priority,
+ cvssScoreV2,
+ cvssScoreV3,
+ remediationState,
+ remediationSource,
+ 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.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The type of data the data connection will transfer.
/// The date the data connection was created.
/// The rate at which the data connection will receive updates.
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
/// The date the data connection was last updated.
/// The date the data connection was last updated by user.
/// An indicator of whether the data connection is active.
@@ -2012,13 +2149,13 @@ public static DataConnection DataConnection(string kind = null, string id = null
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The type of data the data connection will transfer.
/// The date the data connection was created.
/// The rate at which the data connection will receive updates.
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
/// The date the data connection was last updated.
/// The date the data connection was last updated by user.
/// An indicator of whether the data connection is active.
@@ -2045,13 +2182,13 @@ public static LogAnalyticsDataConnection LogAnalyticsDataConnection(string id =
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The type of data the data connection will transfer.
/// The date the data connection was created.
/// The rate at which the data connection will receive updates.
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
/// The date the data connection was last updated.
/// The date the data connection was last updated by user.
/// An indicator of whether the data connection is active.
@@ -2153,7 +2290,7 @@ public static InnerError InnerError(string code = null, BinaryData value = null)
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The description for a disco group.
@@ -2218,6 +2355,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.
@@ -2358,7 +2536,7 @@ public static AssetSummaryResult AssetSummaryResult(string displayName = null, s
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
///
@@ -2374,5 +2552,65 @@ 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);
+ }
+
+ /// Initializes a new instance of .
+ /// This is typically the same as the name but might be different for different models.
+ /// The caller provided unique name for the resource.
+ /// The name that can be used for display purposes.
+ /// A human readable description of what the policy should do.
+ /// Name of the saved filter query to be used to select assets that are to be updated by a given policy.
+ /// Action specifying what the policy should do.
+ /// Number of assets in inventory that have been updated by this policy.
+ /// The unique name of the user that created the policy user@gmail.com.
+ /// The date this policy was created, in RFC3339 format.
+ /// The date this policy was last updated, in RFC3339 format.
+ /// Additional parameters needed to perform the policy action.
+ /// A new instance for mocking.
+ public static Policy Policy(string id = null, string name = null, string displayName = null, string description = null, string filterName = null, PolicyAction action = default, long? updatedAssetsCount = null, string user = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, ActionParameters actionParameters = null)
+ {
+ return new Policy(
+ id,
+ name,
+ displayName,
+ description,
+ filterName,
+ action,
+ updatedAssetsCount,
+ user,
+ createdDate,
+ updatedDate,
+ actionParameters,
+ 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..25cafa406d9c
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs
@@ -0,0 +1,150 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..0eccf084f7ca
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs
@@ -0,0 +1,160 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..0ef98b3e3b64
--- /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 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..6e3ce77c7c3a
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs
@@ -0,0 +1,195 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..92da5b5a4e53
--- /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 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..ff23400e2008
--- /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 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/AssetUpdatePayload.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs
index e7bcafeca0d2..6635c8f39544 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs
@@ -60,6 +60,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WritePropertyName("transfers"u8);
writer.WriteStringValue(Transfers.Value.ToString());
}
+ if (Optional.IsCollectionDefined(Remediations))
+ {
+ writer.WritePropertyName("remediations"u8);
+ writer.WriteStartArray();
+ foreach (var item in Remediations)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
if (options.Format != "W" && _serializedAdditionalRawData != null)
{
foreach (var item in _serializedAdditionalRawData)
@@ -101,6 +111,7 @@ internal static AssetUpdatePayload DeserializeAssetUpdatePayload(JsonElement ele
string externalId = default;
IDictionary labels = default;
AssetUpdateTransfers? transfers = default;
+ IList remediations = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
@@ -142,13 +153,33 @@ internal static AssetUpdatePayload DeserializeAssetUpdatePayload(JsonElement ele
transfers = new AssetUpdateTransfers(property.Value.GetString());
continue;
}
+ if (property.NameEquals("remediations"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ObservationRemediationItem.DeserializeObservationRemediationItem(item, options));
+ }
+ remediations = array;
+ continue;
+ }
if (options.Format != "W")
{
rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new AssetUpdatePayload(state, externalId, labels ?? new ChangeTrackingDictionary(), transfers, serializedAdditionalRawData);
+ return new AssetUpdatePayload(
+ state,
+ externalId,
+ labels ?? new ChangeTrackingDictionary(),
+ transfers,
+ remediations ?? new ChangeTrackingList(),
+ serializedAdditionalRawData);
}
BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs
index fd1c4c850a68..8139a5faf306 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs
@@ -49,6 +49,7 @@ public partial class AssetUpdatePayload
public AssetUpdatePayload()
{
Labels = new ChangeTrackingDictionary();
+ Remediations = new ChangeTrackingList();
}
/// Initializes a new instance of .
@@ -56,13 +57,15 @@ public AssetUpdatePayload()
/// A string which can be used to identify the asset in external systems.
/// Any Labels to update the asset with.
/// A list of asset types to cascade the updates to.
+ /// A list of observation remediations to apply to the asset.
/// Keeps track of any properties unknown to the library.
- internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDictionary labels, AssetUpdateTransfers? transfers, IDictionary serializedAdditionalRawData)
+ internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDictionary labels, AssetUpdateTransfers? transfers, IList remediations, IDictionary serializedAdditionalRawData)
{
State = state;
ExternalId = externalId;
Labels = labels;
Transfers = transfers;
+ Remediations = remediations;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
@@ -74,5 +77,7 @@ internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDiction
public IDictionary Labels { get; }
/// A list of asset types to cascade the updates to.
public AssetUpdateTransfers? Transfers { get; set; }
+ /// A list of observation remediations to apply to the asset.
+ public IList Remediations { get; }
}
}
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..45c11f1a31e0
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs
@@ -0,0 +1,160 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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/AuditTrailItem.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs
index b4269bc0fb74..556300c2ad74 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs
@@ -51,7 +51,7 @@ internal AuditTrailItem()
}
/// Initializes a new instance of .
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The kind of asset.
@@ -67,7 +67,7 @@ internal AuditTrailItem(string id, string name, string displayName, AuditTrailIt
_serializedAdditionalRawData = serializedAdditionalRawData;
}
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
public string Id { get; }
/// The caller provided unique name for the resource.
public string Name { get; }
diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs
index 690b1b97f475..2204e266508c 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs
@@ -26,13 +26,13 @@ internal AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperti
/// Initializes a new instance of .
/// Discriminator property for DataConnection.
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The type of data the data connection will transfer.
/// The date the data connection was created.
/// The rate at which the data connection will receive updates.
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
/// The date the data connection was last updated.
/// The date the data connection was last updated by user.
/// An indicator of whether the data connection is active.
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..330fc923603d
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs
@@ -0,0 +1,237 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.");
+ }
+
+ 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
+ }
+ }
+ }
+
+ 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..194655f4dc99
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs
@@ -0,0 +1,158 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(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.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("count"u8);
+ writer.WriteNumberValue(Count);
+ }
+
+ 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/DataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs
index f5cd01907046..eea63fcd0e7c 100644
--- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs
@@ -56,13 +56,13 @@ protected DataConnection()
/// Initializes a new instance of .
/// Discriminator property for DataConnection.
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
/// The caller provided unique name for the resource.
/// The name that can be used for display purposes.
/// The type of data the data connection will transfer.
/// The date the data connection was created.
/// The rate at which the data connection will receive updates.
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
/// The date the data connection was last updated.
/// The date the data connection was last updated by user.
/// An indicator of whether the data connection is active.
@@ -87,7 +87,7 @@ internal DataConnection(string kind, string id, string name, string displayName,
/// Discriminator property for DataConnection.
internal string Kind { get; set; }
- /// The system generated unique id for the resource.
+ /// This is typically the same as the name but might be different for different models.
public string Id { get; }
/// The caller provided unique name for the resource.
public string Name { get; }
@@ -99,7 +99,7 @@ internal DataConnection(string kind, string id, string name, string displayName,
public DateTimeOffset? CreatedDate { get; }
/// The rate at which the data connection will receive updates.
public DataConnectionFrequency? Frequency { get; }
- /// The day to update the data connection on.
+ /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
public int? FrequencyOffset { get; }
/// The date the data connection was last updated.
public DateTimeOffset? UpdatedDate { 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..fafd40aa42cc
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs
@@ -0,0 +1,160 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..d2d8937f1c8c
--- /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 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..22681d911a62
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs
@@ -0,0 +1,176 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..07c396755600
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs
@@ -0,0 +1,190 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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..dac6e6fcd27b
--- /dev/null
+++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs
@@ -0,0 +1,180 @@
+// 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)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(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.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
+ }
+ }
+ }
+
+ 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