From 8a75f5b1e3d3cd5e75a02313cd278eac15029308 Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:39:46 +0530 Subject: [PATCH] Fixing review comments --- ...eManager.MachineLearning.netstandard2.0.cs | 8 +++---- .../ArmMachineLearningModelFactory.cs | 10 ++++---- .../Models/OSPatchingStatus.Serialization.cs | 24 ++++++++++++------- .../src/Generated/Models/OSPatchingStatus.cs | 14 +++++------ ...ServerlessComputeSettings.Serialization.cs | 4 ++-- .../Models/ServerlessComputeSettings.cs | 8 +++---- .../src/autorest.md | 3 +++ 7 files changed, 41 insertions(+), 30 deletions(-) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs index b4401ce529b93..9c01b69f4206f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs @@ -2934,7 +2934,7 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.OneLakeDatastore OneLakeDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus(Azure.ResourceManager.MachineLearning.Models.PatchStatus? patchStatus = default(Azure.ResourceManager.MachineLearning.Models.PatchStatus?), string latestPatchTime = null, bool? rebootPending = default(bool?), string scheduledRebootTime = null, System.Collections.Generic.IEnumerable osPatchingErrors = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus(Azure.ResourceManager.MachineLearning.Models.PatchStatus? patchStatus = default(Azure.ResourceManager.MachineLearning.Models.PatchStatus?), System.DateTimeOffset? latestPatchOn = default(System.DateTimeOffset?), bool? rebootPending = default(bool?), System.DateTimeOffset? scheduledRebootOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable osPatchingErrors = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.PendingUploadResponseDto PendingUploadResponseDto(Azure.ResourceManager.MachineLearning.Models.BlobReferenceForConsumptionDto blobReferenceForConsumption = null, string pendingUploadId = null, Azure.ResourceManager.MachineLearning.Models.PendingUploadType? pendingUploadType = default(Azure.ResourceManager.MachineLearning.Models.PendingUploadType?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointBase PrivateEndpointBase(Azure.Core.ResourceIdentifier id = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule PrivateEndpointOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), Azure.ResourceManager.MachineLearning.Models.PrivateEndpointDestination destination = null, System.Collections.Generic.IEnumerable fqdns = null) { throw null; } @@ -10013,11 +10013,11 @@ public OpenAIEndpointResourceProperties() { } public partial class OSPatchingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OSPatchingStatus() { } - public string LatestPatchTime { get { throw null; } } + public System.DateTimeOffset? LatestPatchOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList OSPatchingErrors { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.PatchStatus? PatchStatus { get { throw null; } } public bool? RebootPending { get { throw null; } } - public string ScheduledRebootTime { get { throw null; } } + public System.DateTimeOffset? ScheduledRebootOn { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -10564,8 +10564,8 @@ public SecretExpiry() { } public partial class ServerlessComputeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ServerlessComputeSettings() { } + public bool? HasNoPublicIP { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ServerlessComputeCustomSubnet { get { throw null; } set { } } - public bool? ServerlessComputeNoPublicIP { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs index d8e3c3e52473d..b976946781310 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs @@ -2748,20 +2748,20 @@ public static ImageMetadata ImageMetadata(string currentImageVersion = null, str /// Initializes a new instance of . /// The os patching status. - /// Time of the latest os patching. + /// Time of the latest os patching. /// Specifies whether this compute instance is pending for reboot to finish os patching. - /// Time of scheduled reboot. + /// Time of scheduled reboot. /// Collection of errors encountered when doing os patching. /// A new instance for mocking. - public static OSPatchingStatus OSPatchingStatus(PatchStatus? patchStatus = null, string latestPatchTime = null, bool? rebootPending = null, string scheduledRebootTime = null, IEnumerable osPatchingErrors = null) + public static OSPatchingStatus OSPatchingStatus(PatchStatus? patchStatus = null, DateTimeOffset? latestPatchOn = null, bool? rebootPending = null, DateTimeOffset? scheduledRebootOn = null, IEnumerable osPatchingErrors = null) { osPatchingErrors ??= new List(); return new OSPatchingStatus( patchStatus, - latestPatchTime, + latestPatchOn, rebootPending, - scheduledRebootTime, + scheduledRebootOn, osPatchingErrors?.ToList(), serializedAdditionalRawData: null); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs index 4cd3339dfc5a9..dcc3aef7e0d98 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs @@ -31,20 +31,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("patchStatus"u8); writer.WriteStringValue(PatchStatus.Value.ToString()); } - if (Optional.IsDefined(LatestPatchTime)) + if (Optional.IsDefined(LatestPatchOn)) { writer.WritePropertyName("latestPatchTime"u8); - writer.WriteStringValue(LatestPatchTime); + writer.WriteStringValue(LatestPatchOn.Value, "O"); } if (Optional.IsDefined(RebootPending)) { writer.WritePropertyName("rebootPending"u8); writer.WriteBooleanValue(RebootPending.Value); } - if (Optional.IsDefined(ScheduledRebootTime)) + if (Optional.IsDefined(ScheduledRebootOn)) { writer.WritePropertyName("scheduledRebootTime"u8); - writer.WriteStringValue(ScheduledRebootTime); + writer.WriteStringValue(ScheduledRebootOn.Value, "O"); } if (Optional.IsCollectionDefined(OSPatchingErrors)) { @@ -102,9 +102,9 @@ internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element return null; } PatchStatus? patchStatus = default; - string latestPatchTime = default; + DateTimeOffset? latestPatchTime = default; bool? rebootPending = default; - string scheduledRebootTime = default; + DateTimeOffset? scheduledRebootTime = default; IReadOnlyList osPatchingErrors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -121,7 +121,11 @@ internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element } if (property.NameEquals("latestPatchTime"u8)) { - latestPatchTime = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestPatchTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("rebootPending"u8)) @@ -135,7 +139,11 @@ internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element } if (property.NameEquals("scheduledRebootTime"u8)) { - scheduledRebootTime = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledRebootTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("osPatchingErrors"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs index efe37b03843a6..5f9f0d128b84b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs @@ -53,17 +53,17 @@ internal OSPatchingStatus() /// Initializes a new instance of . /// The os patching status. - /// Time of the latest os patching. + /// Time of the latest os patching. /// Specifies whether this compute instance is pending for reboot to finish os patching. - /// Time of scheduled reboot. + /// Time of scheduled reboot. /// Collection of errors encountered when doing os patching. /// Keeps track of any properties unknown to the library. - internal OSPatchingStatus(PatchStatus? patchStatus, string latestPatchTime, bool? rebootPending, string scheduledRebootTime, IReadOnlyList osPatchingErrors, IDictionary serializedAdditionalRawData) + internal OSPatchingStatus(PatchStatus? patchStatus, DateTimeOffset? latestPatchOn, bool? rebootPending, DateTimeOffset? scheduledRebootOn, IReadOnlyList osPatchingErrors, IDictionary serializedAdditionalRawData) { PatchStatus = patchStatus; - LatestPatchTime = latestPatchTime; + LatestPatchOn = latestPatchOn; RebootPending = rebootPending; - ScheduledRebootTime = scheduledRebootTime; + ScheduledRebootOn = scheduledRebootOn; OSPatchingErrors = osPatchingErrors; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -71,11 +71,11 @@ internal OSPatchingStatus(PatchStatus? patchStatus, string latestPatchTime, bool /// The os patching status. public PatchStatus? PatchStatus { get; } /// Time of the latest os patching. - public string LatestPatchTime { get; } + public DateTimeOffset? LatestPatchOn { get; } /// Specifies whether this compute instance is pending for reboot to finish os patching. public bool? RebootPending { get; } /// Time of scheduled reboot. - public string ScheduledRebootTime { get; } + public DateTimeOffset? ScheduledRebootOn { get; } /// Collection of errors encountered when doing os patching. public IReadOnlyList OSPatchingErrors { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs index 1004463adae25..69489e0b57f7f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WritePropertyName("serverlessComputeCustomSubnet"u8); writer.WriteStringValue(ServerlessComputeCustomSubnet); } - if (Optional.IsDefined(ServerlessComputeNoPublicIP)) + if (Optional.IsDefined(HasNoPublicIP)) { writer.WritePropertyName("serverlessComputeNoPublicIP"u8); - writer.WriteBooleanValue(ServerlessComputeNoPublicIP.Value); + writer.WriteBooleanValue(HasNoPublicIP.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs index c93ceed3f7189..d67ba34046456 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs @@ -53,18 +53,18 @@ public ServerlessComputeSettings() /// Initializes a new instance of . /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. - /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. /// Keeps track of any properties unknown to the library. - internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSubnet, bool? serverlessComputeNoPublicIP, IDictionary serializedAdditionalRawData) + internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSubnet, bool? hasNoPublicIP, IDictionary serializedAdditionalRawData) { ServerlessComputeCustomSubnet = serverlessComputeCustomSubnet; - ServerlessComputeNoPublicIP = serverlessComputeNoPublicIP; + HasNoPublicIP = hasNoPublicIP; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. public ResourceIdentifier ServerlessComputeCustomSubnet { get; set; } /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. - public bool? ServerlessComputeNoPublicIP { get; set; } + public bool? HasNoPublicIP { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index 04814a0e771eb..3abcab19d879a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -518,6 +518,9 @@ rename-mapping: StatusMessageLevel: JobStatusMessageLevel ImageType.azureml: AzureML ProtectionLevel: IntellectualProtectionLevel + OsPatchingStatus.latestPatchTime: -|date-time + OsPatchingStatus.scheduledRebootTime: -|date-time + ServerlessComputeSettings.serverlessComputeNoPublicIP : HasNoPublicIP suppress-abstract-base-class: - MachineLearningJobProperties