From 7958a5d2d21f404b8192b413a1c2fe9f3d8fabf9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 13 Sep 2023 00:23:01 +0000 Subject: [PATCH] CodeGen from PR 25765 in Azure/azure-rest-api-specs Merge aebbfea9d2c1d56050d911c52cdf21f54eb20291 into 5fb829494ad9388ad5baba80e9e74d79d377a163 --- ...eManager.MachineLearning.netstandard2.0.cs | 43 ++++--- ...Sample_MachineLearningComputeCollection.cs | 15 +++ .../ArmMachineLearningModelFactory.cs | 12 +- .../Models/ComputeSchedules.Serialization.cs | 20 +++- .../src/Generated/Models/ComputeSchedules.cs | 6 +- .../Generated/Models/Cron.Serialization.cs | 78 ++++++++++++ .../src/Generated/Models/Cron.cs | 48 ++++++++ ...ComputeInstanceProperties.Serialization.cs | 12 ++ ...achineLearningComputeInstanceProperties.cs | 11 +- ...gComputeStartStopSchedule.Serialization.cs | 46 ++++++- ...MachineLearningComputeStartStopSchedule.cs | 16 +-- ...chineLearningScheduleBase.Serialization.cs | 30 ++++- .../Models/MachineLearningScheduleBase.cs | 8 +- .../Models/Recurrence.Serialization.cs | 112 ++++++++++++++++++ .../src/Generated/Models/Recurrence.cs | 50 ++++++++ .../src/autorest.md | 2 +- 16 files changed, 457 insertions(+), 52 deletions(-) create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.Serialization.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.cs 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 5b16e99c02640..2e217c8cfa6b2 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 @@ -1031,7 +1031,7 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceProperties MachineLearningComputeInstanceProperties(string vmSize = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningApplicationSharingPolicy? applicationSharingPolicy = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningApplicationSharingPolicy?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings sshSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints = null, System.Collections.Generic.IEnumerable applications = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceCreatedBy createdBy = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState? state = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAuthorizationType?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAssignedUser personalComputeInstanceAssignedUser = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScriptsToExecute scripts = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation lastOperation = null, System.Collections.Generic.IEnumerable schedulesComputeStartStop = null, bool? enableNodePublicIP = default(bool?), System.Collections.Generic.IEnumerable containers = null, System.Collections.Generic.IEnumerable dataDisks = null, System.Collections.Generic.IEnumerable dataMounts = null, string versionsRuntime = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings MachineLearningComputeInstanceSshSettings(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess? sshPublicAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess?), string adminUserName = null, int? sshPort = default(int?), string adminPublicKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProperties MachineLearningComputeProperties(string computeType = "Unknown", string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProvisioningStatus? provisioningStatus = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProvisioningStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction? action = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType? triggerType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType?), Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceTrigger recurrence = null, Azure.ResourceManager.MachineLearning.Models.CronTrigger cron = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleBase schedule = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProvisioningStatus? provisioningStatus = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProvisioningStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction? action = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType? triggerType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType?), Azure.ResourceManager.MachineLearning.Models.Recurrence recurrence = null, Azure.ResourceManager.MachineLearning.Models.Cron cron = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleBase schedule = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeSystemService MachineLearningComputeSystemService(string systemServiceType = null, string publicIPAddress = null, string version = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerRegistryCredentials MachineLearningContainerRegistryCredentials(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDatabricksCompute MachineLearningDatabricksCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningDatabricksProperties properties = null) { throw null; } @@ -1083,7 +1083,6 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkResource MachineLearningPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName MachineLearningResourceName(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceQuota MachineLearningResourceQuota(string id = null, string amlWorkspaceLocation = null, string resourceQuotaType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName name = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleBase MachineLearningScheduleBase(string id = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningState? provisioningStatus = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningScheduleData MachineLearningScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleAction action = null, string displayName = null, bool? isEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerBase trigger = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuCapacity MachineLearningSkuCapacity(int? @default = default(int?), int? maximum = default(int?), int? minimum = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType? scaleType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType?)) { throw null; } @@ -1359,6 +1358,13 @@ public ColumnTransformer() { } public System.Collections.Generic.IList Fields { get { throw null; } set { } } public System.BinaryData Parameters { get { throw null; } set { } } } + public partial class Cron + { + public Cron() { } + public string Expression { get { throw null; } set { } } + public string StartTime { get { throw null; } set { } } + public string TimeZone { get { throw null; } set { } } + } public partial class CronTrigger : Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerBase { public CronTrigger(string expression) { } @@ -2146,7 +2152,7 @@ public MachineLearningComputeInstanceProperties() { } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation LastOperation { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAssignedUser PersonalComputeInstanceAssignedUser { get { throw null; } set { } } - public System.Collections.Generic.IReadOnlyList SchedulesComputeStartStop { get { throw null; } } + public System.Collections.Generic.IList SchedulesComputeStartStop { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningScriptsToExecute Scripts { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings SshSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState? State { get { throw null; } } @@ -2254,15 +2260,15 @@ protected MachineLearningComputeSecrets() { } } public partial class MachineLearningComputeStartStopSchedule { - internal MachineLearningComputeStartStopSchedule() { } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction? Action { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.CronTrigger Cron { get { throw null; } } + public MachineLearningComputeStartStopSchedule() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePowerAction? Action { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.Cron Cron { get { throw null; } set { } } public string Id { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProvisioningStatus? ProvisioningStatus { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceTrigger Recurrence { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleBase Schedule { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? Status { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType? TriggerType { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.Recurrence Recurrence { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleBase Schedule { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? Status { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerType? TriggerType { get { throw null; } set { } } } public partial class MachineLearningComputeSystemService { @@ -3788,10 +3794,10 @@ protected MachineLearningScheduleAction() { } } public partial class MachineLearningScheduleBase { - internal MachineLearningScheduleBase() { } - public string Id { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningState? ProvisioningStatus { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? Status { get { throw null; } } + public MachineLearningScheduleBase() { } + public string Id { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningState? ProvisioningStatus { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleStatus? Status { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MachineLearningScheduleListViewType : System.IEquatable @@ -4704,6 +4710,15 @@ public RandomSamplingAlgorithm() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule left, Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule right) { throw null; } public override string ToString() { throw null; } } + public partial class Recurrence + { + public Recurrence() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceFrequency? Frequency { get { throw null; } set { } } + public int? Interval { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningRecurrenceSchedule Schedule { get { throw null; } set { } } + public string StartTime { get { throw null; } set { } } + public string TimeZone { get { throw null; } set { } } + } public partial class RegressionTrainingSettings : Azure.ResourceManager.MachineLearning.Models.MachineLearningTrainingSettings { public RegressionTrainingSettings() { } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs index f35a6dc9c5c31..6246d0a3ad42c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs @@ -624,6 +624,21 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() }, ComputeInstanceAuthorizationType = MachineLearningComputeInstanceAuthorizationType.Personal, PersonalComputeInstanceAssignedUser = new MachineLearningComputeInstanceAssignedUser("00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")), + SchedulesComputeStartStop = +{ +new MachineLearningComputeStartStopSchedule() +{ +Status = MachineLearningScheduleStatus.Enabled, +Action = MachineLearningComputePowerAction.Stop, +TriggerType = MachineLearningTriggerType.Cron, +Cron = new Cron() +{ +StartTime = "2021-04-23T01:30:00", +TimeZone = "Pacific Standard Time", +Expression = "0 18 * * *", +}, +} +}, }, }, }; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs index 5a1abc91e2fe1..eff933709bf46 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs @@ -1343,21 +1343,11 @@ public static MachineLearningComputeInstanceLastOperation MachineLearningCompute /// Required if triggerType is Cron. /// [Deprecated] Not used any more. /// A new instance for mocking. - public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, MachineLearningTriggerType? triggerType = null, MachineLearningRecurrenceTrigger recurrence = null, CronTrigger cron = null, MachineLearningScheduleBase schedule = null) + public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, MachineLearningTriggerType? triggerType = null, Recurrence recurrence = null, Cron cron = null, MachineLearningScheduleBase schedule = null) { return new MachineLearningComputeStartStopSchedule(id, provisioningStatus, status, action, triggerType, recurrence, cron, schedule); } - /// Initializes a new instance of MachineLearningScheduleBase. - /// A system assigned id for the schedule. - /// The current deployment state of schedule. - /// Is the schedule enabled or disabled?. - /// A new instance for mocking. - public static MachineLearningScheduleBase MachineLearningScheduleBase(string id = null, MachineLearningScheduleProvisioningState? provisioningStatus = null, MachineLearningScheduleStatus? status = null) - { - return new MachineLearningScheduleBase(id, provisioningStatus, status); - } - /// Initializes a new instance of MachineLearningComputeInstanceContainer. /// Name of the ComputeInstance container. /// Auto save settings. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.Serialization.cs index 54abed101a0e1..afbf2ebb99e2e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.Serialization.cs @@ -11,15 +11,31 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class ComputeSchedules + internal partial class ComputeSchedules : IUtf8JsonSerializable { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ComputeStartStop)) + { + writer.WritePropertyName("computeStartStop"u8); + writer.WriteStartArray(); + foreach (var item in ComputeStartStop) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + internal static ComputeSchedules DeserializeComputeSchedules(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional> computeStartStop = default; + Optional> computeStartStop = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("computeStartStop"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.cs index c10f7b1401dad..8d6d9ac92e799 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeSchedules.cs @@ -14,19 +14,19 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class ComputeSchedules { /// Initializes a new instance of ComputeSchedules. - internal ComputeSchedules() + public ComputeSchedules() { ComputeStartStop = new ChangeTrackingList(); } /// Initializes a new instance of ComputeSchedules. /// The list of compute start stop schedules to be applied. - internal ComputeSchedules(IReadOnlyList computeStartStop) + internal ComputeSchedules(IList computeStartStop) { ComputeStartStop = computeStartStop; } /// The list of compute start stop schedules to be applied. - public IReadOnlyList ComputeStartStop { get; } + public IList ComputeStartStop { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.Serialization.cs new file mode 100644 index 0000000000000..663b7ff824630 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class Cron : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StartTime)) + { + if (StartTime != null) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime); + } + else + { + writer.WriteNull("startTime"); + } + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + writer.WriteEndObject(); + } + + internal static Cron DeserializeCron(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional startTime = default; + Optional timeZone = default; + Optional expression = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + startTime = null; + continue; + } + startTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + } + return new Cron(startTime.Value, timeZone.Value, expression.Value); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.cs new file mode 100644 index 0000000000000..5a8de26578c59 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Cron.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The workflow trigger cron for ComputeStartStop schedule type. + public partial class Cron + { + /// Initializes a new instance of Cron. + public Cron() + { + } + + /// Initializes a new instance of Cron. + /// The start time in yyyy-MM-ddTHH:mm:ss format. + /// + /// Specifies time zone in which the schedule runs. + /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + /// + /// + /// [Required] Specifies cron expression of schedule. + /// The expression should follow NCronTab format. + /// + internal Cron(string startTime, string timeZone, string expression) + { + StartTime = startTime; + TimeZone = timeZone; + Expression = expression; + } + + /// The start time in yyyy-MM-ddTHH:mm:ss format. + public string StartTime { get; set; } + /// + /// Specifies time zone in which the schedule runs. + /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + /// + public string TimeZone { get; set; } + /// + /// [Required] Specifies cron expression of schedule. + /// The expression should follow NCronTab format. + /// + public string Expression { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs index 69c914d767edc..79310aa5dab9e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs @@ -86,6 +86,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteNull("setupScripts"); } } + if (Optional.IsDefined(Schedules)) + { + if (Schedules != null) + { + writer.WritePropertyName("schedules"u8); + writer.WriteObjectValue(Schedules); + } + else + { + writer.WriteNull("schedules"); + } + } if (Optional.IsDefined(EnableNodePublicIP)) { writer.WritePropertyName("enableNodePublicIp"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs index 82b39f22822cb..66b6270ae68f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs @@ -124,11 +124,16 @@ public MachineLearningScriptsToExecute Scripts /// The last operation on ComputeInstance. public MachineLearningComputeInstanceLastOperation LastOperation { get; } /// The list of schedules to be applied on the computes. - internal ComputeSchedules Schedules { get; } + internal ComputeSchedules Schedules { get; set; } /// The list of compute start stop schedules to be applied. - public IReadOnlyList SchedulesComputeStartStop + public IList SchedulesComputeStartStop { - get => Schedules?.ComputeStartStop; + get + { + if (Schedules is null) + Schedules = new ComputeSchedules(); + return Schedules.ComputeStartStop; + } } /// Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs index ee56468c0c012..0a9acc683e737 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs @@ -10,8 +10,44 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MachineLearningComputeStartStopSchedule + public partial class MachineLearningComputeStartStopSchedule : IUtf8JsonSerializable { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsDefined(TriggerType)) + { + writer.WritePropertyName("triggerType"u8); + writer.WriteStringValue(TriggerType.Value.ToString()); + } + if (Optional.IsDefined(Recurrence)) + { + writer.WritePropertyName("recurrence"u8); + writer.WriteObjectValue(Recurrence); + } + if (Optional.IsDefined(Cron)) + { + writer.WritePropertyName("cron"u8); + writer.WriteObjectValue(Cron); + } + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule); + } + writer.WriteEndObject(); + } + internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearningComputeStartStopSchedule(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) @@ -23,8 +59,8 @@ internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearni Optional status = default; Optional action = default; Optional triggerType = default; - Optional recurrence = default; - Optional cron = default; + Optional recurrence = default; + Optional cron = default; Optional schedule = default; foreach (var property in element.EnumerateObject()) { @@ -80,7 +116,7 @@ internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearni { continue; } - recurrence = MachineLearningRecurrenceTrigger.DeserializeMachineLearningRecurrenceTrigger(property.Value); + recurrence = Recurrence.DeserializeRecurrence(property.Value); continue; } if (property.NameEquals("cron"u8)) @@ -89,7 +125,7 @@ internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearni { continue; } - cron = CronTrigger.DeserializeCronTrigger(property.Value); + cron = Cron.DeserializeCron(property.Value); continue; } if (property.NameEquals("schedule"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs index 565f9dcf50fa1..5537d47b700e2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class MachineLearningComputeStartStopSchedule { /// Initializes a new instance of MachineLearningComputeStartStopSchedule. - internal MachineLearningComputeStartStopSchedule() + public MachineLearningComputeStartStopSchedule() { } @@ -24,7 +24,7 @@ internal MachineLearningComputeStartStopSchedule() /// Required if triggerType is Recurrence. /// Required if triggerType is Cron. /// [Deprecated] Not used any more. - internal MachineLearningComputeStartStopSchedule(string id, MachineLearningComputeProvisioningStatus? provisioningStatus, MachineLearningScheduleStatus? status, MachineLearningComputePowerAction? action, MachineLearningTriggerType? triggerType, MachineLearningRecurrenceTrigger recurrence, CronTrigger cron, MachineLearningScheduleBase schedule) + internal MachineLearningComputeStartStopSchedule(string id, MachineLearningComputeProvisioningStatus? provisioningStatus, MachineLearningScheduleStatus? status, MachineLearningComputePowerAction? action, MachineLearningTriggerType? triggerType, Recurrence recurrence, Cron cron, MachineLearningScheduleBase schedule) { Id = id; ProvisioningStatus = provisioningStatus; @@ -41,16 +41,16 @@ internal MachineLearningComputeStartStopSchedule(string id, MachineLearningCompu /// The current deployment state of schedule. public MachineLearningComputeProvisioningStatus? ProvisioningStatus { get; } /// Is the schedule enabled or disabled?. - public MachineLearningScheduleStatus? Status { get; } + public MachineLearningScheduleStatus? Status { get; set; } /// [Required] The compute power action. - public MachineLearningComputePowerAction? Action { get; } + public MachineLearningComputePowerAction? Action { get; set; } /// [Required] The schedule trigger type. - public MachineLearningTriggerType? TriggerType { get; } + public MachineLearningTriggerType? TriggerType { get; set; } /// Required if triggerType is Recurrence. - public MachineLearningRecurrenceTrigger Recurrence { get; } + public Recurrence Recurrence { get; set; } /// Required if triggerType is Cron. - public CronTrigger Cron { get; } + public Cron Cron { get; set; } /// [Deprecated] Not used any more. - public MachineLearningScheduleBase Schedule { get; } + public MachineLearningScheduleBase Schedule { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.Serialization.cs index ab5736eb78631..0dc708e8c586b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.Serialization.cs @@ -10,8 +10,36 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MachineLearningScheduleBase + public partial class MachineLearningScheduleBase : IUtf8JsonSerializable { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + if (Id != null) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + else + { + writer.WriteNull("id"); + } + } + if (Optional.IsDefined(ProvisioningStatus)) + { + writer.WritePropertyName("provisioningStatus"u8); + writer.WriteStringValue(ProvisioningStatus.Value.ToString()); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + writer.WriteEndObject(); + } + internal static MachineLearningScheduleBase DeserializeMachineLearningScheduleBase(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.cs index 1a325d01907b1..c252dda1ec53f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleBase.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class MachineLearningScheduleBase { /// Initializes a new instance of MachineLearningScheduleBase. - internal MachineLearningScheduleBase() + public MachineLearningScheduleBase() { } @@ -27,10 +27,10 @@ internal MachineLearningScheduleBase(string id, MachineLearningScheduleProvision } /// A system assigned id for the schedule. - public string Id { get; } + public string Id { get; set; } /// The current deployment state of schedule. - public MachineLearningScheduleProvisioningState? ProvisioningStatus { get; } + public MachineLearningScheduleProvisioningState? ProvisioningStatus { get; set; } /// Is the schedule enabled or disabled?. - public MachineLearningScheduleStatus? Status { get; } + public MachineLearningScheduleStatus? Status { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.Serialization.cs new file mode 100644 index 0000000000000..4e656f6220fdd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.Serialization.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class Recurrence : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Frequency)) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.Value.ToString()); + } + if (Optional.IsDefined(Interval)) + { + writer.WritePropertyName("interval"u8); + writer.WriteNumberValue(Interval.Value); + } + if (Optional.IsDefined(StartTime)) + { + if (StartTime != null) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime); + } + else + { + writer.WriteNull("startTime"); + } + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule); + } + writer.WriteEndObject(); + } + + internal static Recurrence DeserializeRecurrence(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional frequency = default; + Optional interval = default; + Optional startTime = default; + Optional timeZone = default; + Optional schedule = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequency = new MachineLearningRecurrenceFrequency(property.Value.GetString()); + continue; + } + if (property.NameEquals("interval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interval = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + startTime = null; + continue; + } + startTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("schedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schedule = MachineLearningRecurrenceSchedule.DeserializeMachineLearningRecurrenceSchedule(property.Value); + continue; + } + } + return new Recurrence(Optional.ToNullable(frequency), Optional.ToNullable(interval), startTime.Value, timeZone.Value, schedule.Value); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.cs new file mode 100644 index 0000000000000..536d5e9e56d2e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/Recurrence.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The workflow trigger recurrence for ComputeStartStop schedule type. + public partial class Recurrence + { + /// Initializes a new instance of Recurrence. + public Recurrence() + { + } + + /// Initializes a new instance of Recurrence. + /// [Required] The frequency to trigger schedule. + /// [Required] Specifies schedule interval in conjunction with frequency. + /// The start time in yyyy-MM-ddTHH:mm:ss format. + /// + /// Specifies time zone in which the schedule runs. + /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + /// + /// [Required] The recurrence schedule. + internal Recurrence(MachineLearningRecurrenceFrequency? frequency, int? interval, string startTime, string timeZone, MachineLearningRecurrenceSchedule schedule) + { + Frequency = frequency; + Interval = interval; + StartTime = startTime; + TimeZone = timeZone; + Schedule = schedule; + } + + /// [Required] The frequency to trigger schedule. + public MachineLearningRecurrenceFrequency? Frequency { get; set; } + /// [Required] Specifies schedule interval in conjunction with frequency. + public int? Interval { get; set; } + /// The start time in yyyy-MM-ddTHH:mm:ss format. + public string StartTime { get; set; } + /// + /// Specifies time zone in which the schedule runs. + /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + /// + public string TimeZone { get; set; } + /// [Required] The recurrence schedule. + public MachineLearningRecurrenceSchedule Schedule { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index 524ba33350b33..7719dfc9bb0c5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: MachineLearning namespace: Azure.ResourceManager.MachineLearning -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b32e1896f30e6ea155449cb49719a6286e32b961/specification/machinelearningservices/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md tag: package-2022-10 output-folder: $(this-folder)/Generated clear-output-folder: true