diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 29c90ec94138..aad39fe943c3 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -102,7 +102,7 @@ - + diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md b/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md index d16f7658eb19..17440785c428 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History -## 1.2.0-beta.2 (Unreleased) +## 1.2.0-beta.2 (2023-07-24) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Bump the api-version to `2023-04-01`. ### Other Changes +- Upgraded dependent Azure.Core to 1.34.0. +- Upgraded dependent Azure.ResourceManager to 1.7.0. + ## 1.2.0-beta.1 (2023-05-30) ### Features Added diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/api/Azure.ResourceManager.Maintenance.netstandard2.0.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/api/Azure.ResourceManager.Maintenance.netstandard2.0.cs index 6fc08853027e..ac8cc5b81b4a 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/api/Azure.ResourceManager.Maintenance.netstandard2.0.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/api/Azure.ResourceManager.Maintenance.netstandard2.0.cs @@ -46,6 +46,7 @@ public MaintenanceConfigurationData(Azure.Core.AzureLocation location) : base (d public System.TimeSpan? Duration { get { throw null; } set { } } public System.DateTimeOffset? ExpireOn { get { throw null; } set { } } public System.Collections.Generic.IDictionary ExtensionProperties { get { throw null; } } + public Azure.ResourceManager.Maintenance.Models.MaintenancePatchConfiguration InstallPatches { get { throw null; } set { } } public Azure.ResourceManager.Maintenance.Models.MaintenanceScope? MaintenanceScope { get { throw null; } set { } } public string Namespace { get { throw null; } set { } } public string RecurEvery { get { throw null; } set { } } @@ -85,20 +86,38 @@ public static partial class MaintenanceExtensions public static Azure.Response CreateOrUpdateConfigurationAssignmentByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CreateOrUpdateConfigurationAssignmentByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CreateOrUpdateConfigurationAssignmentByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CreateOrUpdateConfigurationAssignmentByResourceGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CreateOrUpdateConfigurationAssignmentBySubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response DeleteConfigurationAssignment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> DeleteConfigurationAssignmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response DeleteConfigurationAssignmentByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response DeleteConfigurationAssignmentByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> DeleteConfigurationAssignmentByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> DeleteConfigurationAssignmentByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response DeleteConfigurationAssignmentByResourceGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> DeleteConfigurationAssignmentByResourceGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response DeleteConfigurationAssignmentBySubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> DeleteConfigurationAssignmentBySubscriptionAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetApplyUpdatesByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceGetApplyUpdatesByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetApplyUpdatesByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string applyUpdateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetApplyUpdatesByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceGetApplyUpdatesByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetApplyUpdatesByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string applyUpdateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetConfigurationAssignment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConfigurationAssignmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetConfigurationAssignmentByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConfigurationAssignmentByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Maintenance.Models.ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetConfigurationAssignmentByResourceGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConfigurationAssignmentByResourceGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetConfigurationAssignmentBySubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConfigurationAssignmentBySubscriptionAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetConfigurationAssignments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetConfigurationAssignmentsAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetConfigurationAssignmentsByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetConfigurationAssignmentsByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetConfigurationAssignmentsBySubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetConfigurationAssignmentsBySubscriptionAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetMaintenanceApplyUpdate(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string applyUpdateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetMaintenanceApplyUpdateAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string applyUpdateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Maintenance.MaintenanceApplyUpdateResource GetMaintenanceApplyUpdateResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -121,6 +140,10 @@ public static partial class MaintenanceExtensions public static Azure.AsyncPageable GetUpdatesAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetUpdatesByParent(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetUpdatesByParentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response UpdateConfigurationAssignmentByResourceGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> UpdateConfigurationAssignmentByResourceGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response UpdateConfigurationAssignmentBySubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> UpdateConfigurationAssignmentBySubscriptionAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MaintenancePublicConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -151,17 +174,27 @@ namespace Azure.ResourceManager.Maintenance.Models public static partial class ArmMaintenanceModelFactory { public static Azure.ResourceManager.Maintenance.MaintenanceApplyUpdateData MaintenanceApplyUpdateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus? status = default(Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus?), Azure.Core.ResourceIdentifier resourceId = null, System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData MaintenanceConfigurationAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, Azure.Core.ResourceIdentifier resourceId = null) { throw null; } - public static Azure.ResourceManager.Maintenance.MaintenanceConfigurationData MaintenanceConfigurationData(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), string @namespace = null, System.Collections.Generic.IDictionary extensionProperties = null, Azure.ResourceManager.Maintenance.Models.MaintenanceScope? maintenanceScope = default(Azure.ResourceManager.Maintenance.Models.MaintenanceScope?), Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationVisibility? visibility = default(Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationVisibility?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), string timeZone = null, string recurEvery = null) { throw null; } + public static Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData MaintenanceConfigurationAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentFilter filter = null) { throw null; } + public static Azure.ResourceManager.Maintenance.MaintenanceConfigurationData MaintenanceConfigurationData(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), string @namespace = null, System.Collections.Generic.IDictionary extensionProperties = null, Azure.ResourceManager.Maintenance.Models.MaintenanceScope? maintenanceScope = default(Azure.ResourceManager.Maintenance.Models.MaintenanceScope?), Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationVisibility? visibility = default(Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationVisibility?), Azure.ResourceManager.Maintenance.Models.MaintenancePatchConfiguration installPatches = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), string timeZone = null, string recurEvery = null) { throw null; } public static Azure.ResourceManager.Maintenance.Models.MaintenanceUpdate MaintenanceUpdate(Azure.ResourceManager.Maintenance.Models.MaintenanceScope? maintenanceScope = default(Azure.ResourceManager.Maintenance.Models.MaintenanceScope?), Azure.ResourceManager.Maintenance.Models.MaintenanceImpactType? impactType = default(Azure.ResourceManager.Maintenance.Models.MaintenanceImpactType?), Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus? status = default(Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus?), int? impactDurationInSec = default(int?), System.DateTimeOffset? notBefore = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null) { throw null; } } public partial class MaintenanceConfigurationAssignmentData : Azure.ResourceManager.Models.ResourceData { public MaintenanceConfigurationAssignmentData() { } + public Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentFilter Filter { get { throw null; } set { } } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.Core.ResourceIdentifier MaintenanceConfigurationId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } } + public partial class MaintenanceConfigurationAssignmentFilter + { + public MaintenanceConfigurationAssignmentFilter() { } + public System.Collections.Generic.IList Locations { get { throw null; } } + public System.Collections.Generic.IList OSTypes { get { throw null; } } + public System.Collections.Generic.IList ResourceGroups { get { throw null; } } + public System.Collections.Generic.IList ResourceTypes { get { throw null; } } + public Azure.ResourceManager.Maintenance.Models.VmTagSettings TagSettings { get { throw null; } set { } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MaintenanceConfigurationVisibility : System.IEquatable { @@ -200,6 +233,39 @@ public MaintenanceConfigurationAssignmentData() { } public static bool operator !=(Azure.ResourceManager.Maintenance.Models.MaintenanceImpactType left, Azure.ResourceManager.Maintenance.Models.MaintenanceImpactType right) { throw null; } public override string ToString() { throw null; } } + public partial class MaintenanceLinuxPatchSettings + { + public MaintenanceLinuxPatchSettings() { } + public System.Collections.Generic.IList ClassificationsToInclude { get { throw null; } } + public System.Collections.Generic.IList PackageNameMasksToExclude { get { throw null; } } + public System.Collections.Generic.IList PackageNameMasksToInclude { get { throw null; } } + } + public partial class MaintenancePatchConfiguration + { + public MaintenancePatchConfiguration() { } + public Azure.ResourceManager.Maintenance.Models.MaintenanceLinuxPatchSettings LinuxParameters { get { throw null; } set { } } + public Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption? RebootSetting { get { throw null; } set { } } + public Azure.ResourceManager.Maintenance.Models.MaintenanceWindowsPatchSettings WindowsParameters { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MaintenanceRebootOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MaintenanceRebootOption(string value) { throw null; } + public static Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption Always { get { throw null; } } + public static Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption IfRequired { get { throw null; } } + public static Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption left, Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption left, Azure.ResourceManager.Maintenance.Models.MaintenanceRebootOption right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MaintenanceScope : System.IEquatable { @@ -210,6 +276,7 @@ public MaintenanceConfigurationAssignmentData() { } public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope Host { get { throw null; } } public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope InGuestPatch { get { throw null; } } public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope OSImage { get { throw null; } } + public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope Resource { get { throw null; } } public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope SqlDB { get { throw null; } } public static Azure.ResourceManager.Maintenance.Models.MaintenanceScope SqlManagedInstance { get { throw null; } } public bool Equals(Azure.ResourceManager.Maintenance.Models.MaintenanceScope other) { throw null; } @@ -253,6 +320,14 @@ internal MaintenanceUpdate() { } public static bool operator !=(Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus left, Azure.ResourceManager.Maintenance.Models.MaintenanceUpdateStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class MaintenanceWindowsPatchSettings + { + public MaintenanceWindowsPatchSettings() { } + public System.Collections.Generic.IList ClassificationsToInclude { get { throw null; } } + public bool? IsExcludeKbsRebootRequired { get { throw null; } set { } } + public System.Collections.Generic.IList KbNumbersToExclude { get { throw null; } } + public System.Collections.Generic.IList KbNumbersToInclude { get { throw null; } } + } public partial class ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions { public ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, Azure.ResourceManager.Maintenance.Models.MaintenanceConfigurationAssignmentData data) { } @@ -284,4 +359,25 @@ public ResourceGroupResourceGetApplyUpdatesByParentOptions(string providerName, public string ResourceParentType { get { throw null; } } public string ResourceType { get { throw null; } } } + public partial class ResourceGroupResourceGetConfigurationAssignmentByParentOptions + { + public ResourceGroupResourceGetConfigurationAssignmentByParentOptions(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName) { } + public string ConfigurationAssignmentName { get { throw null; } } + public string ProviderName { get { throw null; } } + public string ResourceName { get { throw null; } } + public string ResourceParentName { get { throw null; } } + public string ResourceParentType { get { throw null; } } + public string ResourceType { get { throw null; } } + } + public enum VmTagOperator + { + All = 0, + Any = 1, + } + public partial class VmTagSettings + { + public VmTagSettings() { } + public Azure.ResourceManager.Maintenance.Models.VmTagOperator? FilterOperator { get { throw null; } set { } } + public System.Collections.Generic.IDictionary> Tags { get { throw null; } } + } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/assets.json b/sdk/maintenance/Azure.ResourceManager.Maintenance/assets.json index 6f8c8387fec0..0ce567fdd8e6 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/assets.json +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/maintenance/Azure.ResourceManager.Maintenance", - "Tag": "net/maintenance/Azure.ResourceManager.Maintenance_93b9f53e5a" + "Tag": "net/maintenance/Azure.ResourceManager.Maintenance_860a3716dd" } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateCollection.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateCollection.cs index db50e2f9f8de..ed0e66d546c5 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateCollection.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MaintenanceApplyUpdateCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplyUpdatesGet() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_Get.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_Get.json // this example is just showing the usage of "ApplyUpdates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Get_ApplyUpdatesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ApplyUpdatesGet() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_Get.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_Get.json // this example is just showing the usage of "ApplyUpdates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateResource.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateResource.cs index 6c850e1de443..d6dfe5853bf6 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateResource.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceApplyUpdateResource.cs @@ -23,7 +23,7 @@ public partial class Sample_MaintenanceApplyUpdateResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetApplyUpdatesByParent_ApplyUpdatesGetParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_GetParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_GetParent.json // this example is just showing the usage of "ApplyUpdates_GetParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task GetApplyUpdatesByParent_ApplyUpdatesGetParent() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplyUpdatesGet() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_Get.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_Get.json // this example is just showing the usage of "ApplyUpdates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Get_ApplyUpdatesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateApplyUpdateByParent_ApplyUpdatesCreateOrUpdateParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_CreateOrUpdateParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_CreateOrUpdateParent.json // this example is just showing the usage of "ApplyUpdates_CreateOrUpdateParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task CreateOrUpdateApplyUpdateByParent_ApplyUpdatesCreateOrUpdatePa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateApplyUpdate_ApplyUpdatesCreateOrUpdate() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_CreateOrUpdate.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_CreateOrUpdate.json // this example is just showing the usage of "ApplyUpdates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task CreateOrUpdateApplyUpdate_ApplyUpdatesCreateOrUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMaintenanceApplyUpdates_ApplyUpdatesList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_List.json // this example is just showing the usage of "ApplyUpdates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationCollection.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationCollection.cs index c94af2566f05..1fc6ede572a8 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationCollection.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_MaintenanceConfigurationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,135 @@ public async Task Get_MaintenanceConfigurationsGetForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationCollection collection = resourceGroupResource.GetMaintenanceConfigurations(); + + // invoke the operation + string resourceName = "configuration1"; + bool result = await collection.ExistsAsync(resourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchLinux + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MaintenanceConfigurationsGetForResourceGuestOSPatchLinux() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationCollection collection = resourceGroupResource.GetMaintenanceConfigurations(); + + // invoke the operation + string resourceName = "configuration1"; + MaintenanceConfigurationResource result = await collection.GetAsync(resourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchLinux + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_MaintenanceConfigurationsGetForResourceGuestOSPatchLinux() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationCollection collection = resourceGroupResource.GetMaintenanceConfigurations(); + + // invoke the operation + string resourceName = "configuration1"; + bool result = await collection.ExistsAsync(resourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchWindows + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MaintenanceConfigurationsGetForResourceGuestOSPatchWindows() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationCollection collection = resourceGroupResource.GetMaintenanceConfigurations(); + + // invoke the operation + string resourceName = "configuration1"; + MaintenanceConfigurationResource result = await collection.GetAsync(resourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchWindows + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_MaintenanceConfigurationsGetForResourceGuestOSPatchWindows() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +216,7 @@ public async Task Exists_MaintenanceConfigurationsGetForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MaintenanceConfigurationsCreateOrUpdateForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_CreateOrUpdateForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_CreateOrUpdateForResource.json // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +239,7 @@ public async Task CreateOrUpdate_MaintenanceConfigurationsCreateOrUpdateForResou MaintenanceConfigurationData data = new MaintenanceConfigurationData(new AzureLocation("westus2")) { Namespace = "Microsoft.Maintenance", - MaintenanceScope = MaintenanceScope.Host, + MaintenanceScope = MaintenanceScope.OSImage, Visibility = MaintenanceConfigurationVisibility.Custom, StartOn = DateTimeOffset.Parse("2020-04-30 08:00"), ExpireOn = DateTimeOffset.Parse("9999-12-31 00:00"), @@ -134,7 +262,7 @@ public async Task CreateOrUpdate_MaintenanceConfigurationsCreateOrUpdateForResou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_MaintenanceConfigurationsResourceGroupList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurationsResourceGroup_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurationsResourceGroup_List.json // this example is just showing the usage of "MaintenanceConfigurationsForResourceGroup_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationResource.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationResource.cs index 85ab88e54aa7..b5a529c481b3 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationResource.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenanceConfigurationResource.cs @@ -24,7 +24,69 @@ public partial class Sample_MaintenanceConfigurationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MaintenanceConfigurationResource created on azure + // for more information of creating MaintenanceConfigurationResource, please refer to the document of MaintenanceConfigurationResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + string resourceName = "configuration1"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + MaintenanceConfigurationResource maintenanceConfiguration = client.GetMaintenanceConfigurationResource(maintenanceConfigurationResourceId); + + // invoke the operation + MaintenanceConfigurationResource result = await maintenanceConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchLinux + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MaintenanceConfigurationsGetForResourceGuestOSPatchLinux() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MaintenanceConfigurationResource created on azure + // for more information of creating MaintenanceConfigurationResource, please refer to the document of MaintenanceConfigurationResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + string resourceName = "configuration1"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + MaintenanceConfigurationResource maintenanceConfiguration = client.GetMaintenanceConfigurationResource(maintenanceConfigurationResourceId); + + // invoke the operation + MaintenanceConfigurationResource result = await maintenanceConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // MaintenanceConfigurations_GetForResource_GuestOSPatchWindows + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MaintenanceConfigurationsGetForResourceGuestOSPatchWindows() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +117,7 @@ public async Task Get_MaintenanceConfigurationsGetForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MaintenanceConfigurationsDeleteForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_DeleteForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_DeleteForResource.json // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +144,7 @@ public async Task Delete_MaintenanceConfigurationsDeleteForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MaintenanceConfigurationsUpdateForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_UpdateForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_UpdateForResource.json // this example is just showing the usage of "MaintenanceConfigurations_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +164,7 @@ public async Task Update_MaintenanceConfigurationsUpdateForResource() MaintenanceConfigurationData data = new MaintenanceConfigurationData(new AzureLocation("westus2")) { Namespace = "Microsoft.Maintenance", - MaintenanceScope = MaintenanceScope.Host, + MaintenanceScope = MaintenanceScope.OSImage, Visibility = MaintenanceConfigurationVisibility.Custom, StartOn = DateTimeOffset.Parse("2020-04-30 08:00"), ExpireOn = DateTimeOffset.Parse("9999-12-31 00:00"), @@ -124,7 +186,7 @@ public async Task Update_MaintenanceConfigurationsUpdateForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMaintenanceConfigurations_MaintenanceConfigurationsList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_List.json // this example is just showing the usage of "MaintenanceConfigurations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationCollection.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationCollection.cs index 6e4d695954bc..c5f01e15a877 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationCollection.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MaintenancePublicConfigurationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_PublicMaintenanceConfigurationsList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_List.json // this example is just showing the usage of "PublicMaintenanceConfigurations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_PublicMaintenanceConfigurationsList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PublicMaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_GetForResource.json // this example is just showing the usage of "PublicMaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_PublicMaintenanceConfigurationsGetForResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_PublicMaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_GetForResource.json // this example is just showing the usage of "PublicMaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationResource.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationResource.cs index 7534a09de239..00f58bc10435 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationResource.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_MaintenancePublicConfigurationResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MaintenancePublicConfigurationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PublicMaintenanceConfigurationsGetForResource() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_GetForResource.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_GetForResource.json // this example is just showing the usage of "PublicMaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs index 4ce3c818e230..908558de02eb 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -18,12 +18,39 @@ namespace Azure.ResourceManager.Maintenance.Samples { public partial class Sample_ResourceGroupResourceExtensions { + // ConfigurationAssignments_GetParent + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConfigurationAssignmentByParent_ConfigurationAssignmentsGetParent() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_GetParent.json + // this example is just showing the usage of "ConfigurationAssignments_GetParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + ResourceGroupResourceGetConfigurationAssignmentByParentOptions options = new ResourceGroupResourceGetConfigurationAssignmentByParentOptions(providerName: "Microsoft.Compute", resourceParentType: "virtualMachineScaleSets", resourceParentName: "smdtest1", resourceType: "virtualMachines", resourceName: "smdvm1", configurationAssignmentName: "workervmPolicy") { }; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.GetConfigurationAssignmentByParentAsync(options); + + Console.WriteLine($"Succeeded: {result}"); + } + // ConfigurationAssignments_CreateOrUpdateParent [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateConfigurationAssignmentByParent_ConfigurationAssignmentsCreateOrUpdateParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_CreateOrUpdateParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_CreateOrUpdateParent.json // this example is just showing the usage of "ConfigurationAssignments_CreateOrUpdateParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +81,7 @@ public async Task CreateOrUpdateConfigurationAssignmentByParent_ConfigurationAss [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteConfigurationAssignmentByParent_ConfigurationAssignmentsDeleteParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_DeleteParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_DeleteParent.json // this example is just showing the usage of "ConfigurationAssignments_DeleteParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,12 +103,42 @@ public async Task DeleteConfigurationAssignmentByParent_ConfigurationAssignments Console.WriteLine($"Succeeded: {result}"); } + // ConfigurationAssignments_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConfigurationAssignment_ConfigurationAssignmentsGet() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_Get.json + // this example is just showing the usage of "ConfigurationAssignments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string providerName = "Microsoft.Compute"; + string resourceType = "virtualMachineScaleSets"; + string resourceName = "smdtest1"; + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.GetConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + // ConfigurationAssignments_CreateOrUpdate [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateConfigurationAssignment_ConfigurationAssignmentsCreateOrUpdate() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_CreateOrUpdate.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_CreateOrUpdate.json // this example is just showing the usage of "ConfigurationAssignments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +172,7 @@ public async Task CreateOrUpdateConfigurationAssignment_ConfigurationAssignments [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteConfigurationAssignment_ConfigurationAssignmentsDelete() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_Delete.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_Delete.json // this example is just showing the usage of "ConfigurationAssignments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +202,7 @@ public async Task DeleteConfigurationAssignment_ConfigurationAssignmentsDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConfigurationAssignmentsByParent_ConfigurationAssignmentsListParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_ListParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_ListParent.json // this example is just showing the usage of "ConfigurationAssignments_ListParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +236,7 @@ public async Task GetConfigurationAssignmentsByParent_ConfigurationAssignmentsLi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConfigurationAssignments_ConfigurationAssignmentsList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_List.json // this example is just showing the usage of "ConfigurationAssignments_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +268,7 @@ public async Task GetConfigurationAssignments_ConfigurationAssignmentsList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMaintenanceApplyUpdates_ApplyUpdatesResourceGroupList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdatesResourceGroup_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdatesResourceGroup_List.json // this example is just showing the usage of "ApplyUpdateForResourceGroup_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -239,12 +296,180 @@ public async Task GetMaintenanceApplyUpdates_ApplyUpdatesResourceGroupList() Console.WriteLine($"Succeeded"); } + // ConfigurationAssignmentsForResourceGroup_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConfigurationAssignmentByResourceGroup_ConfigurationAssignmentsForResourceGroupGet() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_Get.json + // this example is just showing the usage of "ConfigurationAssignmentsForResourceGroup_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.GetConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdateConfigurationAssignmentByResourceGroup_ConfigurationAssignmentsForResourceGroupCreateOrUpdate() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json + // this example is just showing the usage of "ConfigurationAssignmentsForResourceGroup_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData data = new MaintenanceConfigurationAssignmentData() + { + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), + Filter = new MaintenanceConfigurationAssignmentFilter() + { + ResourceTypes = +{ +new ResourceType("Microsoft.HybridCompute/machines"),new ResourceType("Microsoft.Compute/virtualMachines") +}, + Locations = +{ +new AzureLocation("Japan East"),new AzureLocation("UK South") +}, + TagSettings = new VmTagSettings() + { + Tags = +{ +["tag1"] = new string[] +{ +"tag1Value1","tag1Value2","tag1Value3" +}, +["tag2"] = new string[] +{ +"tag2Value1","tag2Value2","tag2Value3" +}, +}, + FilterOperator = VmTagOperator.Any, + }, + }, + }; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateConfigurationAssignmentByResourceGroup_ConfigurationAssignmentsForResourceGroupCreateOrUpdate() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_UpdateForResource.json + // this example is just showing the usage of "ConfigurationAssignmentsForResourceGroup_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData data = new MaintenanceConfigurationAssignmentData() + { + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), + Filter = new MaintenanceConfigurationAssignmentFilter() + { + ResourceTypes = +{ +new ResourceType("Microsoft.HybridCompute/machines"),new ResourceType("Microsoft.Compute/virtualMachines") +}, + Locations = +{ +new AzureLocation("Japan East"),new AzureLocation("UK South") +}, + TagSettings = new VmTagSettings() + { + Tags = +{ +["tag1"] = new string[] +{ +"tag1Value1","tag1Value2","tag1Value3" +}, +["tag2"] = new string[] +{ +"tag2Value1","tag2Value2","tag2Value3" +}, +}, + FilterOperator = VmTagOperator.Any, + }, + }, + }; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.UpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForResourceGroup_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeleteConfigurationAssignmentByResourceGroup_ConfigurationAssignmentsForResourceGroupDelete() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_Delete.json + // this example is just showing the usage of "ConfigurationAssignmentsForResourceGroup_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + string resourceGroupName = "examplerg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData result = await resourceGroupResource.DeleteConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + // Updates_ListParent [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUpdatesByParent_UpdatesListParent() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/Updates_ListParent.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/Updates_ListParent.json // this example is just showing the usage of "Updates_ListParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +503,7 @@ public async Task GetUpdatesByParent_UpdatesListParent() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUpdates_UpdatesList() { - // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/Updates_List.json + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/Updates_List.json // this example is just showing the usage of "Updates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..9909af44a625 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance; +using Azure.ResourceManager.Maintenance.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Maintenance.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + // ConfigurationAssignmentsResultWithinSubscription_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConfigurationAssignmentsBySubscription_ConfigurationAssignmentsResultWithinSubscriptionList() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsResultWithinSubscription_List.json + // this example is just showing the usage of "ConfigurationAssignmentsWithinSubscription_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (MaintenanceConfigurationAssignmentData item in subscriptionResource.GetConfigurationAssignmentsBySubscriptionAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // ConfigurationAssignments_GetParent + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConfigurationAssignmentBySubscription_ConfigurationAssignmentsGetParent() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_Get.json + // this example is just showing the usage of "ConfigurationAssignmentsForSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData result = await subscriptionResource.GetConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdateConfigurationAssignmentBySubscription_ConfigurationAssignmentsForSubscriptionsCreateOrUpdate() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json + // this example is just showing the usage of "ConfigurationAssignmentsForSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData data = new MaintenanceConfigurationAssignmentData() + { + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), + Filter = new MaintenanceConfigurationAssignmentFilter() + { + ResourceTypes = +{ +new ResourceType("Microsoft.HybridCompute/machines"),new ResourceType("Microsoft.Compute/virtualMachines") +}, + ResourceGroups = +{ +"RG1","RG2" +}, + Locations = +{ +new AzureLocation("Japan East"),new AzureLocation("UK South") +}, + TagSettings = new VmTagSettings() + { + Tags = +{ +["tag1"] = new string[] +{ +"tag1Value1","tag1Value2","tag1Value3" +}, +["tag2"] = new string[] +{ +"tag2Value1","tag2Value2","tag2Value3" +}, +}, + FilterOperator = VmTagOperator.Any, + }, + }, + }; + MaintenanceConfigurationAssignmentData result = await subscriptionResource.CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateConfigurationAssignmentBySubscription_ConfigurationAssignmentsForSubscriptionsCreateOrUpdate() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_UpdateForResource.json + // this example is just showing the usage of "ConfigurationAssignmentsForSubscriptions_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData data = new MaintenanceConfigurationAssignmentData() + { + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), + Filter = new MaintenanceConfigurationAssignmentFilter() + { + ResourceTypes = +{ +new ResourceType("Microsoft.HybridCompute/machines"),new ResourceType("Microsoft.Compute/virtualMachines") +}, + ResourceGroups = +{ +"RG1","RG2" +}, + Locations = +{ +new AzureLocation("Japan East"),new AzureLocation("UK South") +}, + TagSettings = new VmTagSettings() + { + Tags = +{ +["tag1"] = new string[] +{ +"tag1Value1","tag1Value2","tag1Value3" +}, +["tag2"] = new string[] +{ +"tag2Value1","tag2Value2","tag2Value3" +}, +}, + FilterOperator = VmTagOperator.Any, + }, + }, + }; + MaintenanceConfigurationAssignmentData result = await subscriptionResource.UpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConfigurationAssignmentsForSubscriptions_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeleteConfigurationAssignmentBySubscription_ConfigurationAssignmentsForSubscriptionsDelete() + { + // Generated from example definition: specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_Delete.json + // this example is just showing the usage of "ConfigurationAssignmentsForSubscriptions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5b4b650e-28b9-4790-b3ab-ddbd88d727c4"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string configurationAssignmentName = "workervmConfiguration"; + MaintenanceConfigurationAssignmentData result = await subscriptionResource.DeleteConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/ArmMaintenanceModelFactory.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/ArmMaintenanceModelFactory.cs index 79d9910f57c0..131338597c98 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/ArmMaintenanceModelFactory.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/ArmMaintenanceModelFactory.cs @@ -27,18 +27,19 @@ public static partial class ArmMaintenanceModelFactory /// Gets or sets extensionProperties of the maintenanceConfiguration. /// Gets or sets maintenanceScope of the configuration. /// Gets or sets the visibility of the configuration. The default value is 'Custom'. + /// The input parameters to be passed to the patch run operation. /// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. /// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59. /// Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00. /// Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time. - /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday. + /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. /// A new instance for mocking. - public static MaintenanceConfigurationData MaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string @namespace = null, IDictionary extensionProperties = null, MaintenanceScope? maintenanceScope = null, MaintenanceConfigurationVisibility? visibility = null, DateTimeOffset? startOn = null, DateTimeOffset? expireOn = null, TimeSpan? duration = null, string timeZone = null, string recurEvery = null) + public static MaintenanceConfigurationData MaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string @namespace = null, IDictionary extensionProperties = null, MaintenanceScope? maintenanceScope = null, MaintenanceConfigurationVisibility? visibility = null, MaintenancePatchConfiguration installPatches = null, DateTimeOffset? startOn = null, DateTimeOffset? expireOn = null, TimeSpan? duration = null, string timeZone = null, string recurEvery = null) { tags ??= new Dictionary(); extensionProperties ??= new Dictionary(); - return new MaintenanceConfigurationData(id, name, resourceType, systemData, tags, location, @namespace, extensionProperties, maintenanceScope, visibility, startOn, expireOn, duration, timeZone, recurEvery); + return new MaintenanceConfigurationData(id, name, resourceType, systemData, tags, location, @namespace, extensionProperties, maintenanceScope, visibility, installPatches, startOn, expireOn, duration, timeZone, recurEvery); } /// Initializes a new instance of MaintenanceApplyUpdateData. @@ -63,10 +64,11 @@ public static MaintenanceApplyUpdateData MaintenanceApplyUpdateData(ResourceIden /// Location of the resource. /// The maintenance configuration Id. /// The unique resourceId. + /// Properties of the configuration assignment. /// A new instance for mocking. - public static MaintenanceConfigurationAssignmentData MaintenanceConfigurationAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ResourceIdentifier maintenanceConfigurationId = null, ResourceIdentifier resourceId = null) + public static MaintenanceConfigurationAssignmentData MaintenanceConfigurationAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ResourceIdentifier maintenanceConfigurationId = null, ResourceIdentifier resourceId = null, MaintenanceConfigurationAssignmentFilter filter = null) { - return new MaintenanceConfigurationAssignmentData(id, name, resourceType, systemData, location, maintenanceConfigurationId, resourceId); + return new MaintenanceConfigurationAssignmentData(id, name, resourceType, systemData, location, maintenanceConfigurationId, resourceId, filter); } /// Initializes a new instance of MaintenanceUpdate. diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs index 9b0eb2c3108f..12644938a10a 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs @@ -397,6 +397,54 @@ public static Response CreateOrUpdateApplyUpdate return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateApplyUpdate(providerName, resourceType, resourceName, cancellationToken); } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_GetParent + /// + /// + /// + /// The instance the method will execute against. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// is null. + public static async Task> GetConfigurationAssignmentByParentAsync(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_GetParent + /// + /// + /// + /// The instance the method will execute against. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// is null. + public static Response GetConfigurationAssignmentByParent(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByParent(options, cancellationToken); + } + /// /// Register configuration for resource. /// @@ -493,6 +541,68 @@ public static Response DeleteConfigurati return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByParent(options, cancellationToken); } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_Get + /// + /// + /// + /// The instance the method will execute against. + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. + public static async Task> GetConfigurationAssignmentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_Get + /// + /// + /// + /// The instance the method will execute against. + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. + public static Response GetConfigurationAssignment(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); + } + /// /// Register configuration for resource. /// @@ -791,6 +901,214 @@ public static Pageable GetMaintenanceApplyUpdate return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMaintenanceApplyUpdates(cancellationToken); } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Get + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> GetConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Get + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response GetConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response CreateOrUpdateConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Update + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> UpdateConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Update + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response UpdateConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Delete + /// + /// + /// + /// The instance the method will execute against. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> DeleteConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Delete + /// + /// + /// + /// The instance the method will execute against. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response DeleteConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); + } + /// /// Get updates to resources. /// @@ -1058,5 +1376,255 @@ public static Pageable GetMaintenanceConfigura { return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenanceConfigurations(cancellationToken); } + + /// + /// Get configuration assignment within a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments + /// + /// + /// Operation Id + /// ConfigurationAssignmentsWithinSubscription_List + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetConfigurationAssignmentsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentsBySubscriptionAsync(cancellationToken); + } + + /// + /// Get configuration assignment within a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments + /// + /// + /// Operation Id + /// ConfigurationAssignmentsWithinSubscription_List + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetConfigurationAssignmentsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentsBySubscription(cancellationToken); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Get + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> GetConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Get + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response GetConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return await GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response CreateOrUpdateConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Update + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> UpdateConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return await GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Update + /// + /// + /// + /// The instance the method will execute against. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response UpdateConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Delete + /// + /// + /// + /// The instance the method will execute against. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> DeleteConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return await GetSubscriptionResourceExtensionClient(subscriptionResource).DeleteConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Delete + /// + /// + /// + /// The instance the method will execute against. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response DeleteConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).DeleteConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); + } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index 36817dcb5b45..59545cf0bfe9 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -25,6 +25,8 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource private ConfigurationAssignmentsRestOperations _configurationAssignmentsRestClient; private ClientDiagnostics _applyUpdateForResourceGroupClientDiagnostics; private ApplyUpdateForResourceGroupRestOperations _applyUpdateForResourceGroupRestClient; + private ClientDiagnostics _configurationAssignmentsForResourceGroupClientDiagnostics; + private ConfigurationAssignmentsForResourceGroupRestOperations _configurationAssignmentsForResourceGroupRestClient; private ClientDiagnostics _updatesClientDiagnostics; private UpdatesRestOperations _updatesRestClient; @@ -46,6 +48,8 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi private ConfigurationAssignmentsRestOperations ConfigurationAssignmentsRestClient => _configurationAssignmentsRestClient ??= new ConfigurationAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics ApplyUpdateForResourceGroupClientDiagnostics => _applyUpdateForResourceGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", ProviderConstants.DefaultProviderNamespace, Diagnostics); private ApplyUpdateForResourceGroupRestOperations ApplyUpdateForResourceGroupRestClient => _applyUpdateForResourceGroupRestClient ??= new ApplyUpdateForResourceGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ConfigurationAssignmentsForResourceGroupClientDiagnostics => _configurationAssignmentsForResourceGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ConfigurationAssignmentsForResourceGroupRestOperations ConfigurationAssignmentsForResourceGroupRestClient => _configurationAssignmentsForResourceGroupRestClient ??= new ConfigurationAssignmentsForResourceGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics UpdatesClientDiagnostics => _updatesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", ProviderConstants.DefaultProviderNamespace, Diagnostics); private UpdatesRestOperations UpdatesRestClient => _updatesRestClient ??= new UpdatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); @@ -267,6 +271,68 @@ public virtual Response CreateOrUpdateApplyUpdat } } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_GetParent + /// + /// + /// + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + public virtual async Task> GetConfigurationAssignmentByParentAsync(ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByParent"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsRestClient.GetParentAsync(Id.SubscriptionId, Id.ResourceGroupName, options.ProviderName, options.ResourceParentType, options.ResourceParentName, options.ResourceType, options.ResourceName, options.ConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_GetParent + /// + /// + /// + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + public virtual Response GetConfigurationAssignmentByParent(ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByParent"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsRestClient.GetParent(Id.SubscriptionId, Id.ResourceGroupName, options.ProviderName, options.ResourceParentType, options.ResourceParentName, options.ResourceType, options.ResourceName, options.ConfigurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Register configuration for resource. /// @@ -391,6 +457,74 @@ public virtual Response DeleteConfigurat } } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_Get + /// + /// + /// + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + public virtual async Task> GetConfigurationAssignmentAsync(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignment"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignments_Get + /// + /// + /// + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + public virtual Response GetConfigurationAssignment(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignment"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Register configuration for resource. /// @@ -671,6 +805,258 @@ public virtual Pageable GetMaintenanceApplyUpdat return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), ApplyUpdateForResourceGroupClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetMaintenanceApplyUpdates", "value", null, cancellationToken); } + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Get + /// + /// + /// + /// Configuration assignment name. + /// The cancellation token to use. + public virtual async Task> GetConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForResourceGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Get + /// + /// + /// + /// Configuration assignment name. + /// The cancellation token to use. + public virtual Response GetConfigurationAssignmentByResourceGroup(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForResourceGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual async Task> CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForResourceGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual Response CreateOrUpdateConfigurationAssignmentByResourceGroup(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForResourceGroupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, data, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Update + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual async Task> UpdateConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.UpdateConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForResourceGroupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Update + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual Response UpdateConfigurationAssignmentByResourceGroup(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.UpdateConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForResourceGroupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, data, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Delete + /// + /// + /// + /// Unique configuration assignment name. + /// The cancellation token to use. + public virtual async Task> DeleteConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForResourceGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForResourceGroup_Delete + /// + /// + /// + /// Unique configuration assignment name. + /// The cancellation token to use. + public virtual Response DeleteConfigurationAssignmentByResourceGroup(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByResourceGroup"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForResourceGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, configurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Get updates to resources. /// diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 39539bd2bceb..64fcfa06bbc3 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance.Models; namespace Azure.ResourceManager.Maintenance { @@ -20,6 +23,10 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ApplyUpdatesRestOperations _maintenanceApplyUpdateApplyUpdatesRestClient; private ClientDiagnostics _maintenanceConfigurationClientDiagnostics; private MaintenanceConfigurationsRestOperations _maintenanceConfigurationRestClient; + private ClientDiagnostics _configurationAssignmentsWithinSubscriptionClientDiagnostics; + private ConfigurationAssignmentsWithinSubscriptionRestOperations _configurationAssignmentsWithinSubscriptionRestClient; + private ClientDiagnostics _configurationAssignmentsForSubscriptionsClientDiagnostics; + private ConfigurationAssignmentsForSubscriptionsRestOperations _configurationAssignmentsForSubscriptionsRestClient; /// Initializes a new instance of the class for mocking. protected SubscriptionResourceExtensionClient() @@ -37,6 +44,10 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie private ApplyUpdatesRestOperations MaintenanceApplyUpdateApplyUpdatesRestClient => _maintenanceApplyUpdateApplyUpdatesRestClient ??= new ApplyUpdatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MaintenanceApplyUpdateResource.ResourceType)); private ClientDiagnostics MaintenanceConfigurationClientDiagnostics => _maintenanceConfigurationClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", MaintenanceConfigurationResource.ResourceType.Namespace, Diagnostics); private MaintenanceConfigurationsRestOperations MaintenanceConfigurationRestClient => _maintenanceConfigurationRestClient ??= new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MaintenanceConfigurationResource.ResourceType)); + private ClientDiagnostics ConfigurationAssignmentsWithinSubscriptionClientDiagnostics => _configurationAssignmentsWithinSubscriptionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ConfigurationAssignmentsWithinSubscriptionRestOperations ConfigurationAssignmentsWithinSubscriptionRestClient => _configurationAssignmentsWithinSubscriptionRestClient ??= new ConfigurationAssignmentsWithinSubscriptionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ConfigurationAssignmentsForSubscriptionsClientDiagnostics => _configurationAssignmentsForSubscriptionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Maintenance", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ConfigurationAssignmentsForSubscriptionsRestOperations ConfigurationAssignmentsForSubscriptionsRestClient => _configurationAssignmentsForSubscriptionsRestClient ??= new ConfigurationAssignmentsForSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -134,5 +145,299 @@ public virtual Pageable GetMaintenanceConfigur HttpMessage FirstPageRequest(int? pageSizeHint) => MaintenanceConfigurationRestClient.CreateListRequest(Id.SubscriptionId); return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationData.DeserializeMaintenanceConfigurationData(e)), MaintenanceConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMaintenanceConfigurations", "value", null, cancellationToken); } + + /// + /// Get configuration assignment within a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments + /// + /// + /// Operation Id + /// ConfigurationAssignmentsWithinSubscription_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetConfigurationAssignmentsBySubscriptionAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsWithinSubscriptionRestClient.CreateListRequest(Id.SubscriptionId); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); + } + + /// + /// Get configuration assignment within a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments + /// + /// + /// Operation Id + /// ConfigurationAssignmentsWithinSubscription_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetConfigurationAssignmentsBySubscription(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsWithinSubscriptionRestClient.CreateListRequest(Id.SubscriptionId); + return PageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Get + /// + /// + /// + /// Configuration assignment name. + /// The cancellation token to use. + public virtual async Task> GetConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForSubscriptionsRestClient.GetAsync(Id.SubscriptionId, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get configuration assignment for resource.. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Get + /// + /// + /// + /// Configuration assignment name. + /// The cancellation token to use. + public virtual Response GetConfigurationAssignmentBySubscription(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForSubscriptionsRestClient.Get(Id.SubscriptionId, configurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual async Task> CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForSubscriptionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual Response CreateOrUpdateConfigurationAssignmentBySubscription(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForSubscriptionsRestClient.CreateOrUpdate(Id.SubscriptionId, configurationAssignmentName, data, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Update + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual async Task> UpdateConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForSubscriptionsRestClient.UpdateAsync(Id.SubscriptionId, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Register configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Update + /// + /// + /// + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + public virtual Response UpdateConfigurationAssignmentBySubscription(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForSubscriptionsRestClient.Update(Id.SubscriptionId, configurationAssignmentName, data, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Delete + /// + /// + /// + /// Unique configuration assignment name. + /// The cancellation token to use. + public virtual async Task> DeleteConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DeleteConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = await ConfigurationAssignmentsForSubscriptionsRestClient.DeleteAsync(Id.SubscriptionId, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregister configuration for resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationAssignmentsForSubscriptions_Delete + /// + /// + /// + /// Unique configuration assignment name. + /// The cancellation token to use. + public virtual Response DeleteConfigurationAssignmentBySubscription(string configurationAssignmentName, CancellationToken cancellationToken = default) + { + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DeleteConfigurationAssignmentBySubscription"); + scope.Start(); + try + { + var response = ConfigurationAssignmentsForSubscriptionsRestClient.Delete(Id.SubscriptionId, configurationAssignmentName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/MaintenanceConfigurationData.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/MaintenanceConfigurationData.cs index 53867b700bdf..839ad6555b51 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/MaintenanceConfigurationData.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/MaintenanceConfigurationData.cs @@ -37,17 +37,19 @@ public MaintenanceConfigurationData(AzureLocation location) : base(location) /// Gets or sets extensionProperties of the maintenanceConfiguration. /// Gets or sets maintenanceScope of the configuration. /// Gets or sets the visibility of the configuration. The default value is 'Custom'. + /// The input parameters to be passed to the patch run operation. /// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. /// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59. /// Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00. /// Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time. - /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday. - internal MaintenanceConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string @namespace, IDictionary extensionProperties, MaintenanceScope? maintenanceScope, MaintenanceConfigurationVisibility? visibility, DateTimeOffset? startOn, DateTimeOffset? expireOn, TimeSpan? duration, string timeZone, string recurEvery) : base(id, name, resourceType, systemData, tags, location) + /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. + internal MaintenanceConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string @namespace, IDictionary extensionProperties, MaintenanceScope? maintenanceScope, MaintenanceConfigurationVisibility? visibility, MaintenancePatchConfiguration installPatches, DateTimeOffset? startOn, DateTimeOffset? expireOn, TimeSpan? duration, string timeZone, string recurEvery) : base(id, name, resourceType, systemData, tags, location) { Namespace = @namespace; ExtensionProperties = extensionProperties; MaintenanceScope = maintenanceScope; Visibility = visibility; + InstallPatches = installPatches; StartOn = startOn; ExpireOn = expireOn; Duration = duration; @@ -63,6 +65,8 @@ internal MaintenanceConfigurationData(ResourceIdentifier id, string name, Resour public MaintenanceScope? MaintenanceScope { get; set; } /// Gets or sets the visibility of the configuration. The default value is 'Custom'. public MaintenanceConfigurationVisibility? Visibility { get; set; } + /// The input parameters to be passed to the patch run operation. + public MaintenancePatchConfiguration InstallPatches { get; set; } /// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. public DateTimeOffset? StartOn { get; set; } /// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59. @@ -71,7 +75,7 @@ internal MaintenanceConfigurationData(ResourceIdentifier id, string name, Resour public TimeSpan? Duration { get; set; } /// Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time. public string TimeZone { get; set; } - /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday. + /// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. public string RecurEvery { get; set; } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.Serialization.cs index 17a258d576ea..ea75e954b082 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.Serialization.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.Serialization.cs @@ -33,6 +33,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); } + if (Optional.IsDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteObjectValue(Filter); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,6 +55,7 @@ internal static MaintenanceConfigurationAssignmentData DeserializeMaintenanceCon Optional systemData = default; Optional maintenanceConfigurationId = default; Optional resourceId = default; + Optional filter = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("location"u8)) @@ -112,11 +118,20 @@ internal static MaintenanceConfigurationAssignmentData DeserializeMaintenanceCon resourceId = new ResourceIdentifier(property0.Value.GetString()); continue; } + if (property0.NameEquals("filter"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filter = MaintenanceConfigurationAssignmentFilter.DeserializeMaintenanceConfigurationAssignmentFilter(property0.Value); + continue; + } } continue; } } - return new MaintenanceConfigurationAssignmentData(id, name, type, systemData.Value, Optional.ToNullable(location), maintenanceConfigurationId.Value, resourceId.Value); + return new MaintenanceConfigurationAssignmentData(id, name, type, systemData.Value, Optional.ToNullable(location), maintenanceConfigurationId.Value, resourceId.Value, filter.Value); } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.cs index 69d5fe7ffd90..0a172bc01016 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentData.cs @@ -26,11 +26,13 @@ public MaintenanceConfigurationAssignmentData() /// Location of the resource. /// The maintenance configuration Id. /// The unique resourceId. - internal MaintenanceConfigurationAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ResourceIdentifier maintenanceConfigurationId, ResourceIdentifier resourceId) : base(id, name, resourceType, systemData) + /// Properties of the configuration assignment. + internal MaintenanceConfigurationAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ResourceIdentifier maintenanceConfigurationId, ResourceIdentifier resourceId, MaintenanceConfigurationAssignmentFilter filter) : base(id, name, resourceType, systemData) { Location = location; MaintenanceConfigurationId = maintenanceConfigurationId; ResourceId = resourceId; + Filter = filter; } /// Location of the resource. @@ -39,5 +41,7 @@ internal MaintenanceConfigurationAssignmentData(ResourceIdentifier id, string na public ResourceIdentifier MaintenanceConfigurationId { get; set; } /// The unique resourceId. public ResourceIdentifier ResourceId { get; set; } + /// Properties of the configuration assignment. + public MaintenanceConfigurationAssignmentFilter Filter { get; set; } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.Serialization.cs new file mode 100644 index 000000000000..7105b3df9f8d --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + public partial class MaintenanceConfigurationAssignmentFilter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ResourceTypes)) + { + writer.WritePropertyName("resourceTypes"u8); + writer.WriteStartArray(); + foreach (var item in ResourceTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ResourceGroups)) + { + writer.WritePropertyName("resourceGroups"u8); + writer.WriteStartArray(); + foreach (var item in ResourceGroups) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OSTypes)) + { + writer.WritePropertyName("osTypes"u8); + writer.WriteStartArray(); + foreach (var item in OSTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Locations)) + { + writer.WritePropertyName("locations"u8); + writer.WriteStartArray(); + foreach (var item in Locations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TagSettings)) + { + writer.WritePropertyName("tagSettings"u8); + writer.WriteObjectValue(TagSettings); + } + writer.WriteEndObject(); + } + + internal static MaintenanceConfigurationAssignmentFilter DeserializeMaintenanceConfigurationAssignmentFilter(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> resourceTypes = default; + Optional> resourceGroups = default; + Optional> osTypes = default; + Optional> locations = default; + Optional tagSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ResourceType(item.GetString())); + } + resourceTypes = array; + continue; + } + if (property.NameEquals("resourceGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroups = array; + continue; + } + if (property.NameEquals("osTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + osTypes = array; + continue; + } + if (property.NameEquals("locations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + locations = array; + continue; + } + if (property.NameEquals("tagSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tagSettings = VmTagSettings.DeserializeVmTagSettings(property.Value); + continue; + } + } + return new MaintenanceConfigurationAssignmentFilter(Optional.ToList(resourceTypes), Optional.ToList(resourceGroups), Optional.ToList(osTypes), Optional.ToList(locations), tagSettings.Value); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.cs new file mode 100644 index 000000000000..1a2185058e55 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationAssignmentFilter.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Azure query for the update configuration. + public partial class MaintenanceConfigurationAssignmentFilter + { + /// Initializes a new instance of MaintenanceConfigurationAssignmentFilter. + public MaintenanceConfigurationAssignmentFilter() + { + ResourceTypes = new ChangeTrackingList(); + ResourceGroups = new ChangeTrackingList(); + OSTypes = new ChangeTrackingList(); + Locations = new ChangeTrackingList(); + } + + /// Initializes a new instance of MaintenanceConfigurationAssignmentFilter. + /// List of allowed resources. + /// List of allowed resource groups. + /// List of allowed operating systems. + /// List of locations to scope the query to. + /// Tag settings for the VM. + internal MaintenanceConfigurationAssignmentFilter(IList resourceTypes, IList resourceGroups, IList osTypes, IList locations, VmTagSettings tagSettings) + { + ResourceTypes = resourceTypes; + ResourceGroups = resourceGroups; + OSTypes = osTypes; + Locations = locations; + TagSettings = tagSettings; + } + + /// List of allowed resources. + public IList ResourceTypes { get; } + /// List of allowed resource groups. + public IList ResourceGroups { get; } + /// List of allowed operating systems. + public IList OSTypes { get; } + /// List of locations to scope the query to. + public IList Locations { get; } + /// Tag settings for the VM. + public VmTagSettings TagSettings { get; set; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationData.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationData.Serialization.cs index 6e9c055f7081..d5e93e6553bc 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationData.Serialization.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceConfigurationData.Serialization.cs @@ -32,6 +32,7 @@ internal static MaintenanceConfigurationData DeserializeMaintenanceConfiguration Optional> extensionProperties = default; Optional maintenanceScope = default; Optional visibility = default; + Optional installPatches = default; Optional startDateTime = default; Optional expirationDateTime = default; Optional duration = default; @@ -128,6 +129,15 @@ internal static MaintenanceConfigurationData DeserializeMaintenanceConfiguration visibility = new MaintenanceConfigurationVisibility(property0.Value.GetString()); continue; } + if (property0.NameEquals("installPatches"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + installPatches = MaintenancePatchConfiguration.DeserializeMaintenancePatchConfiguration(property0.Value); + continue; + } if (property0.NameEquals("maintenanceWindow"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -181,7 +191,7 @@ internal static MaintenanceConfigurationData DeserializeMaintenanceConfiguration continue; } } - return new MaintenanceConfigurationData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, @namespace.Value, Optional.ToDictionary(extensionProperties), Optional.ToNullable(maintenanceScope), Optional.ToNullable(visibility), Optional.ToNullable(startDateTime), Optional.ToNullable(expirationDateTime), Optional.ToNullable(duration), timeZone.Value, recurEvery.Value); + return new MaintenanceConfigurationData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, @namespace.Value, Optional.ToDictionary(extensionProperties), Optional.ToNullable(maintenanceScope), Optional.ToNullable(visibility), installPatches.Value, Optional.ToNullable(startDateTime), Optional.ToNullable(expirationDateTime), Optional.ToNullable(duration), timeZone.Value, recurEvery.Value); } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.Serialization.cs new file mode 100644 index 000000000000..955cf839e8e4 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.Serialization.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + public partial class MaintenanceLinuxPatchSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(PackageNameMasksToExclude)) + { + writer.WritePropertyName("packageNameMasksToExclude"u8); + writer.WriteStartArray(); + foreach (var item in PackageNameMasksToExclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PackageNameMasksToInclude)) + { + writer.WritePropertyName("packageNameMasksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in PackageNameMasksToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ClassificationsToInclude)) + { + writer.WritePropertyName("classificationsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in ClassificationsToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MaintenanceLinuxPatchSettings DeserializeMaintenanceLinuxPatchSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> packageNameMasksToExclude = default; + Optional> packageNameMasksToInclude = default; + Optional> classificationsToInclude = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("packageNameMasksToExclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + packageNameMasksToExclude = array; + continue; + } + if (property.NameEquals("packageNameMasksToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + packageNameMasksToInclude = array; + continue; + } + if (property.NameEquals("classificationsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + classificationsToInclude = array; + continue; + } + } + return new MaintenanceLinuxPatchSettings(Optional.ToList(packageNameMasksToExclude), Optional.ToList(packageNameMasksToInclude), Optional.ToList(classificationsToInclude)); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.cs new file mode 100644 index 000000000000..85af399e04e7 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceLinuxPatchSettings.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Input properties for patching a Linux machine. + public partial class MaintenanceLinuxPatchSettings + { + /// Initializes a new instance of MaintenanceLinuxPatchSettings. + public MaintenanceLinuxPatchSettings() + { + PackageNameMasksToExclude = new ChangeTrackingList(); + PackageNameMasksToInclude = new ChangeTrackingList(); + ClassificationsToInclude = new ChangeTrackingList(); + } + + /// Initializes a new instance of MaintenanceLinuxPatchSettings. + /// Package names to be excluded for patching. + /// Package names to be included for patching. + /// Classification category of patches to be patched. + internal MaintenanceLinuxPatchSettings(IList packageNameMasksToExclude, IList packageNameMasksToInclude, IList classificationsToInclude) + { + PackageNameMasksToExclude = packageNameMasksToExclude; + PackageNameMasksToInclude = packageNameMasksToInclude; + ClassificationsToInclude = classificationsToInclude; + } + + /// Package names to be excluded for patching. + public IList PackageNameMasksToExclude { get; } + /// Package names to be included for patching. + public IList PackageNameMasksToInclude { get; } + /// Classification category of patches to be patched. + public IList ClassificationsToInclude { get; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..ce06dbd12853 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.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.Maintenance.Models +{ + public partial class MaintenancePatchConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(RebootSetting)) + { + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.Value.ToString()); + } + if (Optional.IsDefined(WindowsParameters)) + { + writer.WritePropertyName("windowsParameters"u8); + writer.WriteObjectValue(WindowsParameters); + } + if (Optional.IsDefined(LinuxParameters)) + { + writer.WritePropertyName("linuxParameters"u8); + writer.WriteObjectValue(LinuxParameters); + } + writer.WriteEndObject(); + } + + internal static MaintenancePatchConfiguration DeserializeMaintenancePatchConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional rebootSetting = default; + Optional windowsParameters = default; + Optional linuxParameters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rebootSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootSetting = new MaintenanceRebootOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("windowsParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsParameters = MaintenanceWindowsPatchSettings.DeserializeMaintenanceWindowsPatchSettings(property.Value); + continue; + } + if (property.NameEquals("linuxParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxParameters = MaintenanceLinuxPatchSettings.DeserializeMaintenanceLinuxPatchSettings(property.Value); + continue; + } + } + return new MaintenancePatchConfiguration(Optional.ToNullable(rebootSetting), windowsParameters.Value, linuxParameters.Value); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.cs new file mode 100644 index 000000000000..24e9185a1173 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenancePatchConfiguration.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Input configuration for a patch run. + public partial class MaintenancePatchConfiguration + { + /// Initializes a new instance of MaintenancePatchConfiguration. + public MaintenancePatchConfiguration() + { + } + + /// Initializes a new instance of MaintenancePatchConfiguration. + /// Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed. + /// Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. + /// Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. + internal MaintenancePatchConfiguration(MaintenanceRebootOption? rebootSetting, MaintenanceWindowsPatchSettings windowsParameters, MaintenanceLinuxPatchSettings linuxParameters) + { + RebootSetting = rebootSetting; + WindowsParameters = windowsParameters; + LinuxParameters = linuxParameters; + } + + /// Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed. + public MaintenanceRebootOption? RebootSetting { get; set; } + /// Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. + public MaintenanceWindowsPatchSettings WindowsParameters { get; set; } + /// Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. + public MaintenanceLinuxPatchSettings LinuxParameters { get; set; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceRebootOption.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceRebootOption.cs new file mode 100644 index 000000000000..852fdc53f79b --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceRebootOption.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed. + public readonly partial struct MaintenanceRebootOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MaintenanceRebootOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// IfRequired. + public static MaintenanceRebootOption IfRequired { get; } = new MaintenanceRebootOption(IfRequiredValue); + /// Never. + public static MaintenanceRebootOption Never { get; } = new MaintenanceRebootOption(NeverValue); + /// Always. + public static MaintenanceRebootOption Always { get; } = new MaintenanceRebootOption(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(MaintenanceRebootOption left, MaintenanceRebootOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MaintenanceRebootOption left, MaintenanceRebootOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MaintenanceRebootOption(string value) => new MaintenanceRebootOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MaintenanceRebootOption other && Equals(other); + /// + public bool Equals(MaintenanceRebootOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceScope.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceScope.cs index 49529449a386..46a4d3bae257 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceScope.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceScope.cs @@ -23,6 +23,7 @@ public MaintenanceScope(string value) } private const string HostValue = "Host"; + private const string ResourceValue = "Resource"; private const string OSImageValue = "OSImage"; private const string ExtensionValue = "Extension"; private const string InGuestPatchValue = "InGuestPatch"; @@ -31,6 +32,8 @@ public MaintenanceScope(string value) /// This maintenance scope controls installation of azure platform updates i.e. services on physical nodes hosting customer VMs. public static MaintenanceScope Host { get; } = new MaintenanceScope(HostValue); + /// This maintenance scope controls the default update maintenance of the Azure Resource. + public static MaintenanceScope Resource { get; } = new MaintenanceScope(ResourceValue); /// This maintenance scope controls os image installation on VM/VMSS. public static MaintenanceScope OSImage { get; } = new MaintenanceScope(OSImageValue); /// This maintenance scope controls extension installation on VM/VMSS. diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.Serialization.cs new file mode 100644 index 000000000000..55fc7f555d26 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + public partial class MaintenanceWindowsPatchSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(KbNumbersToExclude)) + { + writer.WritePropertyName("kbNumbersToExclude"u8); + writer.WriteStartArray(); + foreach (var item in KbNumbersToExclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(KbNumbersToInclude)) + { + writer.WritePropertyName("kbNumbersToInclude"u8); + writer.WriteStartArray(); + foreach (var item in KbNumbersToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ClassificationsToInclude)) + { + writer.WritePropertyName("classificationsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in ClassificationsToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsExcludeKbsRebootRequired)) + { + writer.WritePropertyName("excludeKbsRequiringReboot"u8); + writer.WriteBooleanValue(IsExcludeKbsRebootRequired.Value); + } + writer.WriteEndObject(); + } + + internal static MaintenanceWindowsPatchSettings DeserializeMaintenanceWindowsPatchSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> kbNumbersToExclude = default; + Optional> kbNumbersToInclude = default; + Optional> classificationsToInclude = default; + Optional excludeKbsRequiringReboot = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kbNumbersToExclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + kbNumbersToExclude = array; + continue; + } + if (property.NameEquals("kbNumbersToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + kbNumbersToInclude = array; + continue; + } + if (property.NameEquals("classificationsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + classificationsToInclude = array; + continue; + } + if (property.NameEquals("excludeKbsRequiringReboot"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + excludeKbsRequiringReboot = property.Value.GetBoolean(); + continue; + } + } + return new MaintenanceWindowsPatchSettings(Optional.ToList(kbNumbersToExclude), Optional.ToList(kbNumbersToInclude), Optional.ToList(classificationsToInclude), Optional.ToNullable(excludeKbsRequiringReboot)); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.cs new file mode 100644 index 000000000000..605eae5c77f2 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/MaintenanceWindowsPatchSettings.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Input properties for patching a Windows machine. + public partial class MaintenanceWindowsPatchSettings + { + /// Initializes a new instance of MaintenanceWindowsPatchSettings. + public MaintenanceWindowsPatchSettings() + { + KbNumbersToExclude = new ChangeTrackingList(); + KbNumbersToInclude = new ChangeTrackingList(); + ClassificationsToInclude = new ChangeTrackingList(); + } + + /// Initializes a new instance of MaintenanceWindowsPatchSettings. + /// Windows KBID to be excluded for patching. + /// Windows KBID to be included for patching. + /// Classification category of patches to be patched. + /// Exclude patches which need reboot. + internal MaintenanceWindowsPatchSettings(IList kbNumbersToExclude, IList kbNumbersToInclude, IList classificationsToInclude, bool? isExcludeKbsRebootRequired) + { + KbNumbersToExclude = kbNumbersToExclude; + KbNumbersToInclude = kbNumbersToInclude; + ClassificationsToInclude = classificationsToInclude; + IsExcludeKbsRebootRequired = isExcludeKbsRebootRequired; + } + + /// Windows KBID to be excluded for patching. + public IList KbNumbersToExclude { get; } + /// Windows KBID to be included for patching. + public IList KbNumbersToInclude { get; } + /// Classification category of patches to be patched. + public IList ClassificationsToInclude { get; } + /// Exclude patches which need reboot. + public bool? IsExcludeKbsRebootRequired { get; set; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/ResourceGroupResourceGetConfigurationAssignmentByParentOptions.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/ResourceGroupResourceGetConfigurationAssignmentByParentOptions.cs new file mode 100644 index 000000000000..1024ad3f86e1 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/ResourceGroupResourceGetConfigurationAssignmentByParentOptions.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// The ResourceGroupResourceGetConfigurationAssignmentByParentOptions. + public partial class ResourceGroupResourceGetConfigurationAssignmentByParentOptions + { + /// Initializes a new instance of ResourceGroupResourceGetConfigurationAssignmentByParentOptions. + /// Resource provider name. + /// Resource parent type. + /// Resource parent identifier. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// , , , , or is null. + public ResourceGroupResourceGetConfigurationAssignmentByParentOptions(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName) + { + Argument.AssertNotNull(providerName, nameof(providerName)); + Argument.AssertNotNull(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNull(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + Argument.AssertNotNull(configurationAssignmentName, nameof(configurationAssignmentName)); + + ProviderName = providerName; + ResourceParentType = resourceParentType; + ResourceParentName = resourceParentName; + ResourceType = resourceType; + ResourceName = resourceName; + ConfigurationAssignmentName = configurationAssignmentName; + } + + /// Resource provider name. + public string ProviderName { get; } + /// Resource parent type. + public string ResourceParentType { get; } + /// Resource parent identifier. + public string ResourceParentName { get; } + /// Resource type. + public string ResourceType { get; } + /// Resource identifier. + public string ResourceName { get; } + /// Configuration assignment name. + public string ConfigurationAssignmentName { get; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.Serialization.cs new file mode 100644 index 000000000000..61014e7b4030 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Maintenance.Models +{ + internal static partial class VmTagOperatorExtensions + { + public static string ToSerialString(this VmTagOperator value) => value switch + { + VmTagOperator.All => "All", + VmTagOperator.Any => "Any", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VmTagOperator value.") + }; + + public static VmTagOperator ToVmTagOperator(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "All")) return VmTagOperator.All; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Any")) return VmTagOperator.Any; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VmTagOperator value."); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.cs new file mode 100644 index 000000000000..0733d092c3d0 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagOperator.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Filter VMs by Any or All specified tags. + public enum VmTagOperator + { + /// All. + All, + /// Any. + Any + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.Serialization.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.Serialization.cs new file mode 100644 index 000000000000..f241dfd8ccf8 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.Serialization.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + public partial class VmTagSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(FilterOperator)) + { + writer.WritePropertyName("filterOperator"u8); + writer.WriteStringValue(FilterOperator.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static VmTagSettings DeserializeVmTagSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional>> tags = default; + Optional filterOperator = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dictionary.Add(property0.Name, array); + } + } + tags = dictionary; + continue; + } + if (property.NameEquals("filterOperator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filterOperator = property.Value.GetString().ToVmTagOperator(); + continue; + } + } + return new VmTagSettings(Optional.ToDictionary(tags), Optional.ToNullable(filterOperator)); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.cs new file mode 100644 index 000000000000..e28176cea258 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Models/VmTagSettings.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Maintenance.Models +{ + /// Tag filter information for the VM. + public partial class VmTagSettings + { + /// Initializes a new instance of VmTagSettings. + public VmTagSettings() + { + Tags = new ChangeTrackingDictionary>(); + } + + /// Initializes a new instance of VmTagSettings. + /// Dictionary of tags with its list of values. + /// Filter VMs by Any or All specified tags. + internal VmTagSettings(IDictionary> tags, VmTagOperator? filterOperator) + { + Tags = tags; + FilterOperator = filterOperator; + } + + /// Dictionary of tags with its list of values. + public IDictionary> Tags { get; } + /// Filter VMs by Any or All specified tags. + public VmTagOperator? FilterOperator { get; set; } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdateForResourceGroupRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdateForResourceGroupRestOperations.cs index e16656feb69d..25c415cfde78 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdateForResourceGroupRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdateForResourceGroupRestOperations.cs @@ -33,7 +33,7 @@ public ApplyUpdateForResourceGroupRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdatesRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdatesRestOperations.cs index 9ab5caf317e1..ac6362773a27 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdatesRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ApplyUpdatesRestOperations.cs @@ -33,7 +33,7 @@ public ApplyUpdatesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -300,6 +300,7 @@ public async Task> CreateOrUpdateParentAsyn switch (message.Response.Status) { case 200: + case 201: { MaintenanceApplyUpdateData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -337,6 +338,7 @@ public Response CreateOrUpdateParent(string subscrip switch (message.Response.Status) { case 200: + case 201: { MaintenanceApplyUpdateData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); @@ -395,6 +397,7 @@ public async Task> CreateOrUpdateAsync(stri switch (message.Response.Status) { case 200: + case 201: { MaintenanceApplyUpdateData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -428,6 +431,7 @@ public Response CreateOrUpdate(string subscriptionId switch (message.Response.Status) { case 200: + case 201: { MaintenanceApplyUpdateData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForResourceGroupRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForResourceGroupRestOperations.cs new file mode 100644 index 000000000000..963160dc31a4 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForResourceGroupRestOperations.cs @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Maintenance.Models; + +namespace Azure.ResourceManager.Maintenance +{ + internal partial class ConfigurationAssignmentsForResourceGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConfigurationAssignmentsForResourceGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConfigurationAssignmentsForResourceGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, configurationAssignmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, configurationAssignmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, configurationAssignmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, configurationAssignmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Unregister configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> DeleteAsync(string subscriptionId, string resourceGroupName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((MaintenanceConfigurationAssignmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unregister configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((MaintenanceConfigurationAssignmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForSubscriptionsRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForSubscriptionsRestOperations.cs new file mode 100644 index 000000000000..990ace62a7ee --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsForSubscriptionsRestOperations.cs @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Maintenance.Models; + +namespace Azure.ResourceManager.Maintenance +{ + internal partial class ConfigurationAssignmentsForSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConfigurationAssignmentsForSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConfigurationAssignmentsForSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, configurationAssignmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, configurationAssignmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, configurationAssignmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Register configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Configuration assignment name. + /// The configurationAssignment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, configurationAssignmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Unregister configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> DeleteAsync(string subscriptionId, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateDeleteRequest(subscriptionId, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((MaintenanceConfigurationAssignmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unregister configuration for resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Unique configuration assignment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateDeleteRequest(subscriptionId, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((MaintenanceConfigurationAssignmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsRestOperations.cs index ec2925bf8edb..6a26ce06130d 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsRestOperations.cs @@ -33,10 +33,118 @@ public ConfigurationAssignmentsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal HttpMessage CreateGetParentRequest(string subscriptionId, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/", false); + uri.AppendPath(providerName, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceParentType, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceParentName, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceType, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Resource provider name. + /// Resource parent type. + /// Resource parent identifier. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , , , , , or is null. + /// , , , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetParentAsync(string subscriptionId, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetParentRequest(subscriptionId, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Resource provider name. + /// Resource parent type. + /// Resource parent identifier. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , , , , , or is null. + /// , , , , , , or is an empty string, and was expected to be non-empty. + public Response GetParent(string subscriptionId, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetParentRequest(subscriptionId, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateCreateOrUpdateParentRequest(string subscriptionId, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) { var message = _pipeline.CreateMessage(); @@ -101,6 +209,7 @@ public async Task> CreateOrUpda switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationAssignmentData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -142,6 +251,7 @@ public Response CreateOrUpdateParent(str switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationAssignmentData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); @@ -265,6 +375,102 @@ public Response DeleteParent(string subs } } + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/", false); + uri.AppendPath(providerName, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceType, true); + uri.AppendPath("/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments/", false); + uri.AppendPath(configurationAssignmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get configuration assignment for resource.. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Resource group name. + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// Configuration assignment name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data) { var message = _pipeline.CreateMessage(); @@ -321,6 +527,7 @@ public async Task> CreateOrUpda switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationAssignmentData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -358,6 +565,7 @@ public Response CreateOrUpdate(string su switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationAssignmentData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsWithinSubscriptionRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsWithinSubscriptionRestOperations.cs new file mode 100644 index 000000000000..d123705c78c5 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/ConfigurationAssignmentsWithinSubscriptionRestOperations.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Maintenance.Models; + +namespace Azure.ResourceManager.Maintenance +{ + internal partial class ConfigurationAssignmentsWithinSubscriptionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConfigurationAssignmentsWithinSubscriptionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConfigurationAssignmentsWithinSubscriptionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Maintenance/configurationAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get configuration assignment within a subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationAssignmentListResult.DeserializeMaintenanceConfigurationAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get configuration assignment within a subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationAssignmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MaintenanceConfigurationAssignmentListResult.DeserializeMaintenanceConfigurationAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsForResourceGroupRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsForResourceGroupRestOperations.cs index 18dd017544a3..4887dfcdef8c 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsForResourceGroupRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsForResourceGroupRestOperations.cs @@ -33,7 +33,7 @@ public MaintenanceConfigurationsForResourceGroupRestOperations(HttpPipeline pipe { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs index 1fd1c4639033..339001128ef0 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs @@ -33,7 +33,7 @@ public MaintenanceConfigurationsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -163,6 +163,7 @@ public async Task> CreateOrUpdateAsync(st switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -194,6 +195,7 @@ public Response CreateOrUpdate(string subscription switch (message.Response.Status) { case 200: + case 201: { MaintenanceConfigurationData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/PublicMaintenanceConfigurationsRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/PublicMaintenanceConfigurationsRestOperations.cs index 05ae61b4c0c3..10f5a31635c9 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/PublicMaintenanceConfigurationsRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/PublicMaintenanceConfigurationsRestOperations.cs @@ -33,7 +33,7 @@ public PublicMaintenanceConfigurationsRestOperations(HttpPipeline pipeline, stri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/UpdatesRestOperations.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/UpdatesRestOperations.cs index 6b478cfe4c9d..32b3023d9096 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/UpdatesRestOperations.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/RestOperations/UpdatesRestOperations.cs @@ -33,7 +33,7 @@ public UpdatesRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01"; + _apiVersion = apiVersion ?? "2023-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/autorest.md b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/autorest.md index 822f9c2235ef..79d89f8af9ef 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/autorest.md +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/autorest.md @@ -8,15 +8,17 @@ azure-arm: true csharp: true library-name: Maintenance namespace: Azure.ResourceManager.Maintenance -# default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/7d5d1db0c45d6fe0934c97b6a6f9bb34112d42d1/specification/maintenance/resource-manager/readme.md -tag: package-2021-05 +require: https://github.com/Azure/azure-rest-api-specs/blob/e680f9bf4f154ec427ba7feac432ed8efd9665d0/specification/maintenance/resource-manager/readme.md +#tag: package-2023-04 output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +#mgmt-debug: +# show-serialized-names: true + format-by-name-rules: 'tenantId': 'uuid' 'ETag': 'etag' @@ -25,10 +27,12 @@ format-by-name-rules: '*Uris': 'Uri' rename-mapping: - ApplyUpdate: MaintenanceApplyUpdate - Update: MaintenanceUpdate - ImpactType: MaintenanceImpactType ConfigurationAssignment: MaintenanceConfigurationAssignmentData + ConfigurationAssignmentFilterProperties: MaintenanceConfigurationAssignmentFilter + ConfigurationAssignmentFilterProperties.resourceTypes: -|resource-type + ConfigurationAssignmentFilterProperties.locations: -|azure-location + TagOperators: VmTagOperator + TagSettingsProperties: VmTagSettings ApplyUpdate.properties.resourceId: -|arm-id ConfigurationAssignment.properties.resourceId: -|arm-id Update.properties.resourceId: -|arm-id @@ -39,21 +43,45 @@ rename-mapping: ListUpdatesResult: MaintenanceUpdateListResult ListMaintenanceConfigurationsResult: MaintenanceConfigurationListResult ListConfigurationAssignmentsResult: MaintenanceConfigurationAssignmentListResult - UpdateStatus: MaintenanceUpdateStatus Visibility: MaintenanceConfigurationVisibility ApplyUpdate.properties.lastUpdateTime: LastUpdatedOn + InputPatchConfiguration: MaintenancePatchConfiguration + InputWindowsParameters: MaintenanceWindowsPatchSettings + InputWindowsParameters.excludeKbsRequiringReboot: IsExcludeKbsRebootRequired + InputLinuxParameters: MaintenanceLinuxPatchSettings +prepend-rp-prefix: + - ApplyUpdate + - ImpactType + - RebootOptions + - Update + - UpdateStatus + override-operation-name: ApplyUpdates_GetParent: GetApplyUpdatesByParent ApplyUpdates_CreateOrUpdateParent: CreateOrUpdateApplyUpdateByParent ConfigurationAssignments_CreateOrUpdateParent: CreateOrUpdateConfigurationAssignmentByParent + ConfigurationAssignmentsForResourceGroup_CreateOrUpdate: CreateOrUpdateConfigurationAssignmentByResourceGroup + ConfigurationAssignmentsForSubscriptions_CreateOrUpdate: CreateOrUpdateConfigurationAssignmentBySubscription ConfigurationAssignments_DeleteParent: DeleteConfigurationAssignmentByParent + ConfigurationAssignmentsForResourceGroup_Delete: DeleteConfigurationAssignmentByResourceGroup + ConfigurationAssignmentsForSubscriptions_Delete: DeleteConfigurationAssignmentBySubscription + ConfigurationAssignments_GetParent: GetConfigurationAssignmentByParent + ConfigurationAssignmentsForResourceGroup_Get: GetConfigurationAssignmentByResourceGroup + ConfigurationAssignmentsForSubscriptions_Get: GetConfigurationAssignmentBySubscription ConfigurationAssignments_ListParent: GetConfigurationAssignmentsByParent + ConfigurationAssignmentsWithinSubscription_List: GetConfigurationAssignmentsBySubscription + ConfigurationAssignmentsForResourceGroup_Update: UpdateConfigurationAssignmentByResourceGroup + ConfigurationAssignmentsForSubscriptions_Update: UpdateConfigurationAssignmentBySubscription Updates_ListParent: GetUpdatesByParent MaintenanceConfigurations_Delete: DeleteEx request-path-is-non-resource: - /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName} + - /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + - /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + - /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} + - /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName} request-path-to-resource-name: /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}: MaintenancePublicConfiguration diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/tests/Scenario/MaintenancePublicConfigurationTests.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/tests/Scenario/MaintenancePublicConfigurationTests.cs new file mode 100644 index 000000000000..452ac2fe9c22 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/tests/Scenario/MaintenancePublicConfigurationTests.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Maintenance.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Maintenance.Tests +{ + public sealed class MaintenancePublicConfigurationTests : MaintenanceManagementTestBase + { + public MaintenancePublicConfigurationTests(bool isAsync) : base(isAsync) //, RecordedTestMode.Record) + { } + + [RecordedTest] + public async Task MaintenancePublicConfigurationGetForResourceTest() + { + //string assetName = "maintenance-config-"; + string subscriptionId = "eee2cef4-bc47-4278-b4f8-cfc65f25dfd8"; + string resourceName = "aks-mrp-cfg-weekday_utc-7-eastus2euap"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenancePublicConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceName); + MaintenancePublicConfigurationResource maintenancePublicConfiguration = Client.GetMaintenancePublicConfigurationResource(maintenanceConfigurationResourceId); + + MaintenancePublicConfigurationResource result = await maintenancePublicConfiguration.GetAsync(); + + MaintenanceConfigurationData resourceData = result.Data; + + Assert.IsNotNull(resourceData); + Assert.IsTrue(resourceData.MaintenanceScope.Equals(MaintenanceScope.Resource)); + } + } +}